[client] egl: properly use OpenGL ES

Instead of using the desktop <GL/gl.h>, we properly use the OpenGL ES 3.x
headers. Also, we now use GL_EXT_buffer_storage for MAP_PERSISTENT_BIT_EXT
and MAP_COHERENT_BIT_EXT as the core versions are only available in desktop
OpenGL 4.4. Similarly, we need GL_EXT_texture_format_BGRA8888 for GL_BGRA_EXT
as GL_BGRA is desktop-only.
This commit is contained in:
Quantum
2021-07-18 05:39:28 -04:00
committed by Geoffrey McRae
parent ab31040d5f
commit 7c872d2d9e
8 changed files with 27 additions and 15 deletions

View File

@@ -31,6 +31,7 @@
#include "dynamic/fonts.h"
#include <EGL/egl.h>
#include <GLES3/gl32.h>
#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"))