mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #407] d3d12: CPU subresource copies wait for their own submission only (STAGED-COPY-OWN-WAIT) #458
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#458
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/407
Author: @Kokonotcu
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:pr/staged-copy-wait📝 Commits (1)
9b77601CPU subresource copies wait for their own submission only (review D9)📊 Changes
4 files changed (+231 additions, -11 deletions)
View changed files
📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+31 -9)📝
runtime/src/vulkan_backend.h(+26 -2)➕
runtime/test/d3d12_staged_copy_wait_test.cpp(+167 -0)📄 Description
Claim: STAGED-COPY-OWN-WAIT
What was wrong
WriteToSubresource/ReadFromSubresourceon a texture the host cannot copy (noVK_EXT_host_image_copy, or not in GENERAL) replay aCopyTextureRegionon a stagingVulkanQueueand wait for it. The wait wasVulkanQueue::idle():vkQueueWaitIdleoninfo.queue(the VkQueue the first D3D12 direct queue also uses), held under the device's submit lock. Every such CPU copy waited for all the work queued on that queue, and no other queue could submit meanwhile.What changed
VulkanQueue::wait_submitted()waits on the queue's own progress timeline for what it submitted, without the submit lock (100 ms slices, wakes on device loss). The staging copy uses it instead ofidle().info.queueas before.Testing
RTX 3080 Laptop GPU, i7-11800H, Windows 10 19045, NVIDIA driver, MSVC 2022 RelWithDebInfo, Vulkan SDK 1.4.350.
d3d12_staged_copy_wait_test(standalone device): a staged 64x64WriteToSubresourcewhile the direct queue has ~32 ms of buffer copies queued: 31.8 ms before, 0.1-0.6 ms after (the direct queue still busy after it); the bytes round-trip. Fails before the change (its check that the write takes under half the queued work).d3d12_subresource_copy(both paths, 109 steps against the host runtime and Microsoft's recorded answers): 0 mismatches.d3d12_rgb96: pass.LEONIDA_VK_VALIDATION=1(0 validation errors).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.