From 3baf4c62d924e16cd11aaf61b16ad6c3721562bd Mon Sep 17 00:00:00 2001 From: Liam Middlebrook Date: Thu, 3 Jan 2019 14:07:10 -0800 Subject: [PATCH] Fix dup tests to not free in-use semaphores/fences The dup{,2,3} tests were subject to a race condition in which a semaphore may be deleted before a VkQueue which was dependent on it had completed execution. This change moves the vkQueueWaitIdle call into the same scope as the semaphores/fences that the queue is dependent on. VK-GL-CTS issue: 1538 Components: Vulkan Affects: dEQP-VK.api.external.{fence,semaphore}.opaque_fd.dup* Change-Id: I73cf541c9c184790df44b68b8a065787634847d9 (cherry picked from commit 732a8b6800972b271735cf9b865a3612fb56dfc4) --- .../vulkan/api/vktApiExternalMemoryTests.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index 606f7aa..ccafd67 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -1350,11 +1350,11 @@ tcu::TestStatus testSemaphoreFdDup (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else @@ -1420,11 +1420,11 @@ tcu::TestStatus testSemaphoreFdDup2 (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else @@ -1490,11 +1490,11 @@ tcu::TestStatus testSemaphoreFdDup3 (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else @@ -2364,11 +2364,11 @@ tcu::TestStatus testFenceFdDup (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else @@ -2434,11 +2434,11 @@ tcu::TestStatus testFenceFdDup2 (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else @@ -2504,11 +2504,11 @@ tcu::TestStatus testFenceFdDup3 (Context& context, } else DE_FATAL("Unknown permanence."); + + VK_CHECK(vkd.queueWaitIdle(queue)); } } - VK_CHECK(vkd.queueWaitIdle(queue)); - return tcu::TestStatus::pass("Pass"); } #else -- 2.7.4