shader: run the SPIR-V address window at Shader Model 6.0 #826

Merged
Jess-Doit merged 1 commit from upstream-pr/832 into main 2026-11-23 09:42:41 +00:00
Jess-Doit commented 2026-11-23 09:32:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T09:32:04Z.


Change

Compile the source-built SPIR-V address-window fixture as cs_6_0 so it can run on Windows 10 in-box adapters below Shader Model 6.6. Keep the Int64ShaderOps gate for 64-bit address arithmetic. The capability self-test covers SM 6.0 with and without Int64ShaderOps and SM 5.1 with Int64ShaderOps.

Refs #553. The base includes #825. A local merge simulation with #827 at c81164d found no conflicts.

Verification

Tested 8bebb5dce429e10b0b36c6142611dc02c2818cb2 on Windows 10 22H2 build 19045.6456 with SPIRV-Tools ef96ed76, the repo's patched SPIRV-Cross 57e4efc, and DXC 1.9.2602.17. Configured the app-local builds with Agility SDK 1.620.2 and WARP 1.0.22 using OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR.

$env:XBOX2WINDOWS_ADAPTER = 'GTX 1060'
foreach ($build in @('dev', 'release')) {
    cmake --build "out/build/$build" --target offscreen_check
    ctest --test-dir "out/build/$build" --no-tests=error -V -R '^(spirv_(address_window|sampler_views|compaction|minlod)_(hardware|warp)|offscreen_capability_table_self_test|docs_links)$'
}
$env:X2W_REQUIRE_SPIRV_TOOLS = '1'
foreach ($build in @('app-local-dev', 'app-local-release')) {
    cmake --build "out/build/$build" --target offscreen_check
    ctest --test-dir "out/build/$build" --no-tests=error -V -R '^(spirv_(address_window|sampler_views|compaction|minlod)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$'
}
python -B tests/spirv_window/check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py
git diff --check HEAD^ HEAD
Runtime Adapter and driver Debug Release
In-box GTX 1060 (32.0.15.6094) and WARP (10.0.19041.5794) 10 passed 10 passed
App-local WARP (1.0.22.0) 6 passed 6 passed

Each adapter matched all 16 words in all eight address-window cases in both configurations. The focused matrix had 32 passes and zero skips or failures. Address-window runs reported zero D3D12 debug warnings and errors. The physical, logical and combined SPIR-V validation checks also passed. Stock Vulkan SDK SPIRV-Cross f11ba9f0 passed the Debug fixture on both in-box adapters.

The original cs_6_6 fixture at 3ddce57 returned two capability skips on the in-box adapters and passed all eight cases on app-local WARP. The baseline can be reproduced with ctest --test-dir out/build/dev --no-tests=error -V -R '^spirv_address_window_(hardware|warp)$' and ctest --test-dir out/build/app-local-dev --no-tests=error -V -R '^spirv_address_window_warp$' on that revision.

Evidence and follow-up

Reuses the existing source-built subtract.spvasm. Both DXIL profiles retain the 64-bit integer requirement and use the same raw SRV and UAV bindings. The SM 6.0 profile uses bufferLoad.i32 and bufferStore.i32 for the DWORD transfers. See the address-window experiment for commands.

For two local fault controls, generate the SM 6.0 HLSL with the commands in the experiment. Make two copies. In the first, replace uint64_t(_3.Load(12)) with 0ull. In the second, replace (_39 >= _36) with true. Compile each with dxc -T cs_6_0 -E main -Fo out/window.dxil out/window.hlsl and run out/build/dev/offscreen_check.exe hardware --spirv-address-window out/window.dxil. Repeat with warp using each runtime's Debug build. All three adapters returned exit 1 at word 11 for both controls. Discarding the high word produced eca86420 in high address, and removing the overflow comparison produced b97530ed in index addition wraps. The expected word was edcba988 in both cases. The debug layer stayed clean.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the test commands and results.
  • I verified the fixture with separate fault controls.
  • I updated the experiment documentation.
  • The patch uses only source-built fixtures.

AI-assisted: yes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6556301236 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/832). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T09:32:04Z. --- ## Change Compile the source-built SPIR-V address-window fixture as `cs_6_0` so it can run on Windows 10 in-box adapters below Shader Model 6.6. Keep the `Int64ShaderOps` gate for 64-bit address arithmetic. The capability self-test covers SM 6.0 with and without Int64ShaderOps and SM 5.1 with Int64ShaderOps. Refs #553. The base includes #825. A local merge simulation with #827 at `c81164d` found no conflicts. ## Verification Tested `8bebb5dce429e10b0b36c6142611dc02c2818cb2` on Windows 10 22H2 build 19045.6456 with SPIRV-Tools `ef96ed76`, the repo's patched SPIRV-Cross `57e4efc`, and DXC 1.9.2602.17. Configured the app-local builds with Agility SDK 1.620.2 and WARP 1.0.22 using `OFFSCREEN_AGILITY_620_DIR` and `OFFSCREEN_WARP_DIR`. ```powershell $env:XBOX2WINDOWS_ADAPTER = 'GTX 1060' foreach ($build in @('dev', 'release')) { cmake --build "out/build/$build" --target offscreen_check ctest --test-dir "out/build/$build" --no-tests=error -V -R '^(spirv_(address_window|sampler_views|compaction|minlod)_(hardware|warp)|offscreen_capability_table_self_test|docs_links)$' } $env:X2W_REQUIRE_SPIRV_TOOLS = '1' foreach ($build in @('app-local-dev', 'app-local-release')) { cmake --build "out/build/$build" --target offscreen_check ctest --test-dir "out/build/$build" --no-tests=error -V -R '^(spirv_(address_window|sampler_views|compaction|minlod)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$' } python -B tests/spirv_window/check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py git diff --check HEAD^ HEAD ``` | Runtime | Adapter and driver | Debug | Release | | --- | --- | ---: | ---: | | In-box | GTX 1060 (32.0.15.6094) and WARP (10.0.19041.5794) | 10 passed | 10 passed | | App-local | WARP (1.0.22.0) | 6 passed | 6 passed | Each adapter matched all 16 words in all eight address-window cases in both configurations. The focused matrix had 32 passes and zero skips or failures. Address-window runs reported zero D3D12 debug warnings and errors. The physical, logical and combined SPIR-V validation checks also passed. Stock Vulkan SDK SPIRV-Cross `f11ba9f0` passed the Debug fixture on both in-box adapters. The original `cs_6_6` fixture at `3ddce57` returned two capability skips on the in-box adapters and passed all eight cases on app-local WARP. The baseline can be reproduced with `ctest --test-dir out/build/dev --no-tests=error -V -R '^spirv_address_window_(hardware|warp)$'` and `ctest --test-dir out/build/app-local-dev --no-tests=error -V -R '^spirv_address_window_warp$'` on that revision. ## Evidence and follow-up Reuses the existing source-built `subtract.spvasm`. Both DXIL profiles retain the 64-bit integer requirement and use the same raw SRV and UAV bindings. The SM 6.0 profile uses `bufferLoad.i32` and `bufferStore.i32` for the DWORD transfers. See the [address-window experiment](docs/experiments.md#spir-v-physical-addresses-in-a-d3d12-buffer-window) for commands. For two local fault controls, generate the SM 6.0 HLSL with the commands in the experiment. Make two copies. In the first, replace `uint64_t(_3.Load(12))` with `0ull`. In the second, replace `(_39 >= _36)` with `true`. Compile each with `dxc -T cs_6_0 -E main -Fo out/window.dxil out/window.hlsl` and run `out/build/dev/offscreen_check.exe hardware --spirv-address-window out/window.dxil`. Repeat with `warp` using each runtime's Debug build. All three adapters returned exit 1 at word 11 for both controls. Discarding the high word produced `eca86420` in `high address`, and removing the overflow comparison produced `b97530ed` in `index addition wraps`. The expected word was `edcba988` in both cases. The debug layer stayed clean. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the test commands and results. - [x] I verified the fixture with separate fault controls. - [x] I updated the experiment documentation. - [x] The patch uses only source-built fixtures. AI-assisted: yes.
upstream-sync closed this pull request 2026-11-24 06:44:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!826
No description provided.