-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (89 loc) · 3.23 KB
/
Copy pathwebgpu-shader-validation.yml
File metadata and controls
100 lines (89 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# .github/workflows/webgpu-shader-validation.yml
#
# Hardware-in-Loop CI: WGSL Shader Compilation Validation
#
# Validates all GalaxyQuest WGSL shaders by actually compiling them against
# Chrome's built-in WGSL compiler (Dawn/Tint) using the software WebGPU
# renderer (SwiftShader via Vulkan).
#
# Key approach:
# - Uses Chrome's `--use-vulkan=swiftshader` flag to get a real WebGPU
# device without needing physical GPU hardware.
# - Playwright drives Chromium and calls `device.createShaderModule()` +
# `.getCompilationInfo()` for every WGSL shader in the project.
# - The test fails if any shader produces a compilation error.
#
# Triggers:
# - Manually via workflow_dispatch
# - Push to the WebGPU migration branch
# - PR targeting main that touches any WGSL or WebGPU JS file
name: WebGPU Shader Validation (Hardware-in-Loop)
on:
workflow_dispatch:
push:
branches:
- 'copilot/improve-webgpu-integration'
- 'main'
paths:
- 'js/engine/webgpu/**/*.js'
- 'js/engine/fx/shaders/*.wgsl'
- 'js/engine/post-effects/shaders/*.wgsl'
- 'js/rendering/Galaxy3DRendererWebGPU.js'
- 'tests/e2e/webgpu-shader-validation.spec.js'
- '.github/workflows/webgpu-shader-validation.yml'
pull_request:
branches:
- main
paths:
- 'js/engine/webgpu/**/*.js'
- 'js/engine/fx/shaders/*.wgsl'
- 'js/engine/post-effects/shaders/*.wgsl'
jobs:
webgpu-shader-validation:
name: WGSL Shader Compilation (Chrome + SwiftShader)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright Chromium
run: npx playwright install chromium --with-deps
# Mesa / Vulkan software renderer (SwiftShader via mesa-vulkan-drivers)
# provides a real Vulkan ICD that Chrome's SwiftShader path uses.
- name: Install Vulkan software renderer
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
mesa-vulkan-drivers \
libvulkan1 \
vulkan-tools
- name: Verify Vulkan ICD availability
run: vulkaninfo --summary 2>&1 | head -20 || echo "vulkaninfo not detailed, proceeding"
- name: Run WGSL shader validation
env:
GQ_WEBGPU_SHADER_CI: '1'
# Tell Chrome to use the software Vulkan renderer and enable WebGPU
PLAYWRIGHT_CHROMIUM_ARGS: >-
--enable-unsafe-webgpu
--use-vulkan=swiftshader
--disable-vulkan-fallback-to-gl-for-testing
--disable-dawn-features=disallow_unsafe_apis
--use-angle=swiftshader
--enable-features=Vulkan
run: |
npx playwright test tests/e2e/webgpu-shader-validation.spec.js \
--project=chromium \
--reporter=list
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-webgpu-shader-report
path: playwright-report/
retention-days: 7