mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-27 18:15:42 -04:00
Vulkan: Support Wayland
This commit is contained in:
parent
f022bdb328
commit
a0a78087fe
@ -30,3 +30,6 @@ if(USE_X11)
|
|||||||
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_X11=1")
|
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_X11=1")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_WAYLAND)
|
||||||
|
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_WAYLAND=1")
|
||||||
|
endif()
|
||||||
|
@ -50,6 +50,10 @@ VULKAN_INSTANCE_ENTRY_POINT(vkCreateXlibSurfaceKHR, false)
|
|||||||
VULKAN_INSTANCE_ENTRY_POINT(vkGetPhysicalDeviceXlibPresentationSupportKHR, false)
|
VULKAN_INSTANCE_ENTRY_POINT(vkGetPhysicalDeviceXlibPresentationSupportKHR, false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
|
VULKAN_INSTANCE_ENTRY_POINT(vkCreateWaylandSurfaceKHR, false)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
||||||
VULKAN_INSTANCE_ENTRY_POINT(vkCreateAndroidSurfaceKHR, false)
|
VULKAN_INSTANCE_ENTRY_POINT(vkCreateAndroidSurfaceKHR, false)
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#define VK_USE_PLATFORM_XLIB_KHR
|
#define VK_USE_PLATFORM_XLIB_KHR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(VULKAN_USE_WAYLAND)
|
||||||
|
#define VK_USE_PLATFORM_WAYLAND_KHR
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
#define VK_USE_PLATFORM_ANDROID_KHR
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
||||||
#endif
|
#endif
|
||||||
|
@ -186,19 +186,24 @@ bool Context::SelectInstanceExtensions(ExtensionList* extension_list, bool enabl
|
|||||||
#if defined(VK_USE_PLATFORM_WIN32_KHR)
|
#if defined(VK_USE_PLATFORM_WIN32_KHR)
|
||||||
if (enable_surface && !SupportsExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, true))
|
if (enable_surface && !SupportsExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
|
#endif
|
||||||
|
#if defined(VK_USE_PLATFORM_XLIB_KHR)
|
||||||
if (enable_surface && !SupportsExtension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, true))
|
if (enable_surface && !SupportsExtension(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#elif defined(VK_USE_PLATFORM_XCB_KHR)
|
#endif
|
||||||
if (enable_surface && !SupportsExtension(VK_KHR_XCB_SURFACE_EXTENSION_NAME, true))
|
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
|
if (enable_surface && !SupportsExtension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
|
#endif
|
||||||
|
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
||||||
if (enable_surface && !SupportsExtension(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, true))
|
if (enable_surface && !SupportsExtension(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#elif defined(VK_USE_PLATFORM_MACOS_MVK)
|
#endif
|
||||||
|
#if defined(VK_USE_PLATFORM_MACOS_MVK)
|
||||||
if (enable_surface && !SupportsExtension(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, true))
|
if (enable_surface && !SupportsExtension(VK_MVK_MACOS_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#elif defined(VK_USE_PLATFORM_METAL_EXT)
|
#endif
|
||||||
|
#if defined(VK_USE_PLATFORM_METAL_EXT)
|
||||||
if (enable_surface && !SupportsExtension(VK_EXT_METAL_SURFACE_EXTENSION_NAME, true))
|
if (enable_surface && !SupportsExtension(VK_EXT_METAL_SURFACE_EXTENSION_NAME, true))
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -135,6 +135,25 @@ VkSurfaceKHR SwapChain::CreateVulkanSurface(VkInstance instance, WindowInfo& wi)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
|
if (wi.type == WindowInfo::Type::Wayland)
|
||||||
|
{
|
||||||
|
VkWaylandSurfaceCreateInfoKHR surface_create_info = {VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, nullptr, 0,
|
||||||
|
static_cast<struct wl_display*>(wi.display_connection),
|
||||||
|
static_cast<struct wl_surface*>(wi.window_handle)};
|
||||||
|
|
||||||
|
VkSurfaceKHR surface;
|
||||||
|
VkResult res = vkCreateWaylandSurfaceKHR(instance, &surface_create_info, nullptr, &surface);
|
||||||
|
if (res != VK_SUCCESS)
|
||||||
|
{
|
||||||
|
LOG_VULKAN_ERROR(res, "vkCreateWaylandSurfaceEXT failed: ");
|
||||||
|
return VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return surface;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
|
||||||
if (wi.type == WindowInfo::Type::Android)
|
if (wi.type == WindowInfo::Type::Android)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user