From 4b5f9d8c96a8f66f9067eea1ebc8051ee3acd5dd Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 3 Jun 2019 19:18:13 -0700 Subject: [PATCH] Add a checker for vkQueuePresent returning VK_SUBOPTIMAL_KHR Components: Vulkan VK-GL-CTS Issue: 1811 Affects: dEQP-VK.wsi.* Affects: dEQP-VK.protected_memory.interaction.wsi.* Change-Id: I81320fb9fee34c6d1ec006d0a66d482eb2f8fb7c --- external/vulkancts/framework/vulkan/vkDefs.cpp | 8 ++++++++ external/vulkancts/framework/vulkan/vkDefs.hpp | 2 ++ .../vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp | 2 +- external/vulkancts/modules/vulkan/wsi/vktWsiColorSpaceTests.cpp | 2 +- .../vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp | 8 ++++---- .../modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp | 8 ++++---- .../modules/vulkan/wsi/vktWsiSharedPresentableImageTests.cpp | 4 ++-- external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp | 4 ++-- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/external/vulkancts/framework/vulkan/vkDefs.cpp b/external/vulkancts/framework/vulkan/vkDefs.cpp index 49d06c5..d8b004e 100644 --- a/external/vulkancts/framework/vulkan/vkDefs.cpp +++ b/external/vulkancts/framework/vulkan/vkDefs.cpp @@ -91,4 +91,12 @@ void checkResult (VkResult result, const char* msg, const char* file, int line) } } +void checkWsiResult (VkResult result, const char* msg, const char* file, int line) +{ + if (result == VK_SUBOPTIMAL_KHR) + return; + + checkResult(result, msg, file, line); +} + } // vk diff --git a/external/vulkancts/framework/vulkan/vkDefs.hpp b/external/vulkancts/framework/vulkan/vkDefs.hpp index 9673bce..dfcdc03 100644 --- a/external/vulkancts/framework/vulkan/vkDefs.hpp +++ b/external/vulkancts/framework/vulkan/vkDefs.hpp @@ -58,6 +58,7 @@ struct NAME { \ #define VK_CHECK(EXPR) vk::checkResult((EXPR), #EXPR, __FILE__, __LINE__) #define VK_CHECK_MSG(EXPR, MSG) vk::checkResult((EXPR), MSG, __FILE__, __LINE__) +#define VK_CHECK_WSI(EXPR) vk::checkWsiResult((EXPR), #EXPR, __FILE__, __LINE__) /*--------------------------------------------------------------------*//*! * \brief Vulkan utilities @@ -239,6 +240,7 @@ private: }; void checkResult (VkResult result, const char* message, const char* file, int line); +void checkWsiResult (VkResult result, const char* message, const char* file, int line); } // vk diff --git a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp index 2b2b82f..d93b7c6 100644 --- a/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp +++ b/external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp @@ -1197,7 +1197,7 @@ tcu::TestStatus basicRenderTest (Context& baseCtx, vk::wsi::Type wsiType) renderer.recordFrame(commandBuffer, imageNdx, frameNdx); VK_CHECK(vkd.queueSubmit(context.getQueue(), 1u, &submitInfo, imageReadyFence)); - VK_CHECK(vkd.queuePresentKHR(context.getQueue(), &presentInfo)); + VK_CHECK_WSI(vkd.queuePresentKHR(context.getQueue(), &presentInfo)); } } diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiColorSpaceTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiColorSpaceTests.cpp index d2f65cc..8a7b25f 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiColorSpaceTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiColorSpaceTests.cpp @@ -950,7 +950,7 @@ tcu::TestStatus surfaceFormatRenderTest (Context& context, renderer.recordFrame(commandBuffer, imageNdx, frameNdx); VK_CHECK(vkd.queueSubmit(devHelper.queue, 1u, &submitInfo, imageReadyFence)); - VK_CHECK(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); + VK_CHECK_WSI(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); } } diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp index f67a818..d5da904 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp @@ -1036,8 +1036,8 @@ void DisplayTimingTestInstance::render (void) &result }; - VK_CHECK(m_vkd.queuePresentKHR(m_queue, &presentInfo)); - VK_CHECK(result); + VK_CHECK_WSI(m_vkd.queuePresentKHR(m_queue, &presentInfo)); + VK_CHECK_WSI(result); } else { @@ -1054,8 +1054,8 @@ void DisplayTimingTestInstance::render (void) &result }; - VK_CHECK(m_vkd.queuePresentKHR(m_queue, &presentInfo)); - VK_CHECK(result); + VK_CHECK_WSI(m_vkd.queuePresentKHR(m_queue, &presentInfo)); + VK_CHECK_WSI(result); } { diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp index d9f77eb..dfbd98b 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp @@ -1027,8 +1027,8 @@ void IncrementalPresentTestInstance::render (void) &result }; - VK_CHECK(m_vkd.queuePresentKHR(m_queue, &presentInfo)); - VK_CHECK(result); + VK_CHECK_WSI(m_vkd.queuePresentKHR(m_queue, &presentInfo)); + VK_CHECK_WSI(result); } else { @@ -1045,8 +1045,8 @@ void IncrementalPresentTestInstance::render (void) &result }; - VK_CHECK(m_vkd.queuePresentKHR(m_queue, &presentInfo)); - VK_CHECK(result); + VK_CHECK_WSI(m_vkd.queuePresentKHR(m_queue, &presentInfo)); + VK_CHECK_WSI(result); } { diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSharedPresentableImageTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSharedPresentableImageTests.cpp index bc7c3de..631cbf0 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSharedPresentableImageTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSharedPresentableImageTests.cpp @@ -965,8 +965,8 @@ void SharedPresentableImageTestInstance::render (void) &result }; - VK_CHECK(m_vkd.queuePresentKHR(m_queue, &presentInfo)); - VK_CHECK(result); + VK_CHECK_WSI(m_vkd.queuePresentKHR(m_queue, &presentInfo)); + VK_CHECK_WSI(result); } diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp index 98fdbae..b9359c9 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp @@ -1280,7 +1280,7 @@ tcu::TestStatus basicRenderTest (Context& context, Type wsiType) renderer.recordFrame(commandBuffer, imageNdx, frameNdx); VK_CHECK(vkd.queueSubmit(devHelper.queue, 1u, &submitInfo, imageReadyFence)); - VK_CHECK(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); + VK_CHECK_WSI(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); } } @@ -1429,7 +1429,7 @@ tcu::TestStatus resizeSwapchainTest (Context& context, Type wsiType) renderer.recordFrame(commandBuffer, imageNdx, frameNdx); VK_CHECK(vkd.queueSubmit(devHelper.queue, 1u, &submitInfo, (VkFence)0)); - VK_CHECK(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); + VK_CHECK_WSI(vkd.queuePresentKHR(devHelper.queue, &presentInfo)); } } -- 2.7.4