glthread: disable glthread if the context is lost

Reviewed-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-30 08:28:35 -05:00
parent 9d8301d602
commit d052612317
1 changed files with 6 additions and 1 deletions

View File

@ -191,8 +191,13 @@ _mesa_glthread_flush_batch(struct gl_context *ctx)
if (!glthread->enabled)
return;
if (!glthread->used)
if (ctx->CurrentServerDispatch == ctx->ContextLost) {
_mesa_glthread_destroy(ctx, "context lost");
return;
}
if (!glthread->used)
return; /* the batch is empty */
/* Pin threads regularly to the same Zen CCX that the main thread is
* running on. The main thread can move between CCXs.