Repository navigation
Runtime: preserve queue order for sparse buffer tile mappings - #4224
gabrielsteglich wants to merge 5 commits into
Conversation
Defer reserved-buffer tile updates and copies alongside held command batches and signals. Keep sparse backing alive, resolve source mappings at submission order, and carry waits past no-op or rejected binds. Compare all tile readbacks with native D3D12 for CPU and COPY queue signals, and test wait forwarding with a fake incomplete Vulkan producer.
Kam471
left a comment
There was a problem hiding this comment.
Built vk_sparse_queue_order_test and d3d12_buffer_tiles_test at bc15a8bb and ran them on Windows 11, RTX 5070 Ti:
vk_sparse_queue_order_test-> exit 0: "Sparse queue order: deferred no-op and rejected mappings preserve GPU waits".d3d12_buffer_tiles_test-> exit 0: Vulkan replay with a held batch (CPU Signal and copy-queue Signal): 12 full tiles match across all readbacks; native D3D12 tier 4, original order and both held-batch orders: 12 full tiles match each; the arena reports 3 allocations / 0 refused.ctest -R 'vk_sparse_queue_order|d3d12_buffer_tiles'-> 2/2 passed.
The new test covers the two cases the old path mishandled — a deferred mapping that turns into a no-op and one rejected at release — while the normal held-batch order still reads back every tile correctly on both the layer and native D3D12. No blocking issue.
|
Tested bc15a8b on NVIDIA GeForce RTX 3070 (Ampere, sparse binding), driver 617.42, Windows 11 24H2, MSVC 19.44 RelWithDebInfo: pass.
No game files. AI-assisted (Claude). |
|
Tested bc15a8b on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101), Windows 11, MSVC 14.51: pass. The build has no validation layers, and it does not include the fixtures that need Vulkan and native D3D12 both report Negative control: the new mock test, built with the backend of main Full ctest: this head gives 123 pass, 2 fail, 9 skip, 1 disabled. Main gives 122 pass with the same 2 failures. The extra pass is the new I found no defect. AI-assisted. |
|
Tested
The first replay also logs AI-assisted (Claude Code). |
|
Tested f56726d on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested f56726d merged with main 98fa503 (merged tree 08808ba2b9) on Windows 11, RTX 4080 SUPER + Intel UHD 770 (MSVC 14.51): pass. Full runtime build.
|
|
Tested f56726d on NVIDIA GeForce RTX 3070 (Ampere), driver 610.88, Windows 11 Pro 10.0.26200: pass
Built with MSVC through |
|
Tested
AI-assisted (Claude Code). |
Claimed in the coordination issue #4084. This follows the reserved-buffer mappings in #987 and queue hold ordering in #2951.
What and why
When a D3D12 queue held a copy batch for an unresolved fence, later
UpdateTileMappingsandCopyTileMappingscalls could reach Vulkan first. The earlier copy could then read a different tile mapping from the one it should have seen.Both mapping operations now enter the same FIFO as held command batches and signals. A deferred operation owns its mapping arguments and keeps the sparse buffers and heap backing alive.
CopyTileMappingsreads the source mapping when it reaches the front of the queue. A no-op or rejected bind passes its waits to the next submission.Tested
bc15a8bb097f700b04187b32944b1cb397f9342fagainstaa2988cc555bad7ecd508b48a702adbb32fe7c95. Windows 11 build 26300, NVIDIA RTX 3090 driver 621.01, MSVC 19.44.35229, Windows SDK 10.0.28000.0, Vulkan SDK 1.4.363.0, RelWithDebInfo, Vulkan synchronization validation enabled.Signalvariants read zero in the first tile in the Vulkan layer, where native D3D12 read0x23456789.vk_sparse_queue_orderCPU test passed all four wait-forwarding cases. The final targeted run also passedd3d12_buffer_tilesandd3d12_queue_handover.Checklist
AI-assisted (OpenAI Codex).