diff --git a/MobileGL/ConfigLoader.cpp b/MobileGL/ConfigLoader.cpp index d02abdfd..2bf4c92e 100644 --- a/MobileGL/ConfigLoader.cpp +++ b/MobileGL/ConfigLoader.cpp @@ -6,6 +6,9 @@ // SPDX-License-Identifier: LGPL-3.0-only // End of Source File Header +#if defined(__ANDROID__) +#include +#endif #include "Config.h" #if MOBILEGL_PIPE_PUSH // For kMGPipeSubsystemsMigratedAtP5e, the push build's PipePush default (the P2, P3a and P4a @@ -302,6 +305,17 @@ namespace MobileGL::MG_ConfigLoader { inline void InitBackendType() { String backendTypeStr; QueryEnvVariable("MOBILEGL_BACKEND_TYPE", backendTypeStr, "DirectGLES"); +#if defined(__ANDROID__) + // An Android app that hosts the library sets the environment itself, before the library + // loads; the debug property is how a developer picks the backend for such a process + // without rebuilding it (`adb shell setprop debug.mobilegl.backend DirectVulkan`). + char property[PROP_VALUE_MAX] = {}; + if (__system_property_get("debug.mobilegl.backend", property) > 0) { + MGLOG_I("Config: debug.mobilegl.backend=%s overrides MOBILEGL_BACKEND_TYPE=%s", property, + backendTypeStr.c_str()); + backendTypeStr = property; + } +#endif #define ENTRY(backendType) \ if (backendTypeStr == #backendType) { \ MG_Config::ActiveBackendType = BackendType::backendType; \ diff --git a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp index f38eb944..8500fe74 100644 --- a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp @@ -565,6 +565,12 @@ namespace MobileGL::MG_Backend::DirectVulkan { V_OpenGL30, V_OpenGL31, V_OpenGL32, V_OpenGL33, V_OpenGL40, V_OpenGL41, V_OpenGL42, V_OpenGL43, V_OpenGL44, V_OpenGL45, V_OpenGL46, E_GL_ARB_draw_buffers_blend, + // The GLSL 1.00/1.10-era ARB trio plus NPOT textures: all core since GL 2.0 and + // trivially true for every context this backend claims (4.6). KWin 6's + // EglContext::checkSupported() gates desktop-GL compositing on exactly these four + // strings, so withholding them fails its renderer bring-up. Same block as DirectGLES. + E_GL_ARB_shader_objects, E_GL_ARB_vertex_shader, E_GL_ARB_fragment_shader, + E_GL_ARB_texture_non_power_of_two, E_GL_ARB_compute_shader, E_GL_ARB_shader_storage_buffer_object, E_GL_ARB_shader_image_load_store, E_GL_ARB_clear_buffer_object, E_GL_ARB_program_interface_query, E_GL_ARB_framebuffer_object, E_GL_ARB_draw_indirect, E_GL_ARB_multi_draw_indirect,