diff --git a/client/include/egl_dynprocs.h b/client/include/egl_dynprocs.h index 120e3883..c3d90aef 100644 --- a/client/include/egl_dynprocs.h +++ b/client/include/egl_dynprocs.h @@ -23,7 +23,8 @@ #ifdef ENABLE_EGL #include -#include +#include +#include typedef EGLDisplay (*eglGetPlatformDisplayEXT_t)(EGLenum platform, void *native_display, const EGLint *attrib_list); diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index b8498913..d2dd4a7b 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -31,6 +31,7 @@ #include "dynamic/fonts.h" #include +#include #include "cimgui.h" #include "generator/output/cimgui_impl.h" @@ -827,6 +828,18 @@ bool egl_render_startup(void * opaque) 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"); + return false; + } + if (g_egl_dynProcs.glEGLImageTargetTexture2DOES) { if (util_hasGLExt(client_exts, "EGL_EXT_image_dma_buf_import")) diff --git a/client/renderers/EGL/egldebug.c b/client/renderers/EGL/egldebug.c index 107f4536..1744e818 100644 --- a/client/renderers/EGL/egldebug.c +++ b/client/renderers/EGL/egldebug.c @@ -19,7 +19,6 @@ */ #include "egldebug.h" -#include #include const char * egl_getErrorStr(void) diff --git a/client/renderers/EGL/model.h b/client/renderers/EGL/model.h index b4cf19dc..4d20d1c4 100644 --- a/client/renderers/EGL/model.h +++ b/client/renderers/EGL/model.h @@ -24,7 +24,7 @@ #include "shader.h" #include "texture.h" -#include +#include typedef struct EGL_Model EGL_Model; diff --git a/client/renderers/EGL/shader.h b/client/renderers/EGL/shader.h index 0226b70a..4748b25b 100644 --- a/client/renderers/EGL/shader.h +++ b/client/renderers/EGL/shader.h @@ -23,7 +23,7 @@ #include #include -#include +#include typedef struct EGL_Shader EGL_Shader; diff --git a/client/renderers/EGL/splash.c b/client/renderers/EGL/splash.c index 859ebcfc..d3a4a0af 100644 --- a/client/renderers/EGL/splash.c +++ b/client/renderers/EGL/splash.c @@ -26,7 +26,7 @@ #include "shader.h" #include "model.h" -#include +#include #include #include #include diff --git a/client/renderers/EGL/texture.c b/client/renderers/EGL/texture.c index ea426f72..1becc9f5 100644 --- a/client/renderers/EGL/texture.c +++ b/client/renderers/EGL/texture.c @@ -150,8 +150,8 @@ static bool egl_texture_map(EGL_Texture * texture, uint8_t i) GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | - GL_MAP_PERSISTENT_BIT | - GL_MAP_COHERENT_BIT + GL_MAP_PERSISTENT_BIT_EXT | + GL_MAP_COHERENT_BIT_EXT ); if (!texture->buf[i].map) @@ -209,8 +209,8 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_ { case EGL_PF_BGRA: texture->bpp = 4; - texture->format = GL_BGRA; - texture->intFormat = GL_BGRA; + texture->format = GL_BGRA_EXT; + texture->intFormat = GL_BGRA_EXT; texture->dataType = GL_UNSIGNED_BYTE; texture->fourcc = DRM_FORMAT_ARGB8888; texture->pboBufferSize = height * stride; @@ -219,7 +219,7 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_ case EGL_PF_RGBA: texture->bpp = 4; texture->format = GL_RGBA; - texture->intFormat = GL_BGRA; + texture->intFormat = GL_RGBA; texture->dataType = GL_UNSIGNED_BYTE; texture->fourcc = DRM_FORMAT_ABGR8888; texture->pboBufferSize = height * stride; @@ -300,13 +300,13 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_ texture->buf[i].hasPBO = true; glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->buf[i].pbo); - glBufferStorage( + glBufferStorageEXT( GL_PIXEL_UNPACK_BUFFER, texture->pboBufferSize, NULL, - GL_MAP_WRITE_BIT | - GL_MAP_PERSISTENT_BIT | - GL_MAP_COHERENT_BIT + GL_MAP_WRITE_BIT | + GL_MAP_PERSISTENT_BIT_EXT | + GL_MAP_COHERENT_BIT_EXT ); if (!egl_texture_map(texture, i)) diff --git a/client/renderers/EGL/texture.h b/client/renderers/EGL/texture.h index cd2905f9..c9680030 100644 --- a/client/renderers/EGL/texture.h +++ b/client/renderers/EGL/texture.h @@ -24,7 +24,6 @@ #include "shader.h" #include "common/framebuffer.h" -#include #include #include