From acfd88204e886e671da97b895fd2d1ee39b61256 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Thu, 3 Aug 2017 20:07:58 +0200 Subject: glx: add support for GLX_ARB_create_context_no_error (v3) v2: Only reject no-error contexts for too-old GL if we're actually trying to create a no-error context (Adam Jackson) v3: Fix share contexts (Adam Jackson) Reviewed-by: Adam Jackson Reviewed-by: Eric Anholt --- src/glx/dri2_glx.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/glx/dri2_glx.c') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index d8c5ba25f04..d6a543c8da0 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -263,6 +263,10 @@ dri2_create_context_attribs(struct glx_screen *base, &api, &reset, &release, error)) goto error_exit; + if (!dri2_check_no_error(flags, shareList, major_ver, error)) { + goto error_exit; + } + /* Check the renderType value */ if (!validate_renderType_against_config(config_base, renderType)) goto error_exit; @@ -314,6 +318,9 @@ dri2_create_context_attribs(struct glx_screen *base, */ pcp->base.renderType = renderType; + if (flags & __DRI_CTX_FLAG_NO_ERROR) + pcp->base.noError = GL_TRUE; + pcp->driContext = (*psc->dri2->createContextAttribs) (psc->driScreen, api, @@ -1164,6 +1171,14 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv, __glXEnableDirectExtension(&psc->base, "GLX_ARB_create_context_robustness"); + /* DRI2 version 3 is also required because + * GLX_ARB_create_context_no_error requires GLX_ARB_create_context. + */ + if (psc->dri2->base.version >= 3 + && strcmp(extensions[i]->name, __DRI2_NO_ERROR) == 0) + __glXEnableDirectExtension(&psc->base, + "GLX_ARB_create_context_no_error"); + /* DRI2 version 3 is also required because GLX_MESA_query_renderer * requires GLX_ARB_create_context_profile. */ -- cgit v1.2.3