diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-11-08 16:29:25 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-11-08 16:29:25 +0300 |
commit | 31ecc302837236c22a95286c480155c0ef7e9424 (patch) | |
tree | 2d987888650d31963663a81d5e2d0a51c124c57f | |
parent | d64d78917406c467656f697d115e9b171802fcc5 (diff) |
Added support for Linux. Thanks to Qiang Yu for the patch!
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWayland.cpp | 16 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 4 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWayland.cpp | 7 |
3 files changed, 22 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 770291d6ce6..3255d667e41 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -20,6 +20,10 @@ #include "GHOST_ContextEGL.h" +#ifdef WITH_VULKAN_BACKEND +# include "GHOST_ContextVK.h" +#endif + #ifdef WITH_INPUT_NDOF # include "GHOST_NDOFManagerUnix.h" #endif @@ -5581,12 +5585,18 @@ static GHOST_Context *createOffscreenContext_impl(GHOST_SystemWayland *system, GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings glSettings) { + /* Create new off-screen window. */ + wl_surface *wl_surface = wl_compositor_create_surface(wl_compositor()); + #ifdef WITH_VULKAN_BACKEND const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0; if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { - GHOST_Context *context = new GHOST_ContextVK( - false, GHOST_kVulkanPlatformWayland, 0, NULL, NULL, d->display, 1, 0, debug_context); + GHOST_Context *context = new GHOST_ContextVK(false, + GHOST_kVulkanPlatformWayland, + 0, NULL, + wl_surface, display_->wl_display, + 1, 0, debug_context); if (!context->initializeDrawingContext()) { delete context; @@ -5598,8 +5608,6 @@ GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings glS (void)glSettings; #endif - /* Create new off-screen window. */ - wl_surface *wl_surface = wl_compositor_create_surface(wl_compositor()); wl_egl_window *egl_window = wl_surface ? wl_egl_window_create(wl_surface, 1, 1) : nullptr; GHOST_Context *context = createOffscreenContext_impl(this, display_->wl_display, egl_window); diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 769e1b83476..4baa3ff598f 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -36,6 +36,10 @@ #include "GHOST_ContextEGL.h" #include "GHOST_ContextGLX.h" +#ifdef WITH_VULKAN_BACKEND +# include "GHOST_ContextVK.h" +#endif + #ifdef WITH_XF86KEYSYM # include <X11/XF86keysym.h> #endif diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp index c58aca3d72d..f3cea98a065 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cpp +++ b/intern/ghost/intern/GHOST_WindowWayland.cpp @@ -920,7 +920,12 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType #ifdef WITH_VULKAN_BACKEND case GHOST_kDrawingContextTypeVulkan: - context = new GHOST_ContextVK(m_wantStereoVisual, m_metalLayer, 1, 0, true); + context = new GHOST_ContextVK(m_wantStereoVisual, + GHOST_kVulkanPlatformWayland, + 0, NULL, + window_->wl_surface, + system_->wl_display(), + 1, 0, true); break; #endif |