Fix semaphore creation in smoke tests
authorPeter Quayle <peter.quayle@imgtec.com>
Tue, 8 Oct 2019 16:35:04 +0000 (17:35 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 11 Oct 2019 07:32:39 +0000 (03:32 -0400)
The test was calling createSemaphore instead of createSemaphoreType,
meaning that the semaphoreType value would incorrectly be interpreted
as a VkSemaphoreCreateFlags.

Additionally, the VkTimelineSemaphoreSubmitInfo struct was not being
added into the pNext chain of the submits. This probably went unnoticed
because the first bug could cause the test to use binary semaphores
even if semaphoreType was TIMELINE.

Affects:

dEQP-VK.synchronization.smoke.binary_semaphores
dEQP-VK.synchronization.smoke.timeline_semaphores

Components: Vulkan

VK-GL-CTS issue: 2041

Change-Id: I6936013b7f5a7e25f4af1fb4776d4d7273243d7a
(cherry picked from commit a8238c0aa023c121f79f09c6565875e235292f27)

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

index 8535c7e..5eb7422 100644 (file)
@@ -1108,7 +1108,7 @@ tcu::TestStatus testSemaphores (Context& context, VkSemaphoreTypeKHR semaphoreTy
        VkResult                                                        testStatus;
        TestContext                                                     testContext1                    (deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
        TestContext                                                     testContext2                    (deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
-       Unique<VkSemaphore>                                     semaphore                               (createSemaphore(deviceInterface, *device, semaphoreType));
+       Unique<VkSemaphore>                                     semaphore                               (createSemaphoreType(deviceInterface, *device, semaphoreType));
        VkSubmitInfo                                            submitInfo[2];
        VkTimelineSemaphoreSubmitInfoKHR        timelineSubmitInfo[2];
        const deUint64                                          timelineValue                   = 1u;
@@ -1159,10 +1159,12 @@ tcu::TestStatus testSemaphores (Context& context, VkSemaphoreTypeKHR semaphoreTy
        submitInfo[0].pSignalSemaphores                                 = &semaphore.get();
        timelineSubmitInfo[0].pSignalSemaphoreValues    = &timelineValue;
        timelineSubmitInfo[0].signalSemaphoreValueCount = 1;
+       submitInfo[0].pNext = (semaphoreType == VK_SEMAPHORE_TYPE_TIMELINE ? &timelineSubmitInfo[0] : DE_NULL);
        submitInfo[1].waitSemaphoreCount                                = 1;
        submitInfo[1].pWaitSemaphores                                   = &semaphore.get();
        timelineSubmitInfo[1].pWaitSemaphoreValues              = &timelineValue;
        timelineSubmitInfo[1].waitSemaphoreValueCount   = 1;
+       submitInfo[1].pNext = (semaphoreType == VK_SEMAPHORE_TYPE_TIMELINE ? &timelineSubmitInfo[1] : DE_NULL);
        submitInfo[1].pWaitDstStageMask                                 = &waitDstStageMask;
 
        VK_CHECK(deviceInterface.queueSubmit(queue[0], 1, &submitInfo[0], testContext1.fences[0]));