Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemX11.cpp
| Show All 30 Lines | |||||
| # include "GHOST_DropTargetX11.h" | # include "GHOST_DropTargetX11.h" | ||||
| #endif | #endif | ||||
| #include "GHOST_Debug.h" | #include "GHOST_Debug.h" | ||||
| #include "GHOST_ContextEGL.h" | #include "GHOST_ContextEGL.h" | ||||
| #include "GHOST_ContextGLX.h" | #include "GHOST_ContextGLX.h" | ||||
| #ifdef WITH_VULKAN_BACKEND | |||||
| # include "GHOST_ContextVK.h" | |||||
| #endif | |||||
| #ifdef WITH_XF86KEYSYM | #ifdef WITH_XF86KEYSYM | ||||
| # include <X11/XF86keysym.h> | # include <X11/XF86keysym.h> | ||||
| #endif | #endif | ||||
| #ifdef WITH_X11_XFIXES | #ifdef WITH_X11_XFIXES | ||||
| # include <X11/extensions/Xfixes.h> | # include <X11/extensions/Xfixes.h> | ||||
| /* Workaround for XWayland grab glitch: T53004. */ | /* Workaround for XWayland grab glitch: T53004. */ | ||||
| # define WITH_XWAYLAND_HACK | # define WITH_XWAYLAND_HACK | ||||
| ▲ Show 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSettings) | ||||
| * fall back to 3.0 if needed | * fall back to 3.0 if needed | ||||
| * | * | ||||
| * Final Blender 2.8: | * Final Blender 2.8: | ||||
| * try 4.x core profile | * try 4.x core profile | ||||
| * try 3.3 core profile | * try 3.3 core profile | ||||
| * no fall-backs. */ | * no fall-backs. */ | ||||
| const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0; | const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0; | ||||
| GHOST_Context *context = nullptr; | |||||
| GHOST_Context *context; | #ifdef WITH_VULKAN_BACKEND | ||||
| if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { | |||||
| context = new GHOST_ContextVK( | |||||
| false, GHOST_kVulkanPlatformX11, 0, m_display, NULL, NULL, 1, 0, debug_context); | |||||
| if (!context->initializeDrawingContext()) { | |||||
| delete context; | |||||
| return nullptr; | |||||
| } | |||||
| return context; | |||||
| } | |||||
| #endif | |||||
| #ifdef USE_EGL | #ifdef USE_EGL | ||||
| /* Try to initialize an EGL context. */ | /* Try to initialize an EGL context. */ | ||||
| for (int minor = 5; minor >= 0; --minor) { | for (int minor = 5; minor >= 0; --minor) { | ||||
| context = create_egl_context(this, m_display, debug_context, 4, minor); | context = create_egl_context(this, m_display, debug_context, 4, minor); | ||||
| if (context != nullptr) { | if (context != nullptr) { | ||||
| return context; | return context; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,314 Lines • Show Last 20 Lines | |||||