Permalink
Browse files

Check for Vulkan Xlib/Wayland surface support before enabling

The Vulkan loader will error if a requested extension is not available,
and the nvidia proprietary driver does not support the Wayland one.
  • Loading branch information...
myfreeweb committed Jan 12, 2018
1 parent d3f8a4d commit 025c382b9bdf91c239a5c04394986b25dad9112f
Showing with 6 additions and 2 deletions.
  1. +6 −2 Common/Vulkan/VulkanContext.cpp
@@ -111,7 +111,9 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
instance_extensions_enabled_.push_back(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
#else
#if defined(VK_USE_PLATFORM_XLIB_KHR)
instance_extensions_enabled_.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
if (IsInstanceExtensionAvailable(VK_KHR_XLIB_SURFACE_EXTENSION_NAME)) {
instance_extensions_enabled_.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
}
#endif
//#if defined(VK_USE_PLATFORM_XCB_KHR)
// instance_extensions_enabled_.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
@@ -120,7 +122,9 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
// instance_extensions_enabled_.push_back(VK_KHR_MIR_SURFACE_EXTENSION_NAME);
//#endif
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
instance_extensions_enabled_.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
if (IsInstanceExtensionAvailable(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME)) {
instance_extensions_enabled_.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
}
#endif
#endif

0 comments on commit 025c382

Please sign in to comment.