[waffle] [PATCH] egl: Improve support for robust GLES contexts on EGL 1.5

Chad Versace chad.versace at intel.com
Mon May 2 20:16:43 UTC 2016


Allow the creation of robust GLES contexts when EGL 1.5 is available,
even when EGL_EXT_create_context_robustness is not.

Cc: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Cc: Emil Velikov <emil.l.velikov at gmail.com>
Signed-off-by: Chad Versace <chad.versace at intel.com>
---
 src/waffle/egl/wegl_context.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/waffle/egl/wegl_context.c b/src/waffle/egl/wegl_context.c
index d88ce9e..0e59231 100644
--- a/src/waffle/egl/wegl_context.c
+++ b/src/waffle/egl/wegl_context.c
@@ -142,8 +142,14 @@ create_real_context(struct wegl_config *config,
             }
 
             if (attrs->context_robust) {
-                attrib_list[i++] = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT;
-                attrib_list[i++] = EGL_TRUE;
+                // The EGL 1.5 token and the EXT token have different values.
+                if (dpy->major_version > 1 || dpy->minor_version >= 5) {
+                    attrib_list[i++] = EGL_CONTEXT_OPENGL_ROBUST_ACCESS;
+                    attrib_list[i++] = EGL_TRUE;
+                } else {
+                    attrib_list[i++] = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT;
+                    attrib_list[i++] = EGL_TRUE;
+                }
             }
             break;
 
-- 
2.8.1



More information about the waffle mailing list