glthread: fix restoring the dispatch in destroy when the context is not current

also remove an invalid comment in mtypes.h

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
This commit is contained in:
Marek Olšák 2021-11-29 13:51:23 -05:00
parent 670759a208
commit 9d8301d602
2 changed files with 3 additions and 9 deletions

View File

@ -176,15 +176,10 @@ _mesa_glthread_destroy(struct gl_context *ctx, const char *reason)
_mesa_DeleteHashTable(glthread->VAOs);
ctx->GLThread.enabled = false;
ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
/* Remove ourselves from the dispatch table except if another ctx/thread
* already installed a new dispatch table.
*
* Typically glxMakeCurrent will bind a new context (install new table) then
* old context might be deleted.
*/
/* Update the dispatch only if the context is current. */
if (_glapi_get_dispatch() == ctx->MarshalExec) {
ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
_glapi_set_dispatch(ctx->CurrentClientDispatch);
}
}

View File

@ -5225,8 +5225,7 @@ struct gl_context
struct _glapi_table *ContextLost;
/**
* Dispatch table used to marshal API calls from the client program to a
* separate server thread. NULL if API calls are not being marshalled to
* another thread.
* separate server thread.
*/
struct _glapi_table *MarshalExec;
/**