mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Merge 6459731b8a
into 2afd7707fe
This commit is contained in:
commit
c6dd6e92bf
3 changed files with 17 additions and 21 deletions
|
@ -443,7 +443,8 @@ VKGSRender::VKGSRender(utils::serial* ar) noexcept : GSRender(ar)
|
||||||
using T = std::decay_t<decltype(p)>;
|
using T = std::decay_t<decltype(p)>;
|
||||||
if constexpr (std::is_same_v<T, std::pair<Display*, Window>>)
|
if constexpr (std::is_same_v<T, std::pair<Display*, Window>>)
|
||||||
{
|
{
|
||||||
m_display_handle = p.first; XFlush(m_display_handle);
|
m_display_handle = p.first;
|
||||||
|
XFlush(m_display_handle);
|
||||||
}
|
}
|
||||||
}, display);
|
}, display);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,14 +22,16 @@ using display_handle_t = void*; // NSView
|
||||||
#else
|
#else
|
||||||
#include <variant>
|
#include <variant>
|
||||||
using display_handle_t = std::variant<
|
using display_handle_t = std::variant<
|
||||||
#if defined(HAVE_X11) && defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
#if defined(HAVE_X11)
|
||||||
|
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
std::pair<Display*, Window>, std::pair<wl_display*, wl_surface*>
|
std::pair<Display*, Window>, std::pair<wl_display*, wl_surface*>
|
||||||
#elif defined(HAVE_X11)
|
#else
|
||||||
std::pair<Display*, Window>
|
std::pair<Display*, Window>
|
||||||
|
#endif
|
||||||
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
|
||||||
std::pair<wl_display*, wl_surface*>
|
std::pair<wl_display*, wl_surface*>
|
||||||
#elif defined(ANDROID)
|
#elif defined(ANDROID)
|
||||||
struct ANativeWindow *
|
struct ANativeWindow*
|
||||||
#endif
|
#endif
|
||||||
>;
|
>;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
//nothing
|
//nothing
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -665,29 +665,22 @@ void gs_frame::show()
|
||||||
|
|
||||||
display_handle_t gs_frame::handle() const
|
display_handle_t gs_frame::handle() const
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__APPLE__)
|
||||||
return reinterpret_cast<HWND>(this->winId());
|
return reinterpret_cast<display_handle_t>(this->winId());
|
||||||
#elif defined(__APPLE__)
|
|
||||||
return reinterpret_cast<void*>(this->winId()); //NSView
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||||
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
|
QPlatformNativeInterface* native = QGuiApplication::platformNativeInterface();
|
||||||
struct wl_display *wl_dpy = static_cast<struct wl_display *>(
|
struct wl_display* wl_dpy = static_cast<struct wl_display*>(native->nativeResourceForWindow("display", nullptr));
|
||||||
native->nativeResourceForWindow("display", NULL));
|
struct wl_surface* wl_surf = static_cast<struct wl_surface*>(native->nativeResourceForWindow("surface", const_cast<QWindow*>(static_cast<const QWindow*>(this))));
|
||||||
struct wl_surface *wl_surf = static_cast<struct wl_surface *>(
|
if (wl_dpy && wl_surf)
|
||||||
native->nativeResourceForWindow("surface", const_cast<QWindow*>(static_cast<const QWindow*>(this))));
|
|
||||||
if (wl_dpy != nullptr && wl_surf != nullptr)
|
|
||||||
{
|
{
|
||||||
return std::make_pair(wl_dpy, wl_surf);
|
return std::make_pair(wl_dpy, wl_surf);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
{
|
return std::make_pair(XOpenDisplay(0), static_cast<ulong>(this->winId()));
|
||||||
return std::make_pair(XOpenDisplay(0), static_cast<ulong>(this->winId()));
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
fmt::throw_exception("Vulkan X11 support disabled at compile-time.");
|
fmt::throw_exception("Vulkan X11 support disabled at compile-time.");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue