From 40fee2723a74d0a7d5e73f34f560bc0336aac6b8 Mon Sep 17 00:00:00 2001 From: Joerg Wagner Date: Wed, 9 Oct 2019 20:53:46 +0200 Subject: [PATCH] Fix wrong wait stage mask The wait stage mask wasn't accounting for the stages the readers actually operate in, hence being effectless. Track the union of the reader's stage masks and use that to block execution on the semaphore. Affects: dEQP-VK.synchronization.signal_order.* Components: Vulkan VK-GL-CTS issue: 2044 Change-Id: Ia4d5c7bcb9dd6eec25e7245dc41754acccd1b995 --- .../vktSynchronizationSignalOrderTests.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp index 99b488f..c20bbb3 100644 --- a/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp +++ b/external/vulkancts/modules/vulkan/synchronization/vktSynchronizationSignalOrderTests.cpp @@ -704,12 +704,17 @@ public: DE_ASSERT(stageBits.size() == iterations.size()); DE_ASSERT(semaphoreHandlesA.size() == iterations.size()); - // Record all read operations into a single command buffer. + // Record all read operations into a single command buffer and record the union of their stage masks. + VkPipelineStageFlags readStages = 0; ptrCmdBufferB = makeVkSharedPtr(makeCommandBuffer(vkB, *deviceB, *cmdPoolB)); cmdBufferB = **(ptrCmdBufferB); beginCommandBuffer(vkB, cmdBufferB); for (deUint32 iterIdx = 0; iterIdx < iterations.size(); iterIdx++) - iterations[iterIdx].readOp->recordCommands(cmdBufferB); + { + QueueSubmitOrderSharedIteration& iter = iterations[iterIdx]; + readStages |= iter.readOp->getInSyncInfo().stageMask; + iter.readOp->recordCommands(cmdBufferB); + } endCommandBuffer(vkB, cmdBufferB); // Export the last semaphore for use on deviceB and create another semaphore to signal on deviceB. @@ -787,7 +792,7 @@ public: &timelineSubmitInfo : DE_NULL, // const void* pNext; 1u, // deUint32 waitSemaphoreCount; &semaphoreHandlesB.front(), // const VkSemaphore* pWaitSemaphores; - &stageBits[0], // const VkPipelineStageFlags* pWaitDstStageMask; + &readStages, // const VkPipelineStageFlags* pWaitDstStageMask; 1u, // deUint32 commandBufferCount; &cmdBufferB, // const VkCommandBuffer* pCommandBuffers; 1u, // deUint32 signalSemaphoreCount; @@ -1340,12 +1345,17 @@ public: DE_ASSERT(stageBits.size() == iterations.size()); DE_ASSERT(semaphoreHandlesA.size() == iterations.size()); - // Record all read operations into a single command buffer. + // Record all read operations into a single command buffer and track the union of their execution stages. + VkPipelineStageFlags readStages = 0; ptrCmdBufferB = makeVkSharedPtr(makeCommandBuffer(vk, device, *cmdPoolB)); cmdBufferB = **(ptrCmdBufferB); beginCommandBuffer(vk, cmdBufferB); for (deUint32 iterIdx = 0; iterIdx < iterations.size(); iterIdx++) - iterations[iterIdx].readOp->recordCommands(cmdBufferB); + { + QueueSubmitOrderIteration& iter = iterations[iterIdx]; + readStages |= iter.readOp->getInSyncInfo().stageMask; + iter.readOp->recordCommands(cmdBufferB); + } endCommandBuffer(vk, cmdBufferB); addSemaphore(vk, device, semaphoresB, semaphoreHandlesB, timelineValuesB, timelineValuesA.back()); @@ -1412,7 +1422,7 @@ public: &timelineSubmitInfo : DE_NULL, // const void* pNext; 1u, // deUint32 waitSemaphoreCount; &semaphoreHandlesA.back(), // const VkSemaphore* pWaitSemaphores; - &stageBits[0], // const VkPipelineStageFlags* pWaitDstStageMask; + &readStages, // const VkPipelineStageFlags* pWaitDstStageMask; 1u, // deUint32 commandBufferCount; &cmdBufferB, // const VkCommandBuffer* pCommandBuffers; 1u, // deUint32 signalSemaphoreCount; -- 2.7.4