Repository navigation
OLD-7234: restore old upstream PR 7234 - d3d12_xs: pin that the root-signature flag mask keeps every public flag (old upstream PR 7140) - #677
Conversation
…ag (old upstream PR 7140) The shims clear bits 24-31 of a root signature's flags on every descriptor and RTS0 blob. Old upstream PR 7140 asks to make that conditional on the blob's origin, since the retail executable's root signatures carry no 0x03000000 (one 1.1 description with Flags 0x80, and a decoder whose Flags is a 16-bit read). Every public D3D12_ROOT_SIGNATURE_FLAGS value is in bits 0-11, so the mask can't change those descriptors and no behaviour change is needed. root_sig_public_flags_test pins it: - the descriptor helpers (1.0, 1.1, 1.2, legacy) keep all 65536 flag values in [0, 0xFFFF], and an RTS0 blob with such flags is not rewritten; - the registered serializer shims give the host's blob byte for byte for each public flag, 0x80 and all twelve, and the deserializer shim returns the host's flags; - a blob with 0x03000080 comes back as 0x80 with a valid container hash and no other byte changed; - static_asserts that no public flag is in kXboxRootSignatureFlagHighByte. docs/d3d12_vulkan.md: the executable's answer to the open question, and why the mask stays unconditional. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly on a host without 1.2 The allowance is for runtimes that serialize only up to 1.1, where the shim rewrites 1.2 as 1.1. On a host that serializes 1.2 itself it hid a real difference: under a mask that also clears 0x80, the host refuses all twelve flags and the shim accepts 0xF7F. The host is now probed once with an empty 1.2 description, and the allowance applies only when it refuses that too (review of old upstream PR 7234). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
agent: yes Code review and repository integrity check:
|
lixonik
left a comment
There was a problem hiding this comment.
Independent native Windows 10 run at 3769fd6b: root_sig_public_flags_test builds with MSVC and passes with zero failures.
I also built that exact test against the shim from #683 at d1029668, which is a useful merge-order check. The combined run has two failures: the host-parity assertion for versioned 1.0 and for 1.1. Each sees two different results because #683 intentionally accepts the heap-indexed cases that the host serializer refuses. The separate checks that the flags round-trip and that the input description is unchanged still pass.
Whichever lands second will need to update that test expectation for the intentional Windows 10 fallback. The flag preservation and byte-for-byte parity where the host accepts the description can still be checked.
AI-assisted testing on synthetic root signatures from full Git worktrees. No GPU required.
|
Thanks for the Windows 10 run and for checking it against #683.
AI-assisted (Claude Code, Claude Opus 5.5). |
lixonik
left a comment
There was a problem hiding this comment.
Follow-up now that #1353 has merged. I rebuilt this PR's root_sig_public_flags_test.cpp at 3769fd6b against the shim sources at the #1353 merge commit a2de554e on native Windows 10 with MSVC. The test exited 1 with three failing host-parity checks: versioned 1.0, versioned 1.1, and the legacy serializer. The legacy check is now affected as well because #1353 covers that entry point. The flag-preservation and Xbox-bit masking checks still passed.
Please account for the intentional heap-indexed fallback in those three assertions while keeping the byte-for-byte checks for the cases the host accepts. AI-assisted, CPU-only synthetic test.
…_test does on main main's d3d12_xs.cpp now calls into d3d12_xs_pso_stream.cpp, and main added that file to root_sig_test's sources; this target lists the same shim files and needs it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e host refuses those flags Since ProjectLeonida#1353 the shims' serializers (versioned and legacy) serialize a description the host refuses for CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED (Windows 10's in-box d3d12.dll): they call the host again without the two bits and put them back into RTS0. The three host-parity checks failed on Windows 10 for that, as reported in review. Where the host refuses such flags but takes the description without them, the shim now has to return S_OK with that blob byte for byte, except the RTS0 flags dword, which must hold all the flags, and a valid container hash. Byte-for-byte parity stays wherever the host accepts, and the shim still has to refuse whatever else the host refuses. The doc bullet says the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged:
AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: OLD-7234 #14 (comment)
Restoration of my original pull request, old upstream PR 7234 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at 21625bc; the only changes are that the old PR references in comments and commit messages are now plain text ("old upstream PR 7140").What and why
main.kXboxRootSignatureFlagHighByte,runtime/shims/d3d12_xs_rootsig.h) on every descriptor and RTS0 blob, whatever built it.0x03000000: its direct call passes a 1.1 description withFlags = 0x80, and its decoder readsFlagsas a 16-bit value.D3D12_ROOT_SIGNATURE_FLAGSvalue is in bits 0-11, so the mask cannot touch one, and it can stay unconditional.docs/d3d12_vulkan.mdanswers the question the doc still left open ("whether its root signatures carry them is open") and says why the mask stays as it is.root_sig_public_flags_test(Windows only, next toroot_sig_test) checks:[0, 0xFFFF];0x80and all twelve;0x03000080comes back as0x80, with a valid container hash and no other byte changed;static_asserts that no public flag lies in the cleared byte.Tested
Built and run on Linux. The Windows build used clang targeting x86_64-w64-mingw32 and ran under Wine 11.22. MSVC (
/W4 /permissive-) is left to CI.root_sig_public_flags_testbuilt againstmain's code: 28 pass, 0 fail, as expected for a guard.0x80, in a scratch copy: 12 pass, 16 fail. So the test catches a mask that eats a public flag.root_sig_test: 56 pass, 1 fail, the same onmainand on this branch. The failure is "shim deserializer accepts an all-zero-checksum Xbox blob". Wine's host deserializer causes it, and this pull request does not touch it.git diff --checkandscripts/check_no_game_data.pyon the changed files: clean.GPUs tested: n/a (the test needs no GPU)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).