Skip to content

Commit

Permalink
hello_xr: On Vulkan, explicitly add surface extensions for mirror win…
Browse files Browse the repository at this point in the history
…dow.

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.
  • Loading branch information
aeikum committed Nov 27, 2020
1 parent eedc7df commit 3027751
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/sdk/pr.230.gh.OpenXR-SDK-Source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello_xr: On Vulkan, explicitly add surface extensions for mirror window.
9 changes: 9 additions & 0 deletions src/tests/hello_xr/graphicsplugin_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,15 @@ struct VulkanGraphicsPlugin : public IGraphicsPlugin {
std::vector<const char*> 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;
Expand Down

0 comments on commit 3027751

Please sign in to comment.