diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index a741fa6a71a..611c4c3d001 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -13749,6 +13749,7 @@ _mesa_EndList(void) struct gl_dlist_state *list = &ctx->ListState; list->CurrentList->execute_glthread = _mesa_glthread_should_execute_list(ctx, list->CurrentList); + ctx->Shared->DisplayListsAffectGLThread |= list->CurrentList->execute_glthread; if ((list->CurrentList->Head == list->CurrentBlock) && (list->CurrentPos < BLOCK_SIZE)) { diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 03700dbdd95..300d975a6e9 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -612,6 +612,9 @@ _mesa_glthread_CallList(struct gl_context *ctx, GLuint list) p_atomic_set(&ctx->GLThread.LastDListChangeBatchIndex, -1); } + if (!ctx->Shared->DisplayListsAffectGLThread) + return; + /* Clear GL_COMPILE_AND_EXECUTE if needed. We only execute here. */ unsigned saved_mode = ctx->GLThread.ListMode; ctx->GLThread.ListMode = 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f8f12c03152..fb168ed770a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3369,6 +3369,8 @@ struct gl_shared_state { simple_mtx_t Mutex; /**< for thread safety */ GLint RefCount; /**< Reference count */ + bool DisplayListsAffectGLThread; + struct _mesa_HashTable *DisplayList; /**< Display lists hash table */ struct _mesa_HashTable *BitmapAtlas; /**< For optimized glBitmap text */ struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */