glx/dri: Use X/GLX error codes for our create_context_attribs

This has no functional change because everyone calling this is
discarding the error code, because we're relying on the server to
generate the right thing for us. But we create the direct context first
and the server isn't going to enforce everything we want it to
(supported GL versions for example). Convert out from DRI error codes to
X/GLX error codes so we can fail the right way on the client side. We're
still throwing the error away in all of the callers but that'll change
shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
This commit is contained in:
Adam Jackson
2021-07-21 18:05:12 -04:00
committed by Marge Bot
parent 12e11fa3e4
commit 9c76682d80
7 changed files with 62 additions and 23 deletions

View File

@@ -234,7 +234,7 @@ dri3_create_context_attribs(struct glx_screen *base,
* GLX_CONTEXT_OPENGL_NO_ERROR_ARB for the context being created.
*/
if (!!shareList->noError != !!dca.no_error) {
*error = __DRI_CTX_ERROR_BAD_FLAG;
*error = BadMatch;
return NULL;
}
@@ -243,7 +243,7 @@ dri3_create_context_attribs(struct glx_screen *base,
pcp = calloc(1, sizeof *pcp);
if (pcp == NULL) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
*error = BadAlloc;
goto error_exit;
}
@@ -293,6 +293,8 @@ dri3_create_context_attribs(struct glx_screen *base,
error,
pcp);
*error = dri_context_error_to_glx_error(*error);
if (pcp->driContext == NULL)
goto error_exit;