mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
Improved wayland support
This commit is contained in:
parent
0be1c41e63
commit
f6b5511546
@ -27,6 +27,10 @@ if(UNIX AND NOT APPLE)
|
||||
if(X11_FOUND)
|
||||
add_definitions(-DHAVE_X11)
|
||||
endif()
|
||||
find_package(Wayland)
|
||||
if(WAYLAND_FOUND)
|
||||
add_definitions(-DHAVE_WAYLAND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Qt
|
||||
|
@ -328,7 +328,7 @@ namespace vk
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#ifdef HAVE_WAYLAND
|
||||
if constexpr (std::is_same_v<T, std::pair<wl_display*, wl_surface*>>)
|
||||
{
|
||||
VkWaylandSurfaceCreateInfoKHR createInfo = {};
|
||||
|
@ -35,7 +35,7 @@
|
||||
#elif defined(__APPLE__)
|
||||
//nothing
|
||||
#else
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include <QGuiApplication>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#endif
|
||||
@ -712,7 +712,7 @@ display_handle_t gs_frame::handle() const
|
||||
#elif defined(__APPLE__)
|
||||
return reinterpret_cast<void*>(this->winId()); //NSView
|
||||
#else
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#ifdef HAVE_WAYLAND
|
||||
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
|
||||
struct wl_display *wl_dpy = static_cast<struct wl_display *>(
|
||||
native->nativeResourceForWindow("display", NULL));
|
||||
@ -723,16 +723,14 @@ display_handle_t gs_frame::handle() const
|
||||
return std::make_pair(wl_dpy, wl_surf);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
#ifdef HAVE_X11
|
||||
{
|
||||
return std::make_pair(XOpenDisplay(0), static_cast<ulong>(this->winId()));
|
||||
}
|
||||
#else
|
||||
fmt::throw_exception("Vulkan X11 support disabled at compile-time.");
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user