GOOGLE_display_timing: Trigger the fence off vkQueueSubmit
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / wsi / vktWsiDisplayTimingTests.cpp
index 8c2c405..53a0450 100644 (file)
@@ -486,7 +486,7 @@ vk::Move<vk::VkRenderPass> createRenderPass (const vk::DeviceInterface&     vkd,
                        vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,
                        vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,
 
-                       vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+                       vk::VK_IMAGE_LAYOUT_UNDEFINED,
                        vk::VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
                }
        };
@@ -1095,7 +1095,7 @@ void DisplayTimingTestInstance::render (void)
        deUint32                        imageIndex;
 
        // Acquire next image
-       VK_CHECK(m_vkd.acquireNextImageKHR(*m_device, *m_swapchain, foreverNs, currentAcquireSemaphore, fence, &imageIndex));
+       VK_CHECK(m_vkd.acquireNextImageKHR(*m_device, *m_swapchain, foreverNs, currentAcquireSemaphore, (vk::VkFence)0, &imageIndex));
 
        // Create command buffer
        m_commandBuffers[m_frameNdx % m_commandBuffers.size()] = createCommandBuffer(m_vkd, *m_device, *m_commandPool, *m_pipelineLayout, *m_renderPass, m_framebuffers[imageIndex], *m_pipeline, m_frameNdx, m_quadCount, width, height).disown();
@@ -1208,7 +1208,7 @@ void DisplayTimingTestInstance::render (void)
                        &currentRenderSemaphore
                };
 
-               VK_CHECK(m_vkd.queueSubmit(m_queue, 1u, &submitInfo, (vk::VkFence)0));
+               VK_CHECK(m_vkd.queueSubmit(m_queue, 1u, &submitInfo, fence));
        }
 
        // Present frame
@@ -1247,7 +1247,7 @@ void DisplayTimingTestInstance::render (void)
                else
                {
                        desiredPresentTime = m_prevDesiredPresentTime + m_targetIPD;
-                       if (presentTime.presentID == 80)
+                       if ((presentTime.presentID == 80) && (m_swapchainConfig.presentMode != vk::VK_PRESENT_MODE_MAILBOX_KHR))
                        {
                                // Test if desiredPresentTime is 1 second earlier (i.e. before the previous image could have been presented)
                                presentTime.desiredPresentTime -= SECOND;