vk_platform: Fix wayland build
This commit is contained in:
@ -11,12 +11,9 @@
|
|||||||
#define VK_USE_PLATFORM_MACOS_MVK
|
#define VK_USE_PLATFORM_MACOS_MVK
|
||||||
#define VK_USE_PLATFORM_METAL_EXT
|
#define VK_USE_PLATFORM_METAL_EXT
|
||||||
#else
|
#else
|
||||||
#ifdef WAYLAND_DISPLAY
|
|
||||||
#define VK_USE_PLATFORM_WAYLAND_KHR
|
#define VK_USE_PLATFORM_WAYLAND_KHR
|
||||||
#else // wayland
|
|
||||||
#define VK_USE_PLATFORM_XLIB_KHR
|
#define VK_USE_PLATFORM_XLIB_KHR
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#define VULKAN_HPP_NO_CONSTRUCTORS
|
#define VULKAN_HPP_NO_CONSTRUCTORS
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
@ -45,7 +42,7 @@ vk::SurfaceKHR CreateSurface(vk::Instance instance, const Frontend::EmuWindow& e
|
|||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
|
#elif defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
if (window_info.type == Frontend::WindowSystemType::X11) {
|
if (window_info.type == Frontend::WindowSystemType::X11) {
|
||||||
const vk::XlibSurfaceCreateInfoKHR xlib_ci = {
|
const vk::XlibSurfaceCreateInfoKHR xlib_ci = {
|
||||||
.dpy = static_cast<Display*>(window_info.display_connection),
|
.dpy = static_cast<Display*>(window_info.display_connection),
|
||||||
@ -58,11 +55,12 @@ vk::SurfaceKHR CreateSurface(vk::Instance instance, const Frontend::EmuWindow& e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
|
||||||
if (window_info.type == Frontend::WindowSystemType::Wayland) {
|
if (window_info.type == Frontend::WindowSystemType::Wayland) {
|
||||||
const vk::WaylandSurfaceCreateInfoKHR wayland_ci{{},
|
const vk::WaylandSurfaceCreateInfoKHR wayland_ci = {
|
||||||
static_cast<wl_display*>(window_info.display_connection),
|
.display = static_cast<wl_display*>(window_info.display_connection),
|
||||||
static_cast<wl_surface*>(window_info.render_surface)};
|
.surface = static_cast<wl_surface*>(window_info.render_surface)
|
||||||
|
};
|
||||||
|
|
||||||
if (instance.createWaylandSurfaceKHR(&wayland_ci, nullptr, &surface) != vk::Result::eSuccess) {
|
if (instance.createWaylandSurfaceKHR(&wayland_ci, nullptr, &surface) != vk::Result::eSuccess) {
|
||||||
LOG_ERROR(Render_Vulkan, "Failed to initialize Wayland surface");
|
LOG_ERROR(Render_Vulkan, "Failed to initialize Wayland surface");
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
@ -95,11 +93,10 @@ std::vector<const char*> GetInstanceExtensions(Frontend::WindowSystemType window
|
|||||||
case Frontend::WindowSystemType::Windows:
|
case Frontend::WindowSystemType::Windows:
|
||||||
extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
|
extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
|
||||||
break;
|
break;
|
||||||
#elif defined(VK_USE_PLATFORM_XLIB_KHR)
|
#elif defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
case Frontend::WindowSystemType::X11:
|
case Frontend::WindowSystemType::X11:
|
||||||
extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
|
extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
|
||||||
break;
|
break;
|
||||||
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
|
||||||
case Frontend::WindowSystemType::Wayland:
|
case Frontend::WindowSystemType::Wayland:
|
||||||
extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
|
extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user