shader: run the standalone SPIR-V sampler split at Shader Model 6.0 #827

Manually merged
github merged 1 commit from gh-pr/827/head into gh-pr/827/base 2026-11-26 22:21:45 +00:00
Owner

@⁠Jess-Doit on GitHub · 2026-11-23 09:22 UTC · original
Jess-Doit:test/spirv-compare-sampler-sm60 → main · +27 −10 · 3 files · 1 commits · merged 2026-11-23 09:40 UTC

Change

Run the standalone SPIR-V sampler split fixture at Shader Model 6.0. This lets the existing ordinary and comparison sampler checks run on Windows 10 adapters capped below SM 6.6. SPIRV-Cross emits SM 6.0 HLSL for both modules, and DXC still rejects the unsplit module at SampleLevel. The split module compiles as cs_6_0.

Lower the capability gate for --spirv-compare-sampler and test its accept and skip decisions at SM 6.0 and 5.1. The fixture still checks all 16 output words, including 13 guards.

Refs #681. A local merge simulation with #825 was clean at e2ade14.

Verification

Tested c81164d0a2e59fa05ff227bdc0d842333504b9f2 on Windows 10 22H2 build 19045.6456. Configured app-local builds with OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR. Selected the GTX 1060 for hardware runs. Used SPIRV-Tools ef96ed76, SPIRV-Cross 57e4efc with the repo patch, and DXC 1.9.2602.17.

$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_(minlod|sampler_views|compaction|compare_sampler)_(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_(compare_sampler|sampler_views|compaction|minlod)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$'
}
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) 6 passed 6 passed

No skips or failures in the patched matrix. All 36 standalone sampler dispatches reported zero D3D12 debug warnings and errors. The three positive cases matched all 16 words on each adapter. The wrong reference failed only at word 1, switching s2 to GREATER changed only words 0–1, and clamping s5 to mip 1 changed only word 2.

On base 79ea3e4, ctest --test-dir out/build/dev --no-tests=error -V -R '^spirv_compare_sampler_(hardware|warp)$' returned two SM 6.6 capability skips. ctest --test-dir out/build/app-local-dev --no-tests=error -V -R '^spirv_compare_sampler_warp$' passed at SM 6.6 with the same output words and control mismatches.

Evidence and follow-up

Reuses the repository's source-built shared_sampler.spvasm fixture. Both DXIL profiles contain two SampleCmpLevelZero calls and one SampleLevel call. SM 6.0 stores the result bits through the raw UAV as integers. See the sampler split experiment for the focused reproduction command.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the test commands and results.
  • I verified the existing negative controls.
  • I updated the experiment documentation.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted: yes.

**@⁠Jess-Doit** on GitHub · 2026-11-23 09:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/827) `Jess-Doit:test/spirv-compare-sampler-sm60` → `main` · +27 −10 · 3 files · 1 commits · merged 2026-11-23 09:40 UTC ## Change Run the standalone SPIR-V sampler split fixture at Shader Model 6.0. This lets the existing ordinary and comparison sampler checks run on Windows 10 adapters capped below SM 6.6. SPIRV-Cross emits SM 6.0 HLSL for both modules, and DXC still rejects the unsplit module at `SampleLevel`. The split module compiles as `cs_6_0`. Lower the capability gate for `--spirv-compare-sampler` and test its accept and skip decisions at SM 6.0 and 5.1. The fixture still checks all 16 output words, including 13 guards. Refs #681. A local merge simulation with #825 was clean at `e2ade14`. ## Verification Tested `c81164d0a2e59fa05ff227bdc0d842333504b9f2` on Windows 10 22H2 build 19045.6456. Configured app-local builds with `OFFSCREEN_AGILITY_620_DIR` and `OFFSCREEN_WARP_DIR`. Selected the GTX 1060 for hardware runs. Used SPIRV-Tools `ef96ed76`, SPIRV-Cross `57e4efc` with the repo patch, and DXC 1.9.2602.17. ```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_(minlod|sampler_views|compaction|compare_sampler)_(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_(compare_sampler|sampler_views|compaction|minlod)_warp|offscreen_capability_table_self_test|app_local_warp_toggle)$' } ``` | 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) | 6 passed | 6 passed | No skips or failures in the patched matrix. All 36 standalone sampler dispatches reported zero D3D12 debug warnings and errors. The three positive cases matched all 16 words on each adapter. The wrong reference failed only at word 1, switching s2 to `GREATER` changed only words 0–1, and clamping s5 to mip 1 changed only word 2. On base `79ea3e4`, `ctest --test-dir out/build/dev --no-tests=error -V -R '^spirv_compare_sampler_(hardware|warp)$'` returned two SM 6.6 capability skips. `ctest --test-dir out/build/app-local-dev --no-tests=error -V -R '^spirv_compare_sampler_warp$'` passed at SM 6.6 with the same output words and control mismatches. ## Evidence and follow-up Reuses the repository's source-built `shared_sampler.spvasm` fixture. Both DXIL profiles contain two `SampleCmpLevelZero` calls and one `SampleLevel` call. SM 6.0 stores the result bits through the raw UAV as integers. See [the sampler split experiment](docs/experiments.md#standalone-comparison-sampler-split-in-the-spir-v-bridge) for the focused reproduction command. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the test commands and results. - [x] I verified the existing negative controls. - [x] I updated the experiment documentation. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:21:43 +00:00
github manually merged commit c81164d0a2 into gh-pr/827/base 2026-11-26 22:21:45 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.