aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/dri_common.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-12-02 14:45:11 -0800
committerIan Romanick <[email protected]>2012-01-02 12:41:45 -0800
commite6280c3ba9579bf01f8b82e19497ba8f142a8d09 (patch)
tree03607c28d7f750d7c5c04dfb9fd1c4ac80b9432e /src/glx/dri_common.c
parente532b6288f01b63d8d8ba8c8dc08292967e65490 (diff)
glx: Enable GLX_EXT_create_context_es2_profile
This extension is only enabled if the underlying driver advertises support for OpenGL ES 2.0. This happens either through the getAPIMask function in version 2 of the DRI2 extension or implicity through version 2 of the DRISW extension. Since there is no OpenGL ES 2.0 protocol, this extension is marked as only available with direct-rendering. Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glx/dri_common.c')
-rw-r--r--src/glx/dri_common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 5d50aa92e53..8feb58777b8 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -488,6 +488,9 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
*api = __DRI_API_OPENGL;
break;
+ case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
+ *api = __DRI_API_GLES2;
+ break;
default:
*error = __DRI_CTX_ERROR_BAD_API;
return false;
@@ -517,6 +520,19 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
return false;
}
+ /* The GLX_EXT_create_context_es2_profile spec says:
+ *
+ * "... If the version requested is 2.0, and the
+ * GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the
+ * GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the context
+ * returned will implement OpenGL ES 2.0. This is the only way in which
+ * an implementation may request an OpenGL ES 2.0 context."
+ */
+ if (*api == __DRI_API_GLES2 && (*major_ver != 2 || *minor_ver != 0)) {
+ *error = __DRI_CTX_ERROR_BAD_API;
+ return false;
+ }
+
*error = __DRI_CTX_ERROR_SUCCESS;
return true;
}