aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-11-12 18:48:53 -0800
committerChad Versace <chad.versace@linux.intel.com>2012-11-12 18:50:49 -0800
commit389367f4a471b3610f80c995dc273d516ddeb9f9 (patch)
treefd63c4aef9d0fb63fab741f6daa1e194a6b40757
parentb8b86d102d667db8e22a10426314e908e15ed2a2 (diff)
waffle: Support requests for more OpenGL ES versions
Allow the user to explicitly request for OpenGL ES 1.0, OpenGL ES 1.1, and any OpenGL 2.x. The GLX and EGL platforms implement this. Also update the waffle_config manpage. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--man/waffle_config.3.xml8
-rw-r--r--src/waffle/core/wcore_config_attrs.c12
-rw-r--r--src/waffle/egl/wegl_context.c11
-rw-r--r--src/waffle/glx/glx_config.c5
4 files changed, 28 insertions, 8 deletions
diff --git a/man/waffle_config.3.xml b/man/waffle_config.3.xml
index 1b12e19..b106812 100644
--- a/man/waffle_config.3.xml
+++ b/man/waffle_config.3.xml
@@ -253,12 +253,16 @@ struct waffle_config;
<para>
If the requested API is <constant>WAFFLE_CONTEXT_OPENGL_ES1</constant>,
- then the default and only accepted value is 1.0.
+ then the default value is 1.0.
+
+ The only accepted values are 1.0 and 1.1.
</para>
<para>
If the requested API is <constant>WAFFLE_CONTEXT_OPENGL_ES2</constant>,
- then the default and only accepted value is 2.0.
+ then the default value is 2.0.
+
+ Waffle accepts any value that is at least 2.0 and strictly less than 3.0.
</para>
<para>
diff --git a/src/waffle/core/wcore_config_attrs.c b/src/waffle/core/wcore_config_attrs.c
index 62c0492..531937c 100644
--- a/src/waffle/core/wcore_config_attrs.c
+++ b/src/waffle/core/wcore_config_attrs.c
@@ -132,17 +132,21 @@ check_es_context(struct wcore_config_attrs *attrs)
switch (attrs->context_api) {
case WAFFLE_CONTEXT_OPENGL_ES1:
- if (attrs->context_full_version != 10) {
+ if (attrs->context_full_version != 10 &&
+ attrs->context_full_version != 11)
+ {
wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE,
- "the context version must be 1.0 for OpenGL ES1");
+ "for OpenGL ES1, the requested context version "
+ "must be 1.0 or 1.1");
return false;
}
return true;
case WAFFLE_CONTEXT_OPENGL_ES2:
- if (attrs->context_full_version != 20) {
+ if (attrs->context_major_version != 2) {
wcore_errorf(WAFFLE_ERROR_BAD_ATTRIBUTE,
- "the context version must be 2.0 for OpenGL ES2");
+ "for OpenGL ES2, the requested major context "
+ "version must be 2");
return false;
}
diff --git a/src/waffle/egl/wegl_context.c b/src/waffle/egl/wegl_context.c
index a5aded3..21729b7 100644
--- a/src/waffle/egl/wegl_context.c
+++ b/src/waffle/egl/wegl_context.c
@@ -86,12 +86,23 @@ create_real_context(struct wegl_config *config,
attrib_list[i++] = EGL_NONE;
break;
+
case WAFFLE_CONTEXT_OPENGL_ES1:
case WAFFLE_CONTEXT_OPENGL_ES2:
attrib_list[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
attrib_list[i++] = attrs->context_major_version;
+
+ if (dpy->KHR_create_context) {
+ attrib_list[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
+ attrib_list[i++] = attrs->context_minor_version;
+ }
+ else {
+ assert(attrs->context_minor_version == 0);
+ }
+
attrib_list[i++] = EGL_NONE;
break;
+
default:
wcore_error_internal("waffle_context_api has bad value %#x",
waffle_context_api);
diff --git a/src/waffle/glx/glx_config.c b/src/waffle/glx/glx_config.c
index f58e265..450f2f6 100644
--- a/src/waffle/glx/glx_config.c
+++ b/src/waffle/glx/glx_config.c
@@ -80,7 +80,8 @@ glx_config_check_context_attrs(struct glx_display *dpy,
return true;
case WAFFLE_CONTEXT_OPENGL_ES1:
- assert(attrs->context_full_version == 10);
+ assert(attrs->context_full_version == 10 ||
+ attrs->context_full_version == 11);
if (!dpy->EXT_create_context_es_profile) {
wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
@@ -98,7 +99,7 @@ glx_config_check_context_attrs(struct glx_display *dpy,
return true;
case WAFFLE_CONTEXT_OPENGL_ES2:
- assert(attrs->context_full_version == 20);
+ assert(attrs->context_major_version == 2);
if (!dpy->EXT_create_context_es2_profile) {
wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,