glx: Use the new no-error driver interface
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
This commit is contained in:
@@ -198,10 +198,6 @@ dri2_create_context_attribs(struct glx_screen *base,
|
||||
if (*error != __DRI_CTX_ERROR_SUCCESS)
|
||||
goto error_exit;
|
||||
|
||||
if (!dri2_check_no_error(dca.flags, shareList, dca.major_ver, error)) {
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
/* Check the renderType value */
|
||||
if (!validate_renderType_against_config(config_base, dca.render_type))
|
||||
goto error_exit;
|
||||
@@ -211,6 +207,17 @@ dri2_create_context_attribs(struct glx_screen *base,
|
||||
if (!shareList->isDirect)
|
||||
return NULL;
|
||||
|
||||
/* The GLX_ARB_create_context_no_error specs say:
|
||||
*
|
||||
* BadMatch is generated if the value of GLX_CONTEXT_OPENGL_NO_ERROR_ARB
|
||||
* used to create <share_context> does not match the value of
|
||||
* GLX_CONTEXT_OPENGL_NO_ERROR_ARB for the context being created.
|
||||
*/
|
||||
if (!!shareList->noError != !!dca.no_error) {
|
||||
*error = __DRI_CTX_ERROR_BAD_FLAG;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pcp_shared = (struct dri2_context *) shareList;
|
||||
shared = pcp_shared->driContext;
|
||||
}
|
||||
@@ -243,12 +250,14 @@ dri2_create_context_attribs(struct glx_screen *base,
|
||||
ctx_attribs[num_ctx_attribs++] = dca.release;
|
||||
}
|
||||
|
||||
if (dca.no_error) {
|
||||
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_NO_ERROR;
|
||||
ctx_attribs[num_ctx_attribs++] = dca.no_error;
|
||||
pcp->base.noError = GL_TRUE;
|
||||
}
|
||||
|
||||
if (dca.flags != 0) {
|
||||
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
|
||||
|
||||
/* The current __DRI_CTX_FLAG_* values are identical to the
|
||||
* GLX_CONTEXT_*_BIT values.
|
||||
*/
|
||||
ctx_attribs[num_ctx_attribs++] = dca.flags;
|
||||
}
|
||||
|
||||
@@ -257,9 +266,6 @@ dri2_create_context_attribs(struct glx_screen *base,
|
||||
*/
|
||||
pcp->base.renderType = dca.render_type;
|
||||
|
||||
if (dca.flags & __DRI_CTX_FLAG_NO_ERROR)
|
||||
pcp->base.noError = GL_TRUE;
|
||||
|
||||
pcp->driContext =
|
||||
(*psc->dri2->createContextAttribs) (psc->driScreen,
|
||||
dca.api,
|
||||
@@ -1096,13 +1102,15 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
|
||||
__glXEnableDirectExtension(&psc->base,
|
||||
"GLX_ARB_create_context_robustness");
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI2_NO_ERROR) == 0)
|
||||
__glXEnableDirectExtension(&psc->base,
|
||||
"GLX_ARB_create_context_no_error");
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI2_RENDERER_QUERY) == 0) {
|
||||
psc->rendererQuery = (__DRI2rendererQueryExtension *) extensions[i];
|
||||
__glXEnableDirectExtension(&psc->base, "GLX_MESA_query_renderer");
|
||||
unsigned int no_error = 0;
|
||||
if (psc->rendererQuery->queryInteger(psc->driScreen,
|
||||
__DRI2_RENDERER_HAS_NO_ERROR_CONTEXT,
|
||||
&no_error) == 0 && no_error)
|
||||
__glXEnableDirectExtension(&psc->base,
|
||||
"GLX_ARB_create_context_no_error");
|
||||
}
|
||||
|
||||
if (strcmp(extensions[i]->name, __DRI2_INTEROP) == 0)
|
||||
|
Reference in New Issue
Block a user