* bitmap in the atlas to determine the texture atlas size.
*/
for (i = 0; i < atlas->numBitmaps; i++) {
- const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, false);
+ const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, true);
const Node *n;
struct gl_bitmap_glyph *g = &atlas->glyphs[i];
unsigned bitmap_width, bitmap_height;
memset(map, 0xff, map_stride * atlas->texHeight);
for (i = 0; i < atlas->numBitmaps; i++) {
- const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, false);
+ const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, true);
const Node *n = list->Head;
assert(n[0].opcode == OPCODE_BITMAP ||
check_atlas_for_deleted_list, &list);
}
+ _mesa_HashLockMutex(ctx->Shared->DisplayList);
_mesa_delete_list(ctx, dlist);
- _mesa_HashRemove(ctx->Shared->DisplayList, list);
+ _mesa_HashRemoveLocked(ctx->Shared->DisplayList, list);
+ _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
}
*/
bool
_mesa_get_list(struct gl_context *ctx, GLuint list,
- struct gl_display_list **dlist)
+ struct gl_display_list **dlist,
+ bool locked)
{
struct gl_display_list * dl =
- list > 0 ? _mesa_lookup_list(ctx, list, false) : NULL;
+ list > 0 ? _mesa_lookup_list(ctx, list, locked) : NULL;
if (dlist)
*dlist = dl;
* Execute a display list. Note that the ListBase offset must have already
* been added before calling this function. I.e. the list argument is
* the absolute list number, not relative to ListBase.
+ * Must be called with ctx->Shared->DisplayList locked.
* \param list - display list number
*/
static void
struct gl_display_list *dlist;
Node *n;
- if (list == 0 || !_mesa_get_list(ctx, list, &dlist))
+ if (list == 0 || !_mesa_get_list(ctx, list, &dlist, true))
return;
if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
break;
case OPCODE_CALL_LISTS:
if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
+ _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
CALL_CallLists(ctx->Exec, (n[1].i, n[2].e, get_pointer(&n[3])));
+ _mesa_HashLockMutex(ctx->Shared->DisplayList);
}
break;
case OPCODE_CLEAR:
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- return _mesa_get_list(ctx, list, NULL);
+ return _mesa_get_list(ctx, list, NULL, false);
}
ctx->CompileFlag = GL_FALSE;
}
+ _mesa_HashLockMutex(ctx->Shared->DisplayList);
execute_list(ctx, list);
+ _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
ctx->CompileFlag = save_compile_flag;
/* also restore API function pointers to point to "save" versions */
GLuint base = ctx->List.ListBase;
+ _mesa_HashLockMutex(ctx->Shared->DisplayList);
+
/* A loop inside a switch is faster than a switch inside a loop. */
switch (type) {
case GL_BYTE:
break;
}
+ _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
ctx->CompileFlag = save_compile_flag;
/* also restore API function pointers to point to "save" versions */
return;
}
- if (!_mesa_get_list(ctx, list, &dlist)) {
+ if (!_mesa_get_list(ctx, list, &dlist, true)) {
fprintf(f, "%u is not a display list ID\n", list);
fflush(f);
if (fname)
if (list == 0 ||
ctx->GLThread.ListCallDepth == MAX_LIST_NESTING ||
- !_mesa_get_list(ctx, list, &dlist))
+ !_mesa_get_list(ctx, list, &dlist, true))
return;
ctx->GLThread.ListCallDepth++;