summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c6
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.h3
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c17
3 files changed, 14 insertions, 12 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index c885353..0a9a69c 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -503,7 +503,7 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver
503 * But this leads to some issues, namely that the list of extensions is 503 * But this leads to some issues, namely that the list of extensions is
504 * different, and MSAA surfaces also work differently. 504 * different, and MSAA surfaces also work differently.
505 */ 505 */
506 if (eng_get_ob(re)->gles3 && (version >= EVAS_GL_GLES_2_X)) 506 if (gles3_supported && (version >= EVAS_GL_GLES_2_X))
507 version = 3; 507 version = 3;
508 508
509 context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; 509 context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
@@ -718,7 +718,7 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc,
718 } 718 }
719 719
720 config_attrs[i++] = EGL_RENDERABLE_TYPE; 720 config_attrs[i++] = EGL_RENDERABLE_TYPE;
721 if (eng_get_ob(re)->gles3) 721 if (gles3_supported)
722 config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR; 722 config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR;
723 else 723 else
724 config_attrs[i++] = EGL_OPENGL_ES2_BIT; 724 config_attrs[i++] = EGL_OPENGL_ES2_BIT;
@@ -2511,7 +2511,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2511 config_attrs[i++] = EGL_STENCIL_SIZE; 2511 config_attrs[i++] = EGL_STENCIL_SIZE;
2512 config_attrs[i++] = 0; 2512 config_attrs[i++] = 0;
2513 config_attrs[i++] = EGL_RENDERABLE_TYPE; 2513 config_attrs[i++] = EGL_RENDERABLE_TYPE;
2514 if (eng_get_ob(re)->gles3) 2514 if (gles3_supported)
2515 config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR; 2515 config_attrs[i++] = EGL_OPENGL_ES3_BIT_KHR;
2516 else 2516 else
2517 config_attrs[i++] = EGL_OPENGL_ES2_BIT; 2517 config_attrs[i++] = EGL_OPENGL_ES2_BIT;
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h
index a37fb6f..29c8a19 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.h
+++ b/src/modules/evas/engines/gl_x11/evas_engine.h
@@ -65,7 +65,6 @@ struct _Outbuf
65 EGLSurface egl_surface; 65 EGLSurface egl_surface;
66 EGLConfig egl_config; 66 EGLConfig egl_config;
67 EGLDisplay egl_disp; 67 EGLDisplay egl_disp;
68 Eina_Bool gles3 : 1;
69#else 68#else
70 GLXContext context; 69 GLXContext context;
71 GLXWindow glxwin; 70 GLXWindow glxwin;
@@ -227,4 +226,6 @@ Eina_Bool __glXMakeContextCurrent(Display *disp, GLXDrawable glxwin,
227 GLXContext context); 226 GLXContext context);
228#endif 227#endif
229 228
229extern Eina_Bool gles3_supported;
230
230#endif 231#endif
diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c
index da38d3e..b9d733e 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -10,10 +10,12 @@ static Eina_TLS _context_key = 0;
10typedef void (*glsym_func_void) (); 10typedef void (*glsym_func_void) ();
11glsym_func_void glsym_evas_gl_common_context_restore_set = NULL; 11glsym_func_void glsym_evas_gl_common_context_restore_set = NULL;
12 12
13Eina_Bool gles3_supported = EINA_FALSE;
14
13#ifdef GL_GLES 15#ifdef GL_GLES
14typedef EGLContext GLContext; 16typedef EGLContext GLContext;
15typedef EGLConfig GLConfig; 17typedef EGLConfig GLConfig;
16static int gles3_supported = -1; 18static Eina_Bool gles3_probed = EINA_FALSE;
17#else 19#else
18// FIXME: this will only work for 1 display connection (glx land can have > 1) 20// FIXME: this will only work for 1 display connection (glx land can have > 1)
19typedef GLXContext GLContext; 21typedef GLXContext GLContext;
@@ -239,7 +241,6 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info,
239 241
240// EGL / GLES 242// EGL / GLES
241#ifdef GL_GLES 243#ifdef GL_GLES
242 gw->gles3 = gles3_supported;
243 gw->egl_disp = _x11_eglGetDisplay(gw->disp); 244 gw->egl_disp = _x11_eglGetDisplay(gw->disp);
244 if (!gw->egl_disp) 245 if (!gw->egl_disp)
245 { 246 {
@@ -277,7 +278,7 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info,
277 278
278try_gles2: 279try_gles2:
279 context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; 280 context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
280 context_attrs[1] = gw->gles3 ? 3 : 2; 281 context_attrs[1] = gles3_supported ? 3 : 2;
281 context_attrs[2] = EGL_NONE; 282 context_attrs[2] = EGL_NONE;
282 283
283 context = _tls_context_get(); 284 context = _tls_context_get();
@@ -286,11 +287,11 @@ try_gles2:
286 if (gw->egl_context == EGL_NO_CONTEXT) 287 if (gw->egl_context == EGL_NO_CONTEXT)
287 { 288 {
288 ERR("eglCreateContext() fail. code=%#x", eglGetError()); 289 ERR("eglCreateContext() fail. code=%#x", eglGetError());
289 if (gw->gles3) 290 if (gles3_supported)
290 { 291 {
291 /* Note: this shouldn't happen */ 292 /* Note: this shouldn't happen */
292 ERR("Trying again with an Open GL ES 2 context (fallback)."); 293 ERR("Trying again with an Open GL ES 2 context (fallback).");
293 gw->gles3 = EINA_FALSE; 294 gles3_supported = EINA_FALSE;
294 goto try_gles2; 295 goto try_gles2;
295 } 296 }
296 eng_window_free(gw); 297 eng_window_free(gw);
@@ -873,9 +874,9 @@ eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
873 } 874 }
874 875
875 /* detect GLES 3.x support */ 876 /* detect GLES 3.x support */
876 if (gles3_supported == -1) 877 if (gles3_probed == EINA_FALSE)
877 { 878 {
878 gles3_supported = EINA_FALSE; 879 gles3_probed = EINA_TRUE;
879 eglexts = eglQueryString(egl_disp, EGL_EXTENSIONS); 880 eglexts = eglQueryString(egl_disp, EGL_EXTENSIONS);
880 if (eglexts && strstr(eglexts, "EGL_KHR_create_context")) 881 if (eglexts && strstr(eglexts, "EGL_KHR_create_context"))
881 { 882 {
@@ -1299,7 +1300,7 @@ eng_gl_context_new(Outbuf *win)
1299 if (!ctx) return NULL; 1300 if (!ctx) return NULL;
1300 1301
1301#if GL_GLES 1302#if GL_GLES
1302 if (win->gles3) 1303 if (gles3_supported)
1303 context_attrs[1] = 3; 1304 context_attrs[1] = 3;
1304 ctx->context = eglCreateContext(win->egl_disp, win->egl_config, 1305 ctx->context = eglCreateContext(win->egl_disp, win->egl_config,
1305 win->egl_context, context_attrs); 1306 win->egl_context, context_attrs);