upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/cpp_unwind_test.cpp
diff options
context:
space:
mode:
authorRüzgar Koray Genç <koray_genc1@hotmail.com>2026-11-23 18:48:39 -0800
committerRüzgar Koray Genç <koray_genc1@hotmail.com>2026-11-23 20:44:11 -0800
commit9b77601d083af33b2658ef556104bae05fd87e32 (patch)
tree7a3c7d4ed5eb01cc6796e5b33fe76f070bc8157a /runtime/test/cpp_unwind_test.cpp
parentd2cd6c0d970083eee4d7b40daabb2480a77b1790 (diff)
CPU subresource copies wait for their own submission only (review D9)
WriteToSubresource/ReadFromSubresource without host image copy replay a CopyTextureRegion on a staging VulkanQueue and wait for it. The wait was VulkanQueue::idle(): vkQueueWaitIdle on info.queue, the VkQueue the first D3D12 direct queue also uses, under the device's submit lock. Every such CPU copy waited for all the game work queued there, and no queue could submit meanwhile. - VulkanQueue::wait_submitted waits on the queue's own progress timeline for what it submitted, without the submit lock (bounded slices, wakes on device loss). The staging copy uses it instead of idle(). - The staging queue is on a VkQueue the game's first queues are not on (CreateCommandQueue hands each family's out from the first, so the last): the copy family's for colour textures, whose engine runs beside queued graphics work; the graphics family's for depth/stencil and rgb96 textures, whose copies may run the D24/rgb96 compute pass. A second graphics VkQueue alone did not help on NVIDIA: the timeline wait still took the whole 32 ms, the copy ran behind the busy queue. Where the family has one VkQueue the copy shares info.queue as before. - No waits on other queues are attached: D3D12 requires the application to have seen the texture's GPU work complete before a CPU copy (it waits on a fence its queue signalled), and that host wait followed by this submission orders the work before the copy and makes its writes visible. Pending work of other queues would only be waited for needlessly. Measured (d3d12_staged_copy_wait_test, RTX 3080 Laptop, standalone device): a staged 64x64 WriteToSubresource while the direct queue has 32 ms of buffer copies queued took 31.8 ms before, 0.10 ms now (the direct queue still busy after it); the bytes round-trip. d3d12_subresource_copy (both paths, 109 steps against the host and Microsoft's answers), d3d12_rgb96 and the new test are clean under LEONIDA_VK_VALIDATION=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/cpp_unwind_test.cpp')
0 files changed, 0 insertions, 0 deletions