Skip to content

Commit

Permalink
test: use spirv-as instead of pre-assembled SPIR-V (gfx-rs#7157)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored Feb 17, 2025
1 parent 7240c18 commit e590555
Show file tree
Hide file tree
Showing 46 changed files with 473 additions and 389 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ env:
#

# Sourced from https://vulkan.lunarg.com/sdk/home#linux
#
# We don't include the 4th version number, as it's not used in any URL.
VULKAN_SDK_VERSION: "1.4.304"
VULKAN_FULL_SDK_VERSION: "1.4.304.1"
# Sourced from https://www.nuget.org/packages/Microsoft.Direct3D.WARP
WARP_VERSION: "1.0.13"

Expand Down Expand Up @@ -56,7 +55,7 @@ env:
RUSTDOCFLAGS: -D warnings
WASM_BINDGEN_TEST_TIMEOUT: 300 # 5 minutes
CACHE_SUFFIX: d # cache busting
WGPU_TESTING: true
WGPU_CI: true

# We distinguish the following kinds of builds:
# - native: build for the same target as we compile on
Expand Down Expand Up @@ -567,6 +566,32 @@ jobs:
echo "VK_DRIVER_FILES=`cygpath --windows $PWD/mesa/lvp_icd.x86_64.json`" >> "$GITHUB_ENV"
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
- name: (windows) install vulkan sdk
if: matrix.os == 'windows-2022'
shell: bash
run: |
set -e
curl.exe -L --retry 5 https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_FULL_SDK_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_FULL_SDK_VERSION }}-Installer.exe -o vulkan-sdk-installer.exe
./vulkan-sdk-installer.exe --accept-licenses --default-answer --confirm-command install
echo "C:/VulkanSDK/${{ env.VULKAN_FULL_SDK_VERSION }}/Bin" >> "$GITHUB_PATH"
- name: (mac) install vulkan sdk
if: matrix.os == 'macos-14'
shell: bash
run: |
set -e
curl -L --retry 5 https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_FULL_SDK_VERSION }}/mac/vulkansdk-macos-${{ env.VULKAN_FULL_SDK_VERSION }}.zip -o vulkan-sdk.zip
unzip vulkan-sdk.zip -d vulkan-sdk
ls -l vulkan-sdk
sudo ./vulkan-sdk/InstallVulkan-${{ env.VULKAN_FULL_SDK_VERSION }}.app/Contents/MacOS/InstallVulkan-${{ env.VULKAN_FULL_SDK_VERSION }} --root "$HOME/VulkanSDK" --accept-licenses --default-answer --confirm-command install
echo "$HOME/VulkanSDK/macOS/bin" >> "$GITHUB_PATH"
- name: (linux) install vulkan sdk
if: matrix.os == 'ubuntu-24.04'
shell: bash
Expand All @@ -577,7 +602,7 @@ jobs:
# vulkan sdk
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-$VULKAN_SDK_VERSION-noble.list https://packages.lunarg.com/vulkan/$VULKAN_SDK_VERSION/lunarg-vulkan-$VULKAN_SDK_VERSION-noble.list
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${{ env.VULKAN_SDK_VERSION }}-noble.list https://packages.lunarg.com/vulkan/${{ env.VULKAN_SDK_VERSION }}/lunarg-vulkan-$VULKAN_SDK_VERSION-noble.list
sudo apt-get update
sudo apt install -y vulkan-sdk
Expand Down
Binary file removed naga/tests/in/spv/atomic_compare_exchange.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_exchange.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_global_struct_field_vertex.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_i_add_sub.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_i_decrement.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_i_increment.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/atomic_load_and_store.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/binding-arrays.dynamic.spv
Binary file not shown.
3 changes: 3 additions & 0 deletions naga/tests/in/spv/binding-arrays.dynamic.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; SPIR-V
; Version: 1.0

;; Make sure that we promote `OpTypeRuntimeArray` of textures and samplers into
;; `TypeInner::BindingArray` and support indexing it through `OpAccessChain`
;; and `OpInBoundsAccessChain`.
Expand Down
Binary file removed naga/tests/in/spv/binding-arrays.static.spv
Binary file not shown.
3 changes: 3 additions & 0 deletions naga/tests/in/spv/binding-arrays.static.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; SPIR-V
; Version: 1.0

;; Make sure that we promote `OpTypeArray` of textures and samplers into
;; `TypeInner::BindingArray` and support indexing it through `OpAccessChain`
;; and `OpInBoundsAccessChain`.
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions naga/tests/in/spv/builtin-accessed-outside-entrypoint.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; SPIR-V
; Version: 1.0

;; Ensure builtin binding isn't removed by unused gl_PerVertex builtin culling when
;; the builtin is used in a function defined after (in the SPIRV) the entry point.
;;
Expand Down
Binary file removed naga/tests/in/spv/degrees.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/do-while.spv
Binary file not shown.
3 changes: 3 additions & 0 deletions naga/tests/in/spv/do-while.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; SPIR-V
; Version: 1.0

;; Ensure that `do`-`while`-style loops, with conditional backedges, are properly
;; supported, via `break if` (as `continuing { ... if c { break; } }` is illegal).
;;
Expand Down
Binary file removed naga/tests/in/spv/empty-global-name.spv
Binary file not shown.
3 changes: 3 additions & 0 deletions naga/tests/in/spv/empty-global-name.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; SPIR-V
; Version: 1.0

;; Make sure we handle globals whose assigned name is "".
;;
;; In MSL, the anonymous global sometimes ends up looking like
Expand Down
Binary file removed naga/tests/in/spv/fetch_depth.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/inv-hyperbolic-trig-functions.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/quad-vert.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/shadow.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/spec-constants-issue-5598.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/spec-constants.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/subgroup-operations-s.spv
Binary file not shown.
Binary file removed naga/tests/in/spv/unnamed-gl-per-vertex.spv
Binary file not shown.
11 changes: 6 additions & 5 deletions naga/tests/in/spv/unnamed-gl-per-vertex.spvasm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 11
; Bound: 34
; Schema: 0

;; Make sure that we don't have a validation error due to lacking capabilities
;; for bulltins such as ClipDistance when those builtin are not actually used.
;;
Expand All @@ -22,11 +28,6 @@
;; }
;; ```
;;
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 11
; Bound: 34
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
Expand Down
Loading

0 comments on commit e590555

Please sign in to comment.