summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2014-03-08 08:21:45 -0800
committerChad Versace <chad.versace@linux.intel.com>2014-03-12 17:53:36 -0700
commit25fbef8350a5e22fec7aa5176a6ca74ebadf7c62 (patch)
tree4c0dac1414b5f90bf11a2c59b41ebed09404c723
parentf064ab5f658860f273813e1266c956388a1675ab (diff)
egl: Fix creation of compatibility contexts
wegl_context_create() ignored wcore_config_attrs::context_profile and never set EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR. The default value of EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR is EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR. Therefore, for context versions >= 3.2, wegl_context_create() always created a core context. This patch fixes wegl_context_create() to inspect wcore_config_attrs::context_profile and set EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR accordingly. Fixes: https://github.com/waffle-gl/waffle/issues/1 Reported-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--src/waffle/egl/wegl_context.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/waffle/egl/wegl_context.c b/src/waffle/egl/wegl_context.c
index 50b31c6..9ffc4f5 100644
--- a/src/waffle/egl/wegl_context.c
+++ b/src/waffle/egl/wegl_context.c
@@ -94,6 +94,23 @@ create_real_context(struct wegl_config *config,
context_flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
}
+ if (attrs->context_full_version >= 32) {
+ assert(dpy->KHR_create_context);
+ switch (attrs->context_profile) {
+ case WAFFLE_CONTEXT_CORE_PROFILE:
+ attrib_list[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
+ attrib_list[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
+ break;
+ case WAFFLE_CONTEXT_COMPATIBILITY_PROFILE:
+ attrib_list[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
+ attrib_list[i++] = EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;
+ break;
+ default:
+ wcore_error_internal("attrs->context_profile has bad value %#x",
+ attrs->context_profile);
+ return EGL_NO_CONTEXT;
+ }
+ }
break;
case WAFFLE_CONTEXT_OPENGL_ES1: