Pin DXC and Vulkan SDK version (#4980)

This commit is contained in:
Connor Fitzgerald 2024-01-04 03:41:13 -05:00 committed by GitHub
parent d96d953025
commit ad23b450d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 18 deletions

View File

@ -8,19 +8,42 @@ on:
merge_group: merge_group:
env: env:
#
# Dependency versioning
#
# Sourced from https://vulkan.lunarg.com/sdk/home#linux
VULKAN_SDK_VERSION: "1.3.268"
# Sourced from https://www.nuget.org/packages/Microsoft.Direct3D.WARP
WARP_VERSION: "1.0.8"
# Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases
#
# Must also be changed in shaders.yaml
DXC_RELEASE: "v1.7.2308"
DXC_FILENAME: "dxc_2023_08_14.zip"
# Sourced from https://archive.mesa3d.org/. Bumping this requires
# updating the mesa build in https://github.com/gfx-rs/ci-build and creating a new release.
MESA_VERSION: "23.3.1" MESA_VERSION: "23.3.1"
# Corresponds to https://github.com/gfx-rs/ci-build/releases
CI_BINARY_BUILD: "build18" CI_BINARY_BUILD: "build18"
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.71"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.65"
#
# Environment variables
#
CARGO_INCREMENTAL: false CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
WGPU_DX12_COMPILER: dxc WGPU_DX12_COMPILER: dxc
RUST_LOG: info RUST_LOG: info
RUST_BACKTRACE: full RUST_BACKTRACE: full
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.71"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.65"
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -Dwarnings RUSTDOCFLAGS: -Dwarnings
@ -365,7 +388,15 @@ jobs:
- name: (windows) install dxc - name: (windows) install dxc
if: matrix.os == 'windows-2022' if: matrix.os == 'windows-2022'
uses: napokue/setup-dxc@v1.1.0 shell: bash
run: |
set -e
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll,dxil.dll}
# We need to use cygpath to convert PWD to a windows path as we're using bash.
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
- name: (windows) install warp - name: (windows) install warp
if: matrix.os == 'windows-2022' if: matrix.os == 'windows-2022'
@ -373,7 +404,10 @@ jobs:
run: | run: |
set -e set -e
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -o warp.zip # Make sure dxc is in path.
dxc --version
curl.exe -L --retry 5 https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/$WARP_VERSION -o warp.zip
7z.exe e warp.zip -owarp build/native/amd64/d3d10warp.dll 7z.exe e warp.zip -owarp build/native/amd64/d3d10warp.dll
mkdir -p target/llvm-cov-target/debug/deps mkdir -p target/llvm-cov-target/debug/deps
@ -393,7 +427,8 @@ jobs:
cp -v mesa/* target/llvm-cov-target/debug/ cp -v mesa/* target/llvm-cov-target/debug/
cp -v mesa/* target/llvm-cov-target/debug/deps cp -v mesa/* target/llvm-cov-target/debug/deps
echo "VK_DRIVER_FILES=$PWD/mesa/lvp_icd.x86_64.json" >> "$GITHUB_ENV" # We need to use cygpath to convert PWD to a windows path as we're using bash.
echo "VK_DRIVER_FILES=`cygpath --windows $PWD/mesa/lvp_icd.x86_64.json`" >> "$GITHUB_ENV"
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV" echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
- name: (linux) install vulkan sdk - name: (linux) install vulkan sdk
@ -406,7 +441,7 @@ jobs:
# vulkan sdk # vulkan sdk
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list 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
sudo apt-get update sudo apt-get update
sudo apt install -y vulkan-sdk sudo apt install -y vulkan-sdk
@ -421,6 +456,9 @@ jobs:
mkdir mesa mkdir mesa
tar xpf mesa.tar.xz -C mesa tar xpf mesa.tar.xz -C mesa
# The ICD provided by the mesa build is hardcoded to the build environment.
#
# We write out our own ICD file to point to the mesa vulkan
cat <<- EOF > icd.json cat <<- EOF > icd.json
{ {
"ICD": { "ICD": {

View File

@ -7,6 +7,13 @@ on:
pull_request: pull_request:
merge_group: merge_group:
env:
# Sourced from https://github.com/microsoft/DirectXShaderCompiler/releases
#
# Must also be changed in ci.yaml
DXC_RELEASE: "v1.7.2308"
DXC_FILENAME: "dxc_2023_08_14.zip"
jobs: jobs:
naga-validate-windows: naga-validate-windows:
name: "Validate: HLSL" name: "Validate: HLSL"
@ -14,9 +21,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup DXC - uses: Swatinem/rust-cache@v2
uses: napokue/setup-dxc@v1.1.0 with:
workspaces: |
naga/xtask -> naga/xtask/target
# We must have the FXC job before the DXC job, so the DXC PATH has priority
# over the FXC PATH. This is because the windows kits also include an older
# version of DXC, which we don't want to use.
- name: Setup FXC - name: Setup FXC
run: | run: |
Get-Childitem -Path "C:\Program Files (x86)\Windows Kits\10\bin\**\x64\fxc.exe" ` Get-Childitem -Path "C:\Program Files (x86)\Windows Kits\10\bin\**\x64\fxc.exe" `
@ -26,16 +38,28 @@ jobs:
| Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell shell: powershell
- uses: Swatinem/rust-cache@v2 - name: Setup DXC
with: shell: bash
workspaces: | run: |
naga/xtask -> naga/xtask/target set -e
curl.exe -L --retry 5 https://github.com/microsoft/DirectXShaderCompiler/releases/download/$DXC_RELEASE/$DXC_FILENAME -o dxc.zip
7z.exe e dxc.zip -odxc bin/x64/{dxc.exe,dxcompiler.dll,dxil.dll}
# We need to use cygpath to convert PWD to a windows path as we're using bash.
cygpath --windows "$PWD/dxc" >> "$GITHUB_PATH"
- name: Validate
shell: bash
run: |
set -e
dxc --version
- run: |
cd naga cd naga
cargo xtask validate hlsl dxc cargo xtask validate hlsl dxc
cargo xtask validate hlsl fxc cargo xtask validate hlsl fxc
naga-validate-macos: naga-validate-macos:
name: "Validate: MSL" name: "Validate: MSL"
runs-on: macos-latest runs-on: macos-latest

View File

@ -99,7 +99,7 @@ mod dxc {
let dxil = match hassle_rs::Dxil::new(dxil_path) { let dxil = match hassle_rs::Dxil::new(dxil_path) {
Ok(dxil) => dxil, Ok(dxil) => dxil,
Err(e) => { Err(e) => {
log::warn!("Failed to load dxil.dll. Defaulting to DXC instead: {}", e); log::warn!("Failed to load dxil.dll. Defaulting to FXC instead: {}", e);
return Ok(None); return Ok(None);
} }
}; };