From fbc11e973d5a1de721f8b70cd5721a8fe709fc3c Mon Sep 17 00:00:00 2001 From: AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> Date: Sun, 22 Nov 2026 19:22:39 +0100 Subject: D3D12 queues: hold a batch that waits for a Signal not yet submitted, so layouts follow dependency order A queue's ExecuteCommandLists is replayed against one LayoutTracker in call order, so a batch that waits (cross-queue) for a Signal submitted later was recorded against layouts from before the work it waits for. Track, per fence, the highest Signal value submitted (CPU Signal and the creation value count); a queue holds a batch, and what follows it, while a Wait names a higher value, and the thread that submits the satisfying Signal releases the held work in dependency order on its own VkQueue. Reports a queue destroyed with held work and a fence released under a waiter; nothing blocks. Adds d3d12_queue_handover_test (27 queue-type assignments x 6 submission orders, two producers, CPU Signal cases, never-signaled and released fences, byte-exact against the host runtime) and updates docs section 4.4 and the M4 row. Two existing tests that used an unsignaled Wait as a GPU gate or expected a synchronous submit failure under a pending Wait now declare the Signal first. Co-Authored-By: Claude Opus 5.5 --- runtime/test/vk_queue_query_sync_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/test/vk_queue_query_sync_test.cpp') diff --git a/runtime/test/vk_queue_query_sync_test.cpp b/runtime/test/vk_queue_query_sync_test.cpp index a9daf6477..a03e369b9 100644 --- a/runtime/test/vk_queue_query_sync_test.cpp +++ b/runtime/test/vk_queue_query_sync_test.cpp @@ -267,12 +267,14 @@ int main() { EXPECT(copy_list.close()); const CommandList* ptr = ©_list; + // The Signal comes first: a Wait with no submitted Signal holds the batch on the CPU (queue_holds.h) and + // never reaches vkQueueSubmit, so it could not fail there. + EXPECT(fence.signal(1)); queue_a.wait(fence.semaphore(), 1); driver::fail_next_submit.store(VK_ERROR_OUT_OF_HOST_MEMORY); EXPECT(queue_a.execute({&ptr, 1}) == ReplayResult::unsupported); // Retry: the pending wait on (fence, 1) must still be attached to the next vkQueueSubmit. - EXPECT(fence.signal(1)); driver::captured_wait_count.store(0); driver::captured_wait_sem.store(0); driver::captured_wait_val.store(0); -- cgit v1.2.3