From 30277513fd5db0fce47c699edbf1261f3d485d3e Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 27 Nov 2020 13:53:15 -0600 Subject: [PATCH] hello_xr: On Vulkan, explicitly add surface extensions for mirror window. Some OpenXR providers may return these extensions from xrGetVulkanInstanceExtensionsKHR, but they don't have to. Since they are required for hello_xr to call vkCreateWin32SurfaceKHR, we should include them explicitly. --- changes/sdk/pr.230.gh.OpenXR-SDK-Source.md | 1 + src/tests/hello_xr/graphicsplugin_vulkan.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 changes/sdk/pr.230.gh.OpenXR-SDK-Source.md diff --git a/changes/sdk/pr.230.gh.OpenXR-SDK-Source.md b/changes/sdk/pr.230.gh.OpenXR-SDK-Source.md new file mode 100644 index 000000000..d31688252 --- /dev/null +++ b/changes/sdk/pr.230.gh.OpenXR-SDK-Source.md @@ -0,0 +1 @@ +hello_xr: On Vulkan, explicitly add surface extensions for mirror window. diff --git a/src/tests/hello_xr/graphicsplugin_vulkan.cpp b/src/tests/hello_xr/graphicsplugin_vulkan.cpp index 506207312..baa2d32d2 100644 --- a/src/tests/hello_xr/graphicsplugin_vulkan.cpp +++ b/src/tests/hello_xr/graphicsplugin_vulkan.cpp @@ -1325,6 +1325,15 @@ struct VulkanGraphicsPlugin : public IGraphicsPlugin { std::vector extensions; extensions.push_back("VK_EXT_debug_report"); +#if defined(USE_MIRROR_WINDOW) +#if defined(VK_USE_PLATFORM_WIN32_KHR) + extensions.push_back("VK_KHR_surface"); + extensions.push_back("VK_KHR_win32_surface"); +#else +#error CreateSurface not supported on this OS +#endif // defined(VK_USE_PLATFORM_WIN32_KHR) +#endif // defined(USE_MIRROR_WINDOW) + VkApplicationInfo appInfo{VK_STRUCTURE_TYPE_APPLICATION_INFO}; appInfo.pApplicationName = "hello_xr"; appInfo.applicationVersion = 1;