From: Marcin KaƄtoch Date: Thu, 14 Jan 2021 18:11:49 +0000 (+0100) Subject: Fixed dEQP-VK.wsi.*.full_screen_exclusive.* tests X-Git-Tag: upstream/1.3.5~320^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9763f6a0c3e4a73c597e07e95c61c4363f4aab9;p=platform%2Fupstream%2FVK-GL-CTS.git Fixed dEQP-VK.wsi.*.full_screen_exclusive.* tests Full list of fixes described in the issue. Components: Vulkan VK-GL-CTS issue: 2746 Affects: dEQP-VK.wsi.*.full_screen_exclusive.* Change-Id: I787fb775a1b3a88c6308d1ab8a7f37d11fa9a049 --- diff --git a/external/vulkancts/framework/vulkan/vkDefs.cpp b/external/vulkancts/framework/vulkan/vkDefs.cpp index d8b004e..2055e10 100644 --- a/external/vulkancts/framework/vulkan/vkDefs.cpp +++ b/external/vulkancts/framework/vulkan/vkDefs.cpp @@ -96,6 +96,9 @@ void checkWsiResult (VkResult result, const char* msg, const char* file, int lin if (result == VK_SUBOPTIMAL_KHR) return; + if (result == VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT) + return; + checkResult(result, msg, file, line); } diff --git a/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp b/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp index 5cf0edf..2743821 100644 --- a/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp +++ b/external/vulkancts/framework/vulkan/vkWsiPlatform.cpp @@ -34,6 +34,10 @@ void Window::setVisible (bool visible) TCU_THROW(InternalError, "setVisible() called on window not supporting it"); } +void Window::setForeground(void) +{ +} + void Window::resize (const tcu::UVec2&) { TCU_THROW(InternalError, "resize() called on window not supporting it"); diff --git a/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp b/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp index f37087b..9759fa9 100644 --- a/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp +++ b/external/vulkancts/framework/vulkan/vkWsiPlatform.hpp @@ -38,6 +38,7 @@ public: virtual ~Window (void) {} virtual void setVisible (bool visible); + virtual void setForeground (void); virtual void resize (const tcu::UVec2& newSize); protected: diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiFullScreenExclusiveTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiFullScreenExclusiveTests.cpp index ab58de1..f0130aa 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiFullScreenExclusiveTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiFullScreenExclusiveTests.cpp @@ -332,22 +332,35 @@ std::vector allocateCommandBuffers (const DeviceInterface& vkd return buffers; } -tcu::TestStatus fullScreenExclusiveTest (Context& context, - TestParams testParams) +tcu::TestStatus fullScreenExclusiveTest(Context& context, + TestParams testParams) { if (!de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_EXT_full_screen_exclusive")) TCU_THROW(NotSupportedError, "Extension VK_EXT_full_screen_exclusive not supported"); - const InstanceHelper instHelper (context, testParams.wsiType); - const NativeObjects native (context, instHelper.supportedExtensions, testParams.wsiType); - const Unique surface (createSurface(instHelper.vki, instHelper.instance, testParams.wsiType, *native.display, *native.window)); - const DeviceHelper devHelper (context, instHelper.vki, instHelper.instance, *surface); - const std::vector deviceExtensions (enumerateDeviceExtensionProperties(instHelper.vki, devHelper.physicalDevice, DE_NULL)); + const InstanceHelper instHelper(context, testParams.wsiType); + const NativeObjects native(context, instHelper.supportedExtensions, testParams.wsiType); + const Unique surface(createSurface(instHelper.vki, instHelper.instance, testParams.wsiType, *native.display, *native.window)); + const DeviceHelper devHelper(context, instHelper.vki, instHelper.instance, *surface); + const std::vector deviceExtensions(enumerateDeviceExtensionProperties(instHelper.vki, devHelper.physicalDevice, DE_NULL)); if (!isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_full_screen_exclusive"))) TCU_THROW(NotSupportedError, "Extension VK_EXT_full_screen_exclusive not supported"); native.window->setVisible(true); + if (testParams.wsiType == TYPE_WIN32) + { + native.window->setForeground(); + } + + // add information about full screen exclusive to VkSwapchainCreateInfoKHR + VkSurfaceFullScreenExclusiveInfoEXT fseInfo = + { + VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, // VkStructureType sType; + DE_NULL, // void* pNext; + testParams.fseType // VkFullScreenExclusiveEXT fullScreenExclusive; + }; + // for Win32 - create structure containing HMONITOR value #if ( DE_OS == DE_OS_WIN32 ) VkSurfaceFullScreenExclusiveWin32InfoEXT fseWin32Info = { @@ -378,10 +391,13 @@ tcu::TestStatus fullScreenExclusiveTest (Context& context, DE_NULL, // const void* pNext; *surface // VkSurfaceKHR surface; }; + + surfaceInfo.pNext = &fseInfo; + #if ( DE_OS == DE_OS_WIN32 ) if (testParams.wsiType == TYPE_WIN32) { - surfaceInfo.pNext = &fseWin32Info; + fseInfo.pNext = &fseWin32Info; } #endif @@ -399,13 +415,6 @@ tcu::TestStatus fullScreenExclusiveTest (Context& context, VkSwapchainCreateInfoKHR swapchainInfo = getBasicSwapchainParameters(testParams.wsiType, instHelper.vki, devHelper.physicalDevice, *surface, surfaceFormats[0], native.windowSize, 2); - // add information about full screen exclusive to VkSwapchainCreateInfoKHR - VkSurfaceFullScreenExclusiveInfoEXT fseInfo = - { - VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, // VkStructureType sType; - DE_NULL, // void* pNext; - testParams.fseType // VkFullScreenExclusiveEXT fullScreenExclusive; - }; swapchainInfo.pNext = &fseInfo; #if ( DE_OS == DE_OS_WIN32 ) @@ -471,14 +480,11 @@ tcu::TestStatus fullScreenExclusiveTest (Context& context, } case VK_ERROR_INITIALIZATION_FAILED: { - if (frameNdx > 3) - throw tcu::TestError("vkAcquireFullScreenExclusiveModeEXT was not able to succeed in first 3 draw frames"); break; } case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT: { context.getTestContext().getLog() << tcu::TestLog::Message << "Got VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT at vkAcquireFullScreenExclusiveModeEXT. Frame " << frameNdx << tcu::TestLog::EndMessage; - VK_CHECK(acquireResult); break; } default: @@ -503,7 +509,7 @@ tcu::TestStatus fullScreenExclusiveTest (Context& context, &imageNdx); if (acquireResult == VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT) context.getTestContext().getLog() << tcu::TestLog::Message << "Got VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT at vkAcquireNextImageKHR" << tcu::TestLog::EndMessage; - VK_CHECK(acquireResult); + VK_CHECK_WSI(acquireResult); } TCU_CHECK((size_t)imageNdx < swapchainImages.size()); @@ -559,12 +565,19 @@ tcu::TestStatus fullScreenExclusiveTest (Context& context, const VkResult releaseResult = vkd.releaseFullScreenExclusiveModeEXT(device, *swapchain); if (releaseResult == VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT) context.getTestContext().getLog() << tcu::TestLog::Message << "Got VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT at vkReleaseFullScreenExclusiveModeEXT" << tcu::TestLog::EndMessage; - VK_CHECK(releaseResult); + VK_CHECK_WSI(releaseResult); } native.window->setVisible(false); - return tcu::TestStatus::pass("Rendering tests succeeded"); + if (fullScreenAcquired) + { + return tcu::TestStatus::pass("Rendering tests succeeded"); + } + else + { + return tcu::TestStatus(QP_TEST_RESULT_QUALITY_WARNING, "Failed to acquire full screen exclusive, but did not end with an error."); + } } void getBasicRenderPrograms (SourceCollections& dst, TestParams) diff --git a/framework/platform/win32/tcuWin32VulkanPlatform.cpp b/framework/platform/win32/tcuWin32VulkanPlatform.cpp index 7edefb5..cf31dda 100644 --- a/framework/platform/win32/tcuWin32VulkanPlatform.cpp +++ b/framework/platform/win32/tcuWin32VulkanPlatform.cpp @@ -60,6 +60,11 @@ public: m_window->setVisible(visible); } + void setForeground(void) + { + m_window->setForeground(); + } + void resize (const UVec2& newSize) { m_window->setSize((int)newSize.x(), (int)newSize.y()); diff --git a/framework/platform/win32/tcuWin32Window.cpp b/framework/platform/win32/tcuWin32Window.cpp index ab9401f..b2f83ff 100644 --- a/framework/platform/win32/tcuWin32Window.cpp +++ b/framework/platform/win32/tcuWin32Window.cpp @@ -101,6 +101,11 @@ void Window::setVisible (bool visible) ShowWindow(m_window, visible ? SW_SHOW : SW_HIDE); } +void Window::setForeground(void) +{ + SetForegroundWindow(m_window); +} + void Window::setSize (int width, int height) { RECT rc; diff --git a/framework/platform/win32/tcuWin32Window.hpp b/framework/platform/win32/tcuWin32Window.hpp index 93a90fe..be4a939 100644 --- a/framework/platform/win32/tcuWin32Window.hpp +++ b/framework/platform/win32/tcuWin32Window.hpp @@ -39,6 +39,7 @@ public: ~Window (void); void setVisible (bool visible); + void setForeground (void); void setSize (int width, int height); LRESULT windowProc (UINT uMsg, WPARAM wParam, LPARAM lParam);