shader: support packed screen position in fixed slot 57 draws #3601
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3601"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-11-30T12:41:50Z.
Change
Refs #3560. Accept the fixed slot 57
PSI1layout0x8080withNUM_INTERP=0through the native C++ packed-position lowering. The pixel shader must consumeSV_PositionX 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
ce7eb9don077bff3a. 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.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.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T18:26:28Z.
Review: APPROVED
Reviewed
ce7eb9d3by reading the diff; not built or run.Verdict: approve. The
0x8080/NUM_INTERP 0entry is admitted only for the shape the lowering supports. Other addresses and counts are still refused. No MUST.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_Positionwith X and Y used, as noperspective float. A raw read ofv0(bit 7) still reachesunsupported pixel entry VGPR(src/gfx1013_direct_graphics.inl:199).0x8080with one interpolant, and0x0080, are still refused.05dc00b8b79c1d4b): in the published translation of the same pixel program (plain key7b25dcce8b9a69e8), the program writesv0before reading it and reads onlyv1, 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.startup_native_slot57_packed_position_check.py:67asserts that there is nosev=0/1debug 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.v0refusal under0x8080(a pixel that readsv0).Tests:
native_fixed_graphics_psi1proves acceptance (cold and warm cache, a non-exact catalog pair) and the four refusals (missingPOS_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: theprpreset's include filter inCMakePresets.jsonmatches neither. The runs listed in the body are the only ones so far.