Skip to content

Commit ad23b45

Browse files
authored
Pin DXC and Vulkan SDK version (#4980)
1 parent d96d953 commit ad23b45

File tree

3 files changed

+80
-18
lines changed

3 files changed

+80
-18
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,42 @@ on:
88
merge_group:
99

1010
env:
11+
#
12+
# Dependency versioning
13+
#
14+
15+
# Sourced from https://vulkan.lunarg.com/sdk/home#linux
16+
VULKAN_SDK_VERSION: "1.3.268"
17+
# Sourced from https://www.nuget.org/packages/Microsoft.Direct3D.WARP
18+
WARP_VERSION: "1.0.8"
19+
20+
# Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases
21+
#
22+
# Must also be changed in shaders.yaml
23+
DXC_RELEASE: "v1.7.2308"
24+
DXC_FILENAME: "dxc_2023_08_14.zip"
25+
26+
# Sourced from https://archive.mesa3d.org/. Bumping this requires
27+
# updating the mesa build in https://github.com/gfx-rs/ci-build and creating a new release.
1128
MESA_VERSION: "23.3.1"
29+
# Corresponds to https://github.com/gfx-rs/ci-build/releases
1230
CI_BINARY_BUILD: "build18"
1331

14-
CARGO_INCREMENTAL: false
15-
CARGO_TERM_COLOR: always
16-
WGPU_DX12_COMPILER: dxc
17-
RUST_LOG: info
18-
RUST_BACKTRACE: full
1932
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
2033
REPO_MSRV: "1.71"
2134
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
2235
# to ensure that they can be used with firefox.
2336
CORE_MSRV: "1.65"
37+
38+
#
39+
# Environment variables
40+
#
41+
42+
CARGO_INCREMENTAL: false
43+
CARGO_TERM_COLOR: always
44+
WGPU_DX12_COMPILER: dxc
45+
RUST_LOG: info
46+
RUST_BACKTRACE: full
2447
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
2548
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
2649
RUSTDOCFLAGS: -Dwarnings
@@ -365,15 +388,26 @@ jobs:
365388
366389
- name: (windows) install dxc
367390
if: matrix.os == 'windows-2022'
368-
uses: napokue/[email protected]
391+
shell: bash
392+
run: |
393+
set -e
394+
395+
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
396+
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll,dxil.dll}
397+
398+
# We need to use cygpath to convert PWD to a windows path as we're using bash.
399+
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
369400
370401
- name: (windows) install warp
371402
if: matrix.os == 'windows-2022'
372403
shell: bash
373404
run: |
374405
set -e
375406
376-
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -o warp.zip
407+
# Make sure dxc is in path.
408+
dxc --version
409+
410+
curl.exe -L --retry 5 https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/$WARP_VERSION -o warp.zip
377411
7z.exe e warp.zip -owarp build/native/amd64/d3d10warp.dll
378412
379413
mkdir -p target/llvm-cov-target/debug/deps
@@ -393,7 +427,8 @@ jobs:
393427
cp -v mesa/* target/llvm-cov-target/debug/
394428
cp -v mesa/* target/llvm-cov-target/debug/deps
395429
396-
echo "VK_DRIVER_FILES=$PWD/mesa/lvp_icd.x86_64.json" >> "$GITHUB_ENV"
430+
# We need to use cygpath to convert PWD to a windows path as we're using bash.
431+
echo "VK_DRIVER_FILES=`cygpath --windows $PWD/mesa/lvp_icd.x86_64.json`" >> "$GITHUB_ENV"
397432
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
398433
399434
- name: (linux) install vulkan sdk
@@ -406,7 +441,7 @@ jobs:
406441
407442
# vulkan sdk
408443
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
409-
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
444+
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-$VULKAN_SDK_VERSION-jammy.list https://packages.lunarg.com/vulkan/$VULKAN_SDK_VERSION/lunarg-vulkan-$VULKAN_SDK_VERSION-jammy.list
410445
411446
sudo apt-get update
412447
sudo apt install -y vulkan-sdk
@@ -421,6 +456,9 @@ jobs:
421456
mkdir mesa
422457
tar xpf mesa.tar.xz -C mesa
423458
459+
# The ICD provided by the mesa build is hardcoded to the build environment.
460+
#
461+
# We write out our own ICD file to point to the mesa vulkan
424462
cat <<- EOF > icd.json
425463
{
426464
"ICD": {

.github/workflows/shaders.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,28 @@ on:
77
pull_request:
88
merge_group:
99

10+
env:
11+
# Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases
12+
#
13+
# Must also be changed in ci.yaml
14+
DXC_RELEASE: "v1.7.2308"
15+
DXC_FILENAME: "dxc_2023_08_14.zip"
16+
1017
jobs:
1118
naga-validate-windows:
1219
name: "Validate: HLSL"
1320
runs-on: windows-latest
1421
steps:
1522
- uses: actions/checkout@v4
1623

17-
- name: Setup DXC
18-
uses: napokue/[email protected]
24+
- uses: Swatinem/rust-cache@v2
25+
with:
26+
workspaces: |
27+
naga/xtask -> naga/xtask/target
1928
29+
# We must have the FXC job before the DXC job, so the DXC PATH has priority
30+
# over the FXC PATH. This is because the windows kits also include an older
31+
# version of DXC, which we don't want to use.
2032
- name: Setup FXC
2133
run: |
2234
Get-Childitem -Path "C:\Program Files (x86)\Windows Kits\10\bin\**\x64\fxc.exe" `
@@ -26,16 +38,28 @@ jobs:
2638
| Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
2739
shell: powershell
2840

29-
- uses: Swatinem/rust-cache@v2
30-
with:
31-
workspaces: |
32-
naga/xtask -> naga/xtask/target
41+
- name: Setup DXC
42+
shell: bash
43+
run: |
44+
set -e
45+
46+
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
47+
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll,dxil.dll}
48+
49+
# We need to use cygpath to convert PWD to a windows path as we're using bash.
50+
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
51+
52+
- name: Validate
53+
shell: bash
54+
run: |
55+
set -e
56+
57+
dxc --version
3358
34-
- run: |
3559
cd naga
3660
cargo xtask validate hlsl dxc
3761
cargo xtask validate hlsl fxc
38-
62+
3963
naga-validate-macos:
4064
name: "Validate: MSL"
4165
runs-on: macos-latest

wgpu-hal/src/dx12/shader_compilation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mod dxc {
9999
let dxil = match hassle_rs::Dxil::new(dxil_path) {
100100
Ok(dxil) => dxil,
101101
Err(e) => {
102-
log::warn!("Failed to load dxil.dll. Defaulting to DXC instead: {}", e);
102+
log::warn!("Failed to load dxil.dll. Defaulting to FXC instead: {}", e);
103103
return Ok(None);
104104
}
105105
};

0 commit comments

Comments
 (0)