diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2012-07-04 15:21:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-05 11:44:17 -0700 |
commit | 41d5120eaf2bdf308eb904cac9b5027b003fea8d (patch) | |
tree | cc0fbca23020b964eb52a9a0583d943db84e8f61 /glx/glxdri2.c | |
parent | cef0b808d3152a20cd98d32457dde08bd5434e7c (diff) |
glx: Implement GLX_EXT_create_context_es2_profile
This patch builds on the infrastucture put in place for
GLX_ARB_create_context_profile. If GLX_CONTEXT_ES2_PROFILE_BIT_EXT is
specified and the requested version is 2.0, create a context with the
__DRI_API_GLES2 API.
This change assumes that any DRI2 driver can handle (possibly by saying "no
seeing an API setting other than __DRI_API_OPENGL or __DRI_API_OPENGL_CORE.
This allows enabling the extension any time GLX_ARB_create_context (and
GLX_ARB_create_context_profile) is enabled.
v2: Clean up some comments. Note that our behavior for
GLX_CONTEXT_ES2_PROFILE_BIT_EXT w/version != 2.0 matches NVIDIA's.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glx/glxdri2.c')
-rw-r--r-- | glx/glxdri2.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 7ec43375f..8210a2b25 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -417,6 +417,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 = __glXError(GLXBadProfileARB); return False; @@ -812,8 +815,12 @@ initializeExtensions(__GLXDRIscreen * screen) "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_EXT_create_context_es2_profile"); LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n"); LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n"); + LogMessage(X_INFO, + "AIGLX: enabled GLX_EXT_create_context_es2_profile\n"); } #endif |