diff options
Diffstat (limited to 'runtime/test/vk_queue_query_sync_test.cpp')
| -rw-r--r-- | runtime/test/vk_queue_query_sync_test.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/test/vk_queue_query_sync_test.cpp b/runtime/test/vk_queue_query_sync_test.cpp index b7237b911..49f4015c8 100644 --- a/runtime/test/vk_queue_query_sync_test.cpp +++ b/runtime/test/vk_queue_query_sync_test.cpp | |||
| @@ -331,6 +331,33 @@ int main() { | |||
| 331 | std::printf("queue/query sync: failed held batch reported, its wait kept for the retry, Signal behind it ran\n"); | 331 | std::printf("queue/query sync: failed held batch reported, its wait kept for the retry, Signal behind it ran\n"); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | // 3c. A Signal whose vkQueueSubmit fails signals nothing: a queue waiting for it stays held (the value is not | ||
| 335 | // counted as submitted), and the application's retry of the Signal goes through and releases it. | ||
| 336 | { | ||
| 337 | VulkanFence fence(context, 0); | ||
| 338 | EXPECT(fence.semaphore() != VK_NULL_HANDLE); | ||
| 339 | const std::uint64_t pattern = 0x5ca1ab1e0ddba11ULL; | ||
| 340 | std::memcpy(src_ptr, &pattern, sizeof(pattern)); | ||
| 341 | std::memset(dst_ptr, 0, sizeof(pattern)); | ||
| 342 | CommandList copy_list; | ||
| 343 | EXPECT(copy_list.copy_buffer({2, 0, 1, 0, sizeof(pattern)})); | ||
| 344 | EXPECT(copy_list.close()); | ||
| 345 | const CommandList* ptr = ©_list; | ||
| 346 | queue_b.wait(fence.semaphore(), 1); | ||
| 347 | EXPECT(queue_b.execute({&ptr, 1}) == ReplayResult::success); // held for the Signal | ||
| 348 | driver::fail_next_submit.store(VK_ERROR_OUT_OF_HOST_MEMORY); | ||
| 349 | EXPECT(!queue_a.signal(fence.semaphore(), 1)); // the submit fails | ||
| 350 | EXPECT(queue_b.idle() && fence.completed() == 0); | ||
| 351 | std::uint64_t got = 1; | ||
| 352 | std::memcpy(&got, dst_ptr, sizeof(got)); | ||
| 353 | EXPECT(got == 0); // the waiter did not run | ||
| 354 | EXPECT(queue_a.signal(fence.semaphore(), 1)); // the retry signals, and releases it | ||
| 355 | EXPECT(queue_b.idle() && queue_a.idle() && fence.completed() == 1); | ||
| 356 | std::memcpy(&got, dst_ptr, sizeof(got)); | ||
| 357 | EXPECT(got == pattern); | ||
| 358 | std::printf("queue/query sync: a failed Signal does not release its waiters; the retry does\n"); | ||
| 359 | } | ||
| 360 | |||
| 334 | // 4. Concurrent multi-queue EndQuery + ResolveQueries + temporary query pool add/remove stress. | 361 | // 4. Concurrent multi-queue EndQuery + ResolveQueries + temporary query pool add/remove stress. |
| 335 | // Each iteration uses a distinct query slot so no slot is reset while another submission resolves it. | 362 | // Each iteration uses a distinct query slot so no slot is reset while another submission resolves it. |
| 336 | { | 363 | { |