shader: support packed screen position in fixed slot 57 draws #3601

Merged
timbot103 merged 1 commit from upstream-pr/3601 into main 2026-11-30 19:35:16 +00:00
timbot103 commented 2026-11-30 12:41:50 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-11-30T12:41:50Z.


Change

Refs #3560. Accept the fixed slot 57 PSI1 layout 0x8080 with NUM_INTERP=0 through the native C++ packed-position lowering. The pixel shader must consume SV_Position X and Y as its only input. This covers raw pairs and non-exact reviewed catalog pairs. #3527 touches the adjacent fixed-entry validation.

The source-built runtime fixture verifies 16 coordinate-colored pixels and 16 clear pixels for each draw. Invalid address metadata refuses the pipeline and leaves all 32 pixels clear. Compiler controls cover cold and warm cache paths, wrong register, contradictory count, and unused position.

Verification

Commit ce7eb9d on 077bff3a. Windows 11 build 26200, MSVC 19.44.35230, DXC from Windows SDK 10.0.26100.0. RTX 5080 driver 32.0.16.2140 and in-box WARP 10.0.26100.9818. D3D12 debug layer unavailable.

$filter = '^(native_(fixed_graphics_psi1|direct_container|graphics_interface_library)|startup_native_slot57_packed_position_(warp|hardware))$'
cmake --build --preset release --target compile_dxil startup_stream_consumer
ctest --preset release --no-tests=error -j 1 -R $filter -V
cmake --build --preset dev --target compile_dxil startup_stream_consumer
ctest --preset dev --no-tests=error -j 1 -R $filter -V

Five Release and five Debug checks passed with zero capability skips. The baseline compiler and WARP runtime refused the fixed layout. Swapping X and Y in a temporary fixture failed pixel readback on both adapters.

Follow-up

The captured startup pass still needs a matched replay. All materials in this PR are source-built.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5565489134 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3601). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-30T12:41:50Z. --- ## Change Refs #3560. Accept the fixed slot 57 `PSI1` layout `0x8080` with `NUM_INTERP=0` through the native C++ packed-position lowering. The pixel shader must consume `SV_Position` X and Y as its only input. This covers raw pairs and non-exact reviewed catalog pairs. #3527 touches the adjacent fixed-entry validation. The source-built runtime fixture verifies 16 coordinate-colored pixels and 16 clear pixels for each draw. Invalid address metadata refuses the pipeline and leaves all 32 pixels clear. Compiler controls cover cold and warm cache paths, wrong register, contradictory count, and unused position. ## Verification Commit `ce7eb9d` on `077bff3a`. Windows 11 build 26200, MSVC 19.44.35230, DXC from Windows SDK 10.0.26100.0. RTX 5080 driver 32.0.16.2140 and in-box WARP 10.0.26100.9818. D3D12 debug layer unavailable. ```powershell $filter = '^(native_(fixed_graphics_psi1|direct_container|graphics_interface_library)|startup_native_slot57_packed_position_(warp|hardware))$' cmake --build --preset release --target compile_dxil startup_stream_consumer ctest --preset release --no-tests=error -j 1 -R $filter -V cmake --build --preset dev --target compile_dxil startup_stream_consumer ctest --preset dev --no-tests=error -j 1 -R $filter -V ``` Five Release and five Debug checks passed with zero capability skips. The baseline compiler and WARP runtime refused the fixed layout. Swapping X and Y in a temporary fixture failed pixel readback on both adapters. ## Follow-up The captured startup pass still needs a matched replay. All materials in this PR are source-built. AI-assisted.
lukaslw-lab commented 2026-11-30 18:26:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T18:26:28Z.

Review: APPROVED


Reviewed ce7eb9d3 by reading the diff; not built or run.

Verdict: approve. The 0x8080 / NUM_INTERP 0 entry is admitted only for the shape the lowering supports. Other addresses and counts are still refused. No MUST.

  • Checked, no finding: packed_position_only (src/direct_compute_cache.cpp:778) bypasses only the two address/count refusals (:786, :817) and the reflected PARAM linking (:883). The post-link check (:867-874) then requires exactly one input: SV_Position with X and Y used, as noperspective float. A raw read of v0 (bit 7) still reaches unsupported pixel entry VGPR (src/gfx1013_direct_graphics.inl:199). 0x8080 with one interpolant, and 0x0080, are still refused.
  • Real pass from #3560 (key 05dc00b8b79c1d4b): in the published translation of the same pixel program (plain key 7b25dcce8b9a69e8), the program writes v0 before reading it and reads only v1, both 16-bit halves (X and Y). That is the shape this PR admits. Whether the rest of that program clears the native frontend is the matched replay the PR lists as follow-up.
  • SHOULD startup_native_slot57_packed_position_check.py:67 asserts that there is no sev=0/1 debug line. But nothing checks that the debug layer is present, and the body says it was unavailable in the runs listed. So the "no debug-layer error" part has not been exercised yet. Either require the layer (skip with 77 without it), or say in the docs that the check passes vacuously without it.
  • NIT No control pins the v0 refusal under 0x8080 (a pixel that reads v0).

Tests: native_fixed_graphics_psi1 proves acceptance (cold and warm cache, a non-exact catalog pair) and the four refusals (missing POS_FIXED_PT, nonzero count, wrong VGPR, unused position). startup_native_slot57_packed_position_{warp,hardware} proves the coordinate gradient and that the wrong-address pipeline is refused. CI did not run them: the pr preset's include filter in CMakePresets.json matches neither. The runs listed in the body are the only ones so far.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6118015688 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3601#pullrequestreview-6118015688). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-30T18:26:28Z. **Review:** APPROVED --- Reviewed `ce7eb9d3` by reading the diff; not built or run. **Verdict: approve.** The `0x8080` / `NUM_INTERP 0` entry is admitted only for the shape the lowering supports. Other addresses and counts are still refused. No MUST. - Checked, no finding: `packed_position_only` (`src/direct_compute_cache.cpp:778`) bypasses only the two address/count refusals (`:786`, `:817`) and the reflected PARAM linking (`:883`). The post-link check (`:867-874`) then requires exactly one input: `SV_Position` with X and Y used, as noperspective float. A raw read of `v0` (bit 7) still reaches `unsupported pixel entry VGPR` (`src/gfx1013_direct_graphics.inl:199`). `0x8080` with one interpolant, and `0x0080`, are still refused. - Real pass from #3560 (key `05dc00b8b79c1d4b`): in the published translation of the same pixel program (plain key `7b25dcce8b9a69e8`), the program writes `v0` before reading it and reads only `v1`, both 16-bit halves (X and Y). That is the shape this PR admits. Whether the rest of that program clears the native frontend is the matched replay the PR lists as follow-up. - **SHOULD** `startup_native_slot57_packed_position_check.py:67` asserts that there is no `sev=0/1` debug line. But nothing checks that the debug layer is present, and the body says it was unavailable in the runs listed. So the "no debug-layer error" part has not been exercised yet. Either require the layer (skip with 77 without it), or say in the docs that the check passes vacuously without it. - **NIT** No control pins the `v0` refusal under `0x8080` (a pixel that reads `v0`). Tests: `native_fixed_graphics_psi1` proves acceptance (cold and warm cache, a non-exact catalog pair) and the four refusals (missing `POS_FIXED_PT`, nonzero count, wrong VGPR, unused position). `startup_native_slot57_packed_position_{warp,hardware}` proves the coordinate gradient and that the wrong-address pipeline is refused. CI did not run them: the `pr` preset's include filter in `CMakePresets.json` matches neither. The runs listed in the body are the only ones so far.
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!3601
No description provided.