runtime: forward one GPU-written indirect indexed draw #1884
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1891"
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 avt0m4t48 on 2026-11-24T20:18:17Z.
Refs #1759. Follows the Dispatch-only slice in #1867.
Forward one rootless desktop DrawIndexed record on guest command-list slot 61. In this slice the graphics pipeline uses reflected desktop SM5 vertex and pixel shader bytecode, no root parameters or vertex input layout, one single-sample color target, and a placed index view. Slot 61 checks the inherited state, translates the index view to the desktop backing address, and transitions the argument and index buffers for GPU reads. The direct draw paths keep their existing shader-cache behavior. Producers operating on the native list restore COMMON before entering the guest path.
The source-built compute writer selects left or right by changing StartIndexLocation. The left case uses a 16-bit index buffer and the right uses 32-bit indices. The fenced readback checks the exact color of all eight pixels and both argument guards. Omitted-writer, invalid-index and short-argument controls preserve the clear color.
Validation on Windows WARP with the debug layer enabled:
cmake --build --preset release --target startup_indirect_draw_indexed startup_indirect_dispatchctest --preset release --no-tests=error -R '^startup_indirect_(draw_indexed|dispatch)_warp$' -Vpassed 2/2.0xff000000instead of0xff0000ff. Windows verificationTo test on a physical adapter, run
ctest --preset release --no-tests=error -R '^startup_indirect_draw_indexed_hardware$' -Von the built target. A physical GPU run and translation of guest graphics pipelines with resource bindings remain open.Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T20:34:19Z.
Built it here and ran both WARP tests
At the PR head, Windows 11 build 26300.9974, WARP 10.0.26100.9818:
So the new slice runs here independently of the author's machine, and the
Dispatchslice it builds on still passes.Two mutations to the production side
Each rebuilt into
d3d12_xs.dll(timestamp checked) and reverted:D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXEDsignature check short-circuited tofalsedesktop_indexed_shader: theBytecodeLength > (1u << 20)bound droppedThe first is the load-bearing one: without the signature check the record is not recognised as this slice's shape and the
fixture notices. The second is a guard this fixture does not reach — it never feeds an oversized bytecode blob, so dropping
the upper bound keeps the test green. That is not a defect, just a note on what the fixture covers: the size bound and the
readable(...)check on the shader blob are defensive, and if you want them pinned they need their own cases (a blob justover 1 MiB, and one with an unreadable page).
The preset change
CMakePresets.jsongrows the new target in thereleasebuild list and extends theprtest filter tostartup_indirect_(dispatch|draw_indexed)_warp. That is the right place for it — the PR lane now runs both slices — but itdoes mean every PR's smoke test grows by one GPU test. At ~0.2 s on WARP that is fine; worth knowing it happened.
Verdict
Reviewed. The slice runs, its central recognition check is pinned by a mutation, and the negative controls in the description
(restore upstream runtime, zero the index-buffer offset) match the two things that could silently pass. No objections.
Notes