diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-11-12 16:07:15 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-11-12 16:10:17 -0800 |
commit | 30fc9a65fb5c4e8349da7c4157d29812901750a4 (patch) | |
tree | b2a29203dc78743087966a021c5c137810d545c9 | |
parent | d2a99d9db60eb0218aa684cddc6c15aac299ccc1 (diff) |
egl,glx: Remove redundant profile check done by core
When requesting version >= 3.2 of OpenGL, the core module verifies that
the requested profile attribute is valid.
This patch removes the redundant re-validation in the glx and egl modules
with an assertion.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | src/waffle/egl/wegl_config.c | 9 | ||||
-rw-r--r-- | src/waffle/glx/glx_config.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/waffle/egl/wegl_config.c b/src/waffle/egl/wegl_config.c index 22e49d6..0e3ad77 100644 --- a/src/waffle/egl/wegl_config.c +++ b/src/waffle/egl/wegl_config.c @@ -49,11 +49,10 @@ check_context_attrs(struct wegl_display *dpy, "value 1.0"); return false; } - else if (attrs->context_full_version >= 32 && attrs->context_profile == WAFFLE_NONE) { - wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE, - "WAFFLE_CONTEXT_PROFILE must be provided when " - "the requested context version is >= 3.2"); - return false; + + if (attrs->context_full_version >= 32) { + assert(attrs->context_profile == WAFFLE_CONTEXT_CORE_PROFILE || + attrs->context_profile == WAFFLE_CONTEXT_COMPATIBILITY_PROFILE); } if (!plat->vtbl->dl_can_open(plat, WAFFLE_DL_OPENGL)) { diff --git a/src/waffle/glx/glx_config.c b/src/waffle/glx/glx_config.c index a5608b1..8b9e0c2 100644 --- a/src/waffle/glx/glx_config.c +++ b/src/waffle/glx/glx_config.c @@ -72,12 +72,11 @@ glx_config_check_context_attrs(struct glx_display *dpy, "to create a context with version >= 3.2"); return false; } - else if (attrs->context_full_version >= 32 && attrs->context_profile == WAFFLE_NONE) { - wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE, - "WAFFLE_CONTEXT_PROFILE must be provided when " - "the requested context version is >= 3.2"); - return false; + else if (attrs->context_full_version >= 32) { + assert(attrs->context_profile == WAFFLE_CONTEXT_CORE_PROFILE || + attrs->context_profile == WAFFLE_CONTEXT_COMPATIBILITY_PROFILE); } + return true; case WAFFLE_CONTEXT_OPENGL_ES1: |