From 9d8301d60210a80f000cc0c30e17b04a4ffc60bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 29 Nov 2021 13:51:23 -0500 Subject: [PATCH] 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 Part-of: --- src/mesa/main/glthread.c | 9 ++------- src/mesa/main/mtypes.h | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 2d504a0bd97..f5e766adfdb 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -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); } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 3d62d4be4d2..3473c3aaa86 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -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; /**