shader: verify desktop SV_Position at shifted pixel centers #546

Merged
RonLogic merged 1 commit from upstream-pr/552 into main 2026-11-22 12:02:38 +00:00
RonLogic commented 2026-11-22 11:32:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-22T11:32:24Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6541867075 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/552). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-22T11:32:24Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:43:39 +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!546
No description provided.