startup: bind compute root SRV buffers (srv <i> buf root <param>) at Dispatch #2953
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2953"
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 consolelogkyo on 2026-11-26T23:11:39Z.
Summary
Consume
srv <i> buf root <param>in the startup compute manifest loader and bind the recorded guest root SRV buffer at translated computeDispatch(the runtime follow-up to theglobal_load_dwordlowering in #2715, ticketC500-01/031):src/startup_stubs/d3d12_xs_device.cpp): record the guest address and a bound bit per compute root parameter in slot 43 (SetComputeRootShaderResourceView) while a compute root signature is bound; clear them onClose(slot 9),Reset(slot 139), or when slot 33 (SetComputeRootSignature) binds a different compute root signature, while preserving them when re-binding the same root signature.src/startup_stubs/d3d12_compute_dispatch.inl):srv <i> buf root <param>inload_compute_translation(exact whole-line match,param >= 0, sequentiali), reject descriptor-word entry values (stride,descword3) referencing a root SRV slot, and refuse indirect dispatches that require root SRV bindings.Dispatch(slot 14), verify incompute_root_srv_bufferthat<param>in the bound compute root signature hasD3D12_ROOT_PARAMETER_TYPE_SRV, was set by slot 43 since the compute root signature was bound or reset, has a non-null 4-byte-aligned guest address at a 16-byte-aligned offset inside a recording upload allocation (slot 148) or live aliased placed buffer inCOMMONstate (slot 133), and does not alias an output UAV buffer, then bind a bounded rawDXGI_FORMAT_R32_TYPELESSByteAddressBufferview from that offset to the end of its backing range (up to 16 MiB).tests/startup_compute_root_srv_dispatch_check.py(tests/cmake/startup_compute_root_srv.cmake),tests/startup_stream_consumer.cppdispatch-root-srv*modes, anddocs/experiments/startup-compute-root-srv.md.Refs #2618, #2274
Verification
Windows 11 (
10.0.26100), Release preset (MSVC 19.44, Windows SDK10.0.26100.0DXC),X2W_D3D12_DEBUG=1(0D3D12 debug-layer errors) on both Microsoft Basic Render Driver (WARP) (1414:008c, driver10.0.26100.9818) and AMD Radeon RX 9070 XT (1002:7550, driver32.0.32029.2010):startup_compute_root_srv_dispatch_warp: PASS (1- and 2-root-SRV dispatches,+16/+32placed and upload offsets, out-of-bounds zero clamp with neighbor canaries untouched, 16 refusal controls, 3 negative controls)startup_compute_root_srv_dispatch_hardware(RX 9070 XT): PASSAI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:14:22Z.
Review: COMMENTED
PR #2953 by @consolelogkyo — startup: bind compute root SRV buffers at Dispatch
What works
Issues
Recommendations
Overall
Solid, well-scoped follow-on to #2715. The split between command-list tracking and manifest consumer is clean, the invariant checks are thorough, and the test suite gives good coverage including canary boundary preservation. With the alignment guard and indirect-dispatch runtime assert, this would be ready to merge.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T05:26:38Z.
Review: APPROVED
Reviewed
f76adb7e050a794ed354f485ea16e6da4350e687in a clean integration build against maine62e3a5e. Both root-SRV readbacks and neighboring compute regressions passed. The fixture exercised a wrong-kind root CBV, +16-byte placed/upload starts, bounded OOB reads, and three negative controls. The binder checks the effective resource offset for 16-byte alignment and rejects root SRVs in indirect dispatch. Windows 11 26200.9974, Release /O2, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. Relevant release tests: startup_compute_root_srv_dispatch_(warp|hardware), startup_compute_dispatch_warp, startup_gfx2hlsl_heap_word. Required Windows CI passed.