Merging.
**Why merged:** on Windows 10, the in-box `d3d12.dll` refuses root-signature flags `0xC00` (heap directly indexed) in its serializer, so the title is left with a null program and stops about 15 s in (`exe+0xb5a5f8`, a read of `0x68`); testers on Windows 10 hit this every boot. This retries only after the host has refused, and only when `0xC00` is in the description. It covers both the versioned and the legacy `D3D12SerializeRootSignature`, patches the flags back into `RTS0` after checking the container hash (failing closed), and it's claimed as D3D12-SET-HEAPS-BLOB. It's the better of the two PRs for this. #683 does the same for the versioned path only, by probing each bit through a static that captures the first serializer pointer.
**Why it's good:** on this Windows 11 host the real serializer accepts the flags, so I also checked the refusal path independently with a harness: a fake serializer that refuses `0xC00` and forwards everything else to the real Windows 11 serializer, on the RTX 4070 SUPER's hardware D3D12 device. #1353's wrappers (versioned 1.0 and 1.1, legacy 1.0) return S_OK after exactly one refusal; the flags read back as `0xc01` through the host deserializer; hardware `CreateRootSignature` succeeds; an unrelated failure is passed through; and a host that accepts the flags gets a byte-identical blob, 16/16. root_sig, root_signature, root_signature_oracle, d3d12_set_descriptor_heaps, d3d12_xs_root_signature, d3d12_draw, bundle, device_proxy and xs_proxy_mock* pass 14/14, both plain and with `LEONIDA_VK_VALIDATION=1`. The repository-consistency set gives 578/5/0. It merges cleanly onto main after #984 (neither #984 nor DadaCap's prototype carries this fix). Minor note: it returns S_FALSE ("flags lost") if a blob can't be patched, which is fine.
AI-assisted (Claude Code, Claude Opus 5.5).
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.
The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
- CreateGraphicsPipelineState (PC slot 10): VS and PS found by the SHA-256
of their FSSM programs in the translator's index. Input-layout elements are
matched to the VS input signature by semantic name and index; location =
the element's register (the translator's vertex-fetch rule); a layout that
leaves an input unfed is refused, as D3D12 does. Rasterizer, blend and
depth-stencil state map one to one; viewport, scissor, topology, vertex
strides, stencil references and blend factor are dynamic; dynamic
rendering takes the RTV/DSV formats. Hull/domain/geometry, stream output,
MSAA, set-0 bindings and two code-base stages (question 14) are refused
with a log.
- Command list: IASetPrimitiveTopology / VertexBuffers / IndexBuffer,
RSSetViewports / ScissorRects (first of each), OMSetRenderTargets (views
read at the call, single-range handles too), OMSetBlendFactor,
OMSetStencilRef and CommandList8's front/back references (now applied),
DrawInstanced / DrawIndexedInstanced recording a copy of that state.
CreateCommandList's initial pipeline state is applied. Reset and
ClearState share one state reset.
- Replay: vertex/index views resolve to buffers by VA (arena or upload),
attachments move to attachment layouts through the tracker (first use
zero-fills), the draw runs in a dynamic-rendering scope with a flipped
viewport (translated VS write D3D clip coordinates), stencil references
per face, then vkCmdDraw / vkCmdDrawIndexed. Render-target views take the
pipeline's formats (the view cache keys on format).
- shader_library.h reads the index's input_signature and PS outputs.
Test: d3d12_draw_test (through the proxy) builds a VS+PS PSO whose input
layout order differs from the VS registers, uploads a vertex buffer into the
arena, reads indices from an upload heap, and draws two indexed quads with
different root constants and root CBVs plus a back-facing triangle: all 4096
read-back pixels match (which also checks the viewport flip and winding).
Shaders are GLSL written to the translator's contract. d3d12_com_test now
uses SetMarker as its unimplemented-method example, since DrawInstanced is
implemented. 13/13 ctest; all six GPU tests clean under the Khronos
validation layer.