shader: resolve and cache RTV variant requests in compile_dxil --requests #2989
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2989"
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-27T03:27:47Z.
Refs #2980
compile_dxil gfx1013-container-pair --requestsnow also takes eachreq_<key>.rtv, resolves it against its base request, types the pixel stage's color targets from the ordered formats and publishes the variant under the key the runtime loads.What changed
read_graphics_requestacceptsreq_<key>.rtvand checks the text asgfx2hlsl.py::request_sourcedoes (256 bytes,rtv1 <base key> <format> ...in decimal, one to eight formats, FNV-1a of the text equal to the key in the name). The base parts, with the optional.iaand.psin, are read and checked against the base key by the existing base path.mrt_kinddoes:u32ori32for the integer formats,f32otherwise. Formats 7 and 8 are refused by name when the pixel stage exports to their target. A float32 target keeps the register bits without themrtbitsmechanism..pairirkey; a base request adds nothing to its key. The manifest ends with the request text, which the runtime matches..rtvmarkers are scanned next to.a. A key with both markers is one request, the variant. A variant without a runtime manifest is refused. Refusals use the.faillifecycle of #2984.Two refusals where
gfx2hlsl.pytranslates: a container whose own output signature disagrees with the format, and a variant whose pair has no runtime manifest.Tested locally at
be9a0706oncpp-migrationat4ff5e36d: Windows 11 build 26300.9974, Debug, Windows SDK 10.0.26100 DXC, D3D12 debug layer enabled with no error message.native_rtv_variant_controlsnative_rtv_variant_hardwarenative_rtv_variant_warpReadback after the fence, for the exported words
ffff7ffe,15,eb,68, on both adapters:SV_Target0R16G16B16A16_UINT(12)uintffff 1500 eb00 6800R16G16B16A16_SINT(14)int0080 1500 eb00 6800R32G32B32A32_FLOAT(2)floatfe7fffff 15000000 eb000000 68000000Controls (no device): the base and four variants compile cold and warm with
--jobs 4and identical bytes; 13 refusals leave only<key>.fail(forged variant key, changed base, no format, nine formats, a format above 32 bits, trailing newline, missing base, formats 7 and 8, a forged file under the base's own key, a cached-entry refusal, a base with an input layout, a changed layout); a changed base withdraws every manifest; a signature conflict is refused. The unmodified base pair compiles in each directory where it is intact.Baseline: at
05438d65the tool does not scan.rtv(requests=1 compiled=1 refused=0for a base plus one variant). Mutation: with the format ignored where the target is typed, the controls and the WARP test fail.Regression at the same commit: 45 of 48 neighbouring tests pass, and 36 of 40 in the
prpreset. Capability skips, not passes:native_comparison_pso_warp,native_global_srv_heap_replay_warp,startup_compute_dispatch_native_warpand the fourspirv_minlod_*_warptests.Not run: a Release build, the Linux Python checks, and any adapter other than the two above. Limits are in
docs/experiments/native-rtv-variant-requests.md.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-27T03:48:09Z.
Review: APPROVED
Review of head
8d55ce1e. Its last commit only updatesdocs/experiments/native-rtv-variant-requests.md; the code below was tested atc593bace. CI on the head is green. Approving and merging.Code read:
read_rtv_variantchecks the 256-byte limit, thertv1prefix, decimal tokens, one to eight formats and the FNV-1a key before it reads the base parts, which the existing base path checks against the base key..pairirkey, its target types stay 0, andformat_graphics_runtime_manifeststill returns nothing for any non-float target of a base..rtvis scanned only forgfx1013-container-pair, not for the rectangle mode. A key with both markers is the variant, and a variant without a runtime manifest is refused through the #2984.faillifecycle.Run on AMD: Windows 11 26300.9974, AMD Radeon RX 9070 XT (driver 32.0.32029.2010), plus WARP, release. This was tested together with #2990, #2992 and #2994 merged onto
cpp-migration4ff5e36d; all four merge cleanly with each other.ctest --preset release --no-tests=error -R '^(native_.*|startup_compute_dispatch(_.*)?_(warp|hardware)|startup_slot67_indirect_dispatch_warp|startup_compute_translate_e2e_warp|startup_stream_draw.*|startup_native_graphics.*)$'gives 88 tests, 84 passed and 4 skipped (77, WARP has no 32-lane waves).native_rtv_variant_hardwarepassed on the RX 9070 XT with the debug layer enabled and no message. The MRT0 bytes areffff1500eb006800(format 12),00801500eb006800(format 14) andfe7fffff15000000eb00000068000000(format 2), the same as on your RTX 4090.native_rtv_variant_warpandnative_rtv_variant_controlspassed, as did the stream draw and native graphics tests.Mutation here: dropping the
rtv1line from the variant manifest fails bothnative_rtv_variant_controlsandnative_rtv_variant_hardware. With it restored, both pass.Note:
compile_dxil --watch(#2992, merged alongside this) does not scan.rtv, so variants are compiled only by--requestsfor now. This PR saysRefs #2980, so I leave the issue open for you to close when you consider it complete.AI-assisted; the commands above were run locally.