From adbe333414fb5c92b6f49e809b67cf71f1a2209b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 15 Dec 2021 06:10:30 +1100 Subject: [PATCH] [client] egl: dmabuf can be used without GL_EXT_buffer_storage support --- client/renderers/EGL/desktop.c | 7 +++++++ client/renderers/EGL/egl.c | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/renderers/EGL/desktop.c b/client/renderers/EGL/desktop.c index 3921dffd..5671207d 100644 --- a/client/renderers/EGL/desktop.c +++ b/client/renderers/EGL/desktop.c @@ -326,6 +326,13 @@ bool egl_desktopUpdate(EGL_Desktop * desktop, const FrameBuffer * frame, int dma desktop->useDMA = false; + const char * gl_exts = (const char *)glGetString(GL_EXTENSIONS); + if (!util_hasGLExt(gl_exts, "GL_EXT_buffer_storage")) + { + DEBUG_ERROR("GL_EXT_buffer_storage is needed to use EGL backend"); + return false; + } + egl_textureFree(&desktop->texture); if (!egl_textureInit(&desktop->texture, desktop->display, EGL_TEXTYPE_FRAMEBUFFER, true)) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index 09dc232c..86b726bc 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -798,12 +798,6 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA) glGetIntegerv(GL_MAJOR_VERSION, &esMaj); glGetIntegerv(GL_MINOR_VERSION, &esMin); - if (!util_hasGLExt(gl_exts, "GL_EXT_buffer_storage")) - { - DEBUG_ERROR("GL_EXT_buffer_storage is needed to use EGL backend"); - return false; - } - if (!util_hasGLExt(gl_exts, "GL_EXT_texture_format_BGRA8888")) { DEBUG_ERROR("GL_EXT_texture_format_BGRA8888 is needed to use EGL backend"); @@ -836,7 +830,14 @@ static bool egl_renderStartup(LG_Renderer * renderer, bool useDMA) this->dmaSupport = true; if (!this->dmaSupport) + { useDMA = false; + if (!util_hasGLExt(gl_exts, "GL_EXT_buffer_storage")) + { + DEBUG_ERROR("GL_EXT_buffer_storage is needed to use EGL backend"); + return false; + } + } if (debugContext) {