shader: run portable MinLod readbacks at Shader Model 6.0 #866

Merged
Jess-Doit merged 1 commit from upstream-pr/873 into main 2026-11-23 15:32:40 +00:00
Jess-Doit commented 2026-11-23 15:12:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T15:12:27Z.


Change

Refs #809. Run the exact point-mip and mip-linear readbacks at Shader Model 6.0.
Keep the fractional point-filter readbacks in a separate Shader Model 6.6
fixture with the existing nearest-mip and tie checks. On Windows 10 in-box
WARP, #809's point-filtered clamp of 1.5625 selects mip 1 in both translated
SPIR-V and direct HLSL, where explicit SampleLevel selects mip 2. The exact
mips and mip-linear blends pass on that runtime. The split uses shader-model
capability gates and adds no adapter-specific skip or expected-failure rule.

The Windows CI result check requires both WARP fixtures to run and pass.

Verification

Tested eab58b525d in Debug and Release on Windows
10 22H2 build 19045.6456, using DXC 1.9.2602.17 and the patched SPIRV-Cross
build from the repository-pinned revision.

Backend Exact mips and blends, ps_6_0 Fractional point, ps_6_6
GTX 1060 6 GB, driver 32.0.15.6094, in-box runtime Pass Capability skip (SM 6.5)
In-box WARP 10.0.19041.5794 Pass Capability skip (SM 6.2)
GTX 1060, same driver, Agility 1.620.2 Pass Pass
App-local WARP 1.0.22.0, Agility 1.620.2 Pass Pass

The exact and blend fixture checked all 64 pixels for four integer mips and
nine blends per shader source, with the existing 1/128 blend tolerance and
matching first-pixel words between the two shaders. Both SM 6.6 shader sources
selected mip 2 at the 1.5 tie. All 40 stale-reference draws failed at pixel
(0, 0) with exit 1, including the new fractional control that checks a
1.5625 clamp against mip 1. The logged D3D12 debug summaries reported zero
errors and warnings.

Focused CTest runs recorded 46 passes, four shader-model capability skips and
zero failures. App-local Debug and Release passed all eight required WARP
checks. The result checker rejected a report marking the fractional WARP test
as skipped. The bidirectional-control and diff whitespace checks also passed.

From a configured Windows checkout, use the repository's pinned SPIR-V tools.
Run both presets with the in-box runtime, then configure the app-local profiles
with OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR. Set XBOX2WINDOWS_ADAPTER
to select the physical adapter. For the app-local runs, set
X2W_REQUIRE_SPIRV_TOOLS=1 and use the JUnit result check.

cmake --build --preset dev --target offscreen_check
cmake --build --preset release --target offscreen_check
$focused = '^(spirv_(minlod(_levels|_fractional)?|address_window|compare_sampler)_(hardware|warp)|offscreen_capability_table_self_test|docs_links)$'
ctest --preset dev --no-tests=error -V -R $focused
ctest --preset release --no-tests=error -V -R $focused
$appLocal = '^(spirv_.*_warp|spirv_minlod(_levels|_fractional)?_hardware|offscreen_capability_table_self_test|app_local_warp_toggle)$'
ctest --preset dev --no-tests=error -V -R $appLocal --output-junit "$PWD/out/minlod-dev.xml"
ctest --preset release --no-tests=error -V -R $appLocal --output-junit "$PWD/out/minlod-release.xml"
python -B tests/spirv_window/require_warp_results.py out/minlod-dev.xml
python -B tests/spirv_window/require_warp_results.py out/minlod-release.xml
python -B tests/bidi_controls_check.py
git diff --check HEAD^ HEAD

Evidence and follow-up

The tests reuse the repository's synthetic four-mip texture and source-built
shaders. The MinLod experiment notes
describe the two fixtures and keep the adapter measurements separate.

  • This pull request covers one reviewable behavior.
  • I included the commands and results for verification.
  • I checked stale references for both fixtures.
  • I updated the relevant experiment documentation.
  • The patch includes only source-built fixtures and documentation.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6562386833 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/873). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T15:12:27Z. --- ## Change Refs #809. Run the exact point-mip and mip-linear readbacks at Shader Model 6.0. Keep the fractional point-filter readbacks in a separate Shader Model 6.6 fixture with the existing nearest-mip and tie checks. On Windows 10 in-box WARP, #809's point-filtered clamp of 1.5625 selects mip 1 in both translated SPIR-V and direct HLSL, where explicit SampleLevel selects mip 2. The exact mips and mip-linear blends pass on that runtime. The split uses shader-model capability gates and adds no adapter-specific skip or expected-failure rule. The Windows CI result check requires both WARP fixtures to run and pass. ## Verification Tested eab58b525d02532823d1d9972ae2ab28d5f3cbdf in Debug and Release on Windows 10 22H2 build 19045.6456, using DXC 1.9.2602.17 and the patched SPIRV-Cross build from the repository-pinned revision. | Backend | Exact mips and blends, ps_6_0 | Fractional point, ps_6_6 | | --- | --- | --- | | GTX 1060 6 GB, driver 32.0.15.6094, in-box runtime | Pass | Capability skip (SM 6.5) | | In-box WARP 10.0.19041.5794 | Pass | Capability skip (SM 6.2) | | GTX 1060, same driver, Agility 1.620.2 | Pass | Pass | | App-local WARP 1.0.22.0, Agility 1.620.2 | Pass | Pass | The exact and blend fixture checked all 64 pixels for four integer mips and nine blends per shader source, with the existing 1/128 blend tolerance and matching first-pixel words between the two shaders. Both SM 6.6 shader sources selected mip 2 at the 1.5 tie. All 40 stale-reference draws failed at pixel (0, 0) with exit 1, including the new fractional control that checks a 1.5625 clamp against mip 1. The logged D3D12 debug summaries reported zero errors and warnings. Focused CTest runs recorded 46 passes, four shader-model capability skips and zero failures. App-local Debug and Release passed all eight required WARP checks. The result checker rejected a report marking the fractional WARP test as skipped. The bidirectional-control and diff whitespace checks also passed. From a configured Windows checkout, use the repository's pinned SPIR-V tools. Run both presets with the in-box runtime, then configure the app-local profiles with OFFSCREEN_AGILITY_620_DIR and OFFSCREEN_WARP_DIR. Set XBOX2WINDOWS_ADAPTER to select the physical adapter. For the app-local runs, set X2W_REQUIRE_SPIRV_TOOLS=1 and use the JUnit result check. ```powershell cmake --build --preset dev --target offscreen_check cmake --build --preset release --target offscreen_check $focused = '^(spirv_(minlod(_levels|_fractional)?|address_window|compare_sampler)_(hardware|warp)|offscreen_capability_table_self_test|docs_links)$' ctest --preset dev --no-tests=error -V -R $focused ctest --preset release --no-tests=error -V -R $focused $appLocal = '^(spirv_.*_warp|spirv_minlod(_levels|_fractional)?_hardware|offscreen_capability_table_self_test|app_local_warp_toggle)$' ctest --preset dev --no-tests=error -V -R $appLocal --output-junit "$PWD/out/minlod-dev.xml" ctest --preset release --no-tests=error -V -R $appLocal --output-junit "$PWD/out/minlod-release.xml" python -B tests/spirv_window/require_warp_results.py out/minlod-dev.xml python -B tests/spirv_window/require_warp_results.py out/minlod-release.xml python -B tests/bidi_controls_check.py git diff --check HEAD^ HEAD ``` ## Evidence and follow-up The tests reuse the repository's synthetic four-mip texture and source-built shaders. The [MinLod experiment notes](docs/experiments.md#minimum-lod-in-the-spir-v-bridge) describe the two fixtures and keep the adapter measurements separate. - [x] This pull request covers one reviewable behavior. - [x] I included the commands and results for verification. - [x] I checked stale references for both fixtures. - [x] I updated the relevant experiment documentation. - [x] The patch includes only source-built fixtures and documentation. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:45:11 +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!866
No description provided.