gpu: bind both XMem inputs for a cached indirect mesh draw #2369

Merged
R0Y00 merged 2 commits from upstream-pr/2377 into main 2026-11-25 14:37:55 +00:00
R0Y00 commented 2026-11-25 14:20:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:20:48Z.


Refs #870, #1759 and #1914. Extends #2303 and #2332.

A cached slot 86 mesh pipeline can consume a four-byte root SRV and a single 12-byte indirect record from distinct XMem page windows in the same DIRECT command. Each range needs a submitted slot 15 writer. Recording and submission check both ranges, the queue waits on their writers and the consumer fence retains both leases. The two production switches remain opt-in. The shader profile accepts a mesh group ID for geometry generation and still requires exactly one constant-offset DWORD load.

Windows 11 26200.9974, MSVC x64 Release at 9bd985c0. RTX 4060 Laptop (32.0.16.1656) and WARP (10.0.26100.9818), D3D12 debug layer enabled. 17 selected tests passed, zero skips. A source-built compute initializer writes {0,1,1,0}. A second dispatch increments X twice after a UAV barrier. Slot 15 copies the first 12 bytes. Both writers produced eight red pixels. Omitting only the increments produced zero pixels with both waits enabled and both guards intact. Omitting only the SRV wait produced eight green pixels. Omitting only the argument wait produced four red and four clear pixels. Remapping only the argument page after recording left the target clear. Restoring its mapping restored all eight pixels.

. ./tools/dev.ps1
cmake --preset release -DCMAKE_TRY_COMPILE_CONFIGURATION=Release
cmake --build --preset release --target startup_indirect_draw_indexed xmem_shim
ctest --preset release --no-tests=error -j 1 -R '^(startup_mesh86_srv_proof|startup_indirect_mesh_(xmem_arguments.*|lease_.*))$'

The tests exercise the bounded source-built producer paths. A production UAV writer for a scene's argument buffer and a broader root SRV span still require separate evidence.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6606623184 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2377). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:20:48Z. --- Refs #870, #1759 and #1914. Extends #2303 and #2332. A cached slot 86 mesh pipeline can consume a four-byte root SRV and a single 12-byte indirect record from distinct XMem page windows in the same DIRECT command. Each range needs a submitted slot 15 writer. Recording and submission check both ranges, the queue waits on their writers and the consumer fence retains both leases. The two production switches remain opt-in. The shader profile accepts a mesh group ID for geometry generation and still requires exactly one constant-offset DWORD load. Windows 11 26200.9974, MSVC x64 Release at 9bd985c0. RTX 4060 Laptop (32.0.16.1656) and WARP (10.0.26100.9818), D3D12 debug layer enabled. 17 selected tests passed, zero skips. A source-built compute initializer writes {0,1,1,0}. A second dispatch increments X twice after a UAV barrier. Slot 15 copies the first 12 bytes. Both writers produced eight red pixels. Omitting only the increments produced zero pixels with both waits enabled and both guards intact. Omitting only the SRV wait produced eight green pixels. Omitting only the argument wait produced four red and four clear pixels. Remapping only the argument page after recording left the target clear. Restoring its mapping restored all eight pixels. ```powershell . ./tools/dev.ps1 cmake --preset release -DCMAKE_TRY_COMPILE_CONFIGURATION=Release cmake --build --preset release --target startup_indirect_draw_indexed xmem_shim ctest --preset release --no-tests=error -j 1 -R '^(startup_mesh86_srv_proof|startup_indirect_mesh_(xmem_arguments.*|lease_.*))$' ``` The tests exercise the bounded source-built producer paths. A production UAV writer for a scene's argument buffer and a broader root SRV span still require separate evidence.
upstream-sync closed this pull request 2026-11-25 15:01:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2369
No description provided.