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

Merged
Jess-Doit merged 1 commit from upstream-pr/827 into main 2026-11-23 09:40:52 +00:00
Jess-Doit commented 2026-11-23 09:22:21 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6556141223 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/827). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T09:22:21Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:44:58 +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!821
No description provided.