shader: verify desktop SV_Position at shifted pixel centers #552

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

@⁠RonLogic on GitHub · 2026-11-22 11:32 UTC · original
RonLogic:test/pixel-position-centers → main · +85 −4 · 5 files · 1 commits · merged 2026-11-22 12:02 UTC

Refs #218. This is the independent D3D12 input-layout check requested in the milestone discussion. It reuses the full-screen triangle and RGBA32F readback in offscreen_check. The pixel case trailer accepts a viewport rectangle for one reference color per target pixel. The shader takes TEXCOORD0 followed by SV_Position to match the vertex output. Red and green depend only on the position X and Y inputs.

The 8×8 target uses a 5×3 viewport at (2, 1). An independent CPU reference checks 15 covered pixel centers and 49 clear pixels bit for bit. With X and Y swapped, the first mismatch is at (2, 1), where the shader returns red and green (1.5, 2.5) against the expected (2.5, 1.5).

Tested on Windows x64 at 342969e on aefed61. WARP (10.0.26100.9818) and RTX 4070 (32.0.16.2124) matched the reference and rejected the swapped shader. The passing draws reported zero D3D12 debug errors and warnings. All six CTest entries passed, and the Markdown link check passed.

ctest --test-dir out/build/followup --no-tests=error -R '^(pixel_position_centers|pixel_aot|mesh_attribute_draw)_(warp|hardware)$' -V
python -B tests/docs_links_check.py

This measures desktop D3D12 coordinates. Native Scarlett VGPR assignments require their own evidence.

AI-assisted: yes.

**@⁠RonLogic** on GitHub · 2026-11-22 11:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/552) `RonLogic:test/pixel-position-centers` → `main` · +85 −4 · 5 files · 1 commits · merged 2026-11-22 12:02 UTC Refs #218. This is the independent D3D12 input-layout check requested in the milestone discussion. It reuses the full-screen triangle and RGBA32F readback in `offscreen_check`. The pixel case trailer accepts a viewport rectangle for one reference color per target pixel. The shader takes `TEXCOORD0` followed by `SV_Position` to match the vertex output. Red and green depend only on the position X and Y inputs. The 8×8 target uses a 5×3 viewport at (2, 1). An independent CPU reference checks 15 covered pixel centers and 49 clear pixels bit for bit. With X and Y swapped, the first mismatch is at (2, 1), where the shader returns red and green `(1.5, 2.5)` against the expected `(2.5, 1.5)`. Tested on Windows x64 at `342969e` on `aefed61`. WARP (`10.0.26100.9818`) and RTX 4070 (`32.0.16.2124`) matched the reference and rejected the swapped shader. The passing draws reported zero D3D12 debug errors and warnings. All six CTest entries passed, and the Markdown link check passed. ```powershell ctest --test-dir out/build/followup --no-tests=error -R '^(pixel_position_centers|pixel_aot|mesh_attribute_draw)_(warp|hardware)$' -V python -B tests/docs_links_check.py ``` This measures desktop D3D12 coordinates. Native Scarlett VGPR assignments require their own evidence. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:01:10 +00:00
github manually merged commit 342969e50d into gh-pr/552/base 2026-11-26 22:01:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.