shader: admit a depth-only export in the raw graphics front end #3612
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3612"
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 Not-Saii on 2026-11-30T14:07:39Z.
Change
A raw fixed VS/PS pair whose pixel stage ends in an uncompressed MRTZ export of depth alone, with no colour export, was refused by the raw graphics front end with
raw graphics varying or system export requires a stage interface.read_raw_graphicsnow treats that export as the pixel stage's output and adds oneSV_Depthsignature row, which the existing emitter already lowers for reviewed containers.What stays refused:
raw depth export next to a color export requires a stage interface), because a raw colour target is typed without a signature and would otherwise fail later ascolor target absent from pixel signature;translate_mesh_pixel_program): unchanged, the new case is gated on!mesh_pixel.Refs #3541. This is the first refusal of the depth-only fixed slot 57 pass reported there (comment). It does not make that pass translate on its own: with this change its next refusal is
graphics branch on a wave mask.Shared interface:
read_raw_graphicsinsrc/gfx1013_compute_native.cpp. Open PR #3527 edits the same function in different lines, so a small merge conflict is possible whichever lands second.Verification
Commit
5a2d2799onmain077bff3a. Windows 11 build 26300, MSVC 19.44, Windows SDK 10.0.26100 (DXC from the SDK), release preset. No GPU is involved; the checks compile and inspect bytecode.native_raw_depth_export(new)native_fixed_graphics_psi1native_direct_containernative_graphics_interface_librarynative_compile_dxil_refusalsnative_compile_dxil_rekeynative_compile_dxil_watchnative_direct_meshmainnative_direct_meshfails at itstoo-many-primitivescase (the compiler accepts a program the test expects it to refuse withexceeds declared range). I rebuiltcompile_dxilfrom unmodifiedmain077bff3aand got the same assertion, so this change does not cause it. I have not bisected it.Before and after for the new fixture, run directly:
main077bff3anative compute +0x20: raw graphics varying or system export requires a stage interfaceSV_DepthNot run: tests driven by other executables (the draw consumer,
d3d12_xs.dll), because onlycompile_dxilwas rebuilt. The pull request check does not run thenative_*tests.Evidence and follow-up
The fixture is source-built: raw gfx1013 words assembled in the test, reusing the vertex program, root and helpers of
tests/native_fixed_graphics_psi1_check.py. MIT, no external inputs.Cases:
dxc -dumpbinshowsSV_Depth, astoreOutput.f32, and noSV_Target;frontend_cache_hit=1and byte-identical pixel bytecode, so the depth row survives the front-end pair cache;Assumptions and limits:
graphics branch on a wave maskwith this change. The public fixture verifies the depth export case, not that request.Follow-up another contributor can pick up: the next refusal for that pass is a per-pixel discard written as a compare that writes EXEC, then
s_cbranch_execzto a null export, with descriptor and buffer loads on the surviving path before the depth export.Checklist
tests/cmake/native_raw_depth_export.cmake.)This change was AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T20:02:41Z.
Review: APPROVED
Reviewed
5a2d27993840146534d43d64347bd41c3dd793bc. The raw fixed-pair reader admits uncompressed depth-only MRTZ and emitsSV_Depth. The fixture checks the cold compile, frontend cache round trip, color control, and the stencil, coverage, compressed, and mixed-export refusals.On Windows with SDK/DXC 10.0.26100.0,
ctest --test-dir <build> --no-tests=error -j1 -R '^native_raw_depth_export$' --output-on-failurepassed. I temporarily disabled the newSV_Depthsignature insertion locally. The build succeeded and the test failed on the positive control withunmapped depth, stencil or coverage export. I restored the source after the check.