Skip to content

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

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
timbot103:fix/slot57-packed-position
Nov 30, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
timbot103:fix/slot57-packed-position

Conversation

@timbot103

Copy link
Copy Markdown
Contributor

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.

Refs R0Y00#3560. Verify native slot 57 rendering and refusal with source-built data.

AI-assisted.

@lukaslw-lab lukaslw-lab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@R0Y00
R0Y00 merged commit d0ac90b into R0Y00:main Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants