* But this leads to some issues, namely that the list of extensions is
* different, and MSAA surfaces also work differently.
*/
- if (eng_get_ob(re)->gles3 && (version >= EVAS_GL_GLES_2_X))
+ if (gles3_supported && (version >= EVAS_GL_GLES_2_X))
version = 3;
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
}
config_attrs[i++] = EGL_RENDERABLE_TYPE;
- if (eng_get_ob(re)->gles3)
+ if (gles3_supported)
config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR;
else
config_attrs[i++] = EGL_OPENGL_ES2_BIT;
config_attrs[i++] = EGL_STENCIL_SIZE;
config_attrs[i++] = 0;
config_attrs[i++] = EGL_RENDERABLE_TYPE;
- if (eng_get_ob(re)->gles3)
+ if (gles3_supported)
config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR;
else
config_attrs[i++] = EGL_OPENGL_ES2_BIT;
typedef void (*glsym_func_void) ();
glsym_func_void glsym_evas_gl_common_context_restore_set = NULL;
+Eina_Bool gles3_supported = EINA_FALSE;
+
#ifdef GL_GLES
typedef EGLContext GLContext;
typedef EGLConfig GLConfig;
-static int gles3_supported = -1;
+static Eina_Bool gles3_probed = EINA_FALSE;
#else
// FIXME: this will only work for 1 display connection (glx land can have > 1)
typedef GLXContext GLContext;
// EGL / GLES
#ifdef GL_GLES
- gw->gles3 = gles3_supported;
gw->egl_disp = _x11_eglGetDisplay(gw->disp);
if (!gw->egl_disp)
{
try_gles2:
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
- context_attrs[1] = gw->gles3 ? 3 : 2;
+ context_attrs[1] = gles3_supported ? 3 : 2;
context_attrs[2] = EGL_NONE;
context = _tls_context_get();
if (gw->egl_context == EGL_NO_CONTEXT)
{
ERR("eglCreateContext() fail. code=%#x", eglGetError());
- if (gw->gles3)
+ if (gles3_supported)
{
/* Note: this shouldn't happen */
ERR("Trying again with an Open GL ES 2 context (fallback).");
- gw->gles3 = EINA_FALSE;
+ gles3_supported = EINA_FALSE;
goto try_gles2;
}
eng_window_free(gw);
}
/* detect GLES 3.x support */
- if (gles3_supported == -1)
+ if (gles3_probed == EINA_FALSE)
{
- gles3_supported = EINA_FALSE;
+ gles3_probed = EINA_TRUE;
eglexts = eglQueryString(egl_disp, EGL_EXTENSIONS);
if (eglexts && strstr(eglexts, "EGL_KHR_create_context"))
{
if (!ctx) return NULL;
#if GL_GLES
- if (win->gles3)
+ if (gles3_supported)
context_attrs[1] = 3;
ctx->context = eglCreateContext(win->egl_disp, win->egl_config,
win->egl_context, context_attrs);