Fix use of binary semaphore in signaled state
authorLars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Fri, 23 Apr 2021 10:04:44 +0000 (12:04 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 13 May 2021 08:15:39 +0000 (08:15 +0000)
Vulkan spec specifies that binary semaphore waits and signals should
occur in discrete 1:1 pairs.

This change ensures that the binary semaphore signaled by
synchronizationWrapper[SECOND] is waited on before being used again,
which resolves the corresponding validation layer error.

In addition, the change fixes an issue where the second submission pair
did not correctly swap semaphore info.

Components: Vulkan

Affects:
dEQP-VK.synchronization.basic.binary_semaphore.multi_queue
dEQP-VK.synchronization.basic.binary_semaphore.multi_queue_typed
dEQP-VK.synchronization.basic.timeline_semaphore.multi_queue

VK-GL-CTS Issue: 2910

Change-Id: Id2fb2211a43150e3acb5c07dd6c205c7a42296d5

external/vulkancts/modules/vulkan/synchronization/vktSynchronizationBasicSemaphoreTests.cpp

index 3f7b196e415bdbe8e8890cdf971a192bd82becf2..e324e20c180e195afe16a4926c85f43601b31274 100644 (file)
@@ -522,12 +522,12 @@ tcu::TestStatus basicMultiQueueCase(Context& context, TestConfig config)
                        isTimelineSemaphore
                );
                synchronizationWrapper[SECOND]->addSubmitInfo(
-                       0u,                                                                                                     // deUint32                                                             waitSemaphoreInfoCount
-                       DE_NULL,                                                                                        // const VkSemaphoreSubmitInfoKHR*              pWaitSemaphoreInfos
-                       1u,                                                                                                     // deUint32                                                             commandBufferInfoCount
-                       &commandBufferInfo[SECOND],                                                     // const VkCommandBufferSubmitInfoKHR*  pCommandBufferInfos
-                       1u,                                                                                                     // deUint32                                                             signalSemaphoreInfoCount
-                       &signalSemaphoreSubmitInfo[SECOND],                                     // const VkSemaphoreSubmitInfoKHR*              pSignalSemaphoreInfos
+                       isTimelineSemaphore ? 0u : 1u,                                                          // deUint32                                                             waitSemaphoreInfoCount
+                       isTimelineSemaphore ? DE_NULL : &waitSemaphoreSubmitInfo,       // const VkSemaphoreSubmitInfoKHR*              pWaitSemaphoreInfos
+                       1u,                                                                                                                     // deUint32                                                             commandBufferInfoCount
+                       &commandBufferInfo[SECOND],                                                                     // const VkCommandBufferSubmitInfoKHR*  pCommandBufferInfos
+                       1u,                                                                                                                     // deUint32                                                             signalSemaphoreInfoCount
+                       &signalSemaphoreSubmitInfo[FIRST],                                                      // const VkSemaphoreSubmitInfoKHR*              pSignalSemaphoreInfos
                        DE_FALSE,
                        isTimelineSemaphore
                );