diff options
| author | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 19:22:39 +0100 |
|---|---|---|
| committer | AlxcBTW <187763517+AlxcBTW@users.noreply.github.com> | 2026-11-22 19:22:39 +0100 |
| commit | fbc11e973d5a1de721f8b70cd5721a8fe709fc3c (patch) | |
| tree | c541babd5f1994164514bf5ddaa212d1fe3b3c1c /runtime/test/vk_queue_query_sync_test.cpp | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/vk_queue_query_sync_test.cpp')
| -rw-r--r-- | runtime/test/vk_queue_query_sync_test.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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() { | |||
| 267 | EXPECT(copy_list.close()); | 267 | EXPECT(copy_list.close()); |
| 268 | const CommandList* ptr = ©_list; | 268 | const CommandList* ptr = ©_list; |
| 269 | 269 | ||
| 270 | // The Signal comes first: a Wait with no submitted Signal holds the batch on the CPU (queue_holds.h) and | ||
| 271 | // never reaches vkQueueSubmit, so it could not fail there. | ||
| 272 | EXPECT(fence.signal(1)); | ||
| 270 | queue_a.wait(fence.semaphore(), 1); | 273 | queue_a.wait(fence.semaphore(), 1); |
| 271 | driver::fail_next_submit.store(VK_ERROR_OUT_OF_HOST_MEMORY); | 274 | driver::fail_next_submit.store(VK_ERROR_OUT_OF_HOST_MEMORY); |
| 272 | EXPECT(queue_a.execute({&ptr, 1}) == ReplayResult::unsupported); | 275 | EXPECT(queue_a.execute({&ptr, 1}) == ReplayResult::unsupported); |
| 273 | 276 | ||
| 274 | // Retry: the pending wait on (fence, 1) must still be attached to the next vkQueueSubmit. | 277 | // Retry: the pending wait on (fence, 1) must still be attached to the next vkQueueSubmit. |
| 275 | EXPECT(fence.signal(1)); | ||
| 276 | driver::captured_wait_count.store(0); | 278 | driver::captured_wait_count.store(0); |
| 277 | driver::captured_wait_sem.store(0); | 279 | driver::captured_wait_sem.store(0); |
| 278 | driver::captured_wait_val.store(0); | 280 | driver::captured_wait_val.store(0); |