util_queue_destroy(&glthread->queue);
return;
}
+
+ _mesa_glthread_reset_vao(&glthread->DefaultVAO);
glthread->CurrentVAO = &glthread->DefaultVAO;
ctx->MarshalExec = _mesa_create_marshal_table(ctx);
glthread->batches[i].ctx = ctx;
util_queue_fence_init(&glthread->batches[i].fence);
}
+ glthread->next_batch = &glthread->batches[glthread->next];
glthread->enabled = true;
glthread->stats.queue = &glthread->queue;
+
+ glthread->SupportsBufferUploads =
+ ctx->Const.BufferCreateMapUnsynchronizedThreadSafe &&
+ ctx->Const.AllowMappedBuffersDuringExecution;
+
+ /* If the draw start index is non-zero, glthread can upload to offset 0,
+ * which means the attrib offset has to be -(first * stride).
+ * So require signed vertex buffer offsets.
+ */
+ glthread->SupportsNonVBOUploads = glthread->SupportsBufferUploads &&
+ ctx->Const.VertexBufferOffsetIsInt32;
+
ctx->CurrentClientDispatch = ctx->MarshalExec;
/* Execute the thread initialization function in the thread. */
if (!glthread->enabled)
return;
- struct glthread_batch *next = &glthread->batches[glthread->next];
+ struct glthread_batch *next = glthread->next_batch;
if (!next->used)
return;
glthread_unmarshal_batch, NULL, 0);
glthread->last = glthread->next;
glthread->next = (glthread->next + 1) % MARSHAL_MAX_BATCHES;
+ glthread->next_batch = &glthread->batches[glthread->next];
}
/**
return;
struct glthread_batch *last = &glthread->batches[glthread->last];
- struct glthread_batch *next = &glthread->batches[glthread->next];
+ struct glthread_batch *next = glthread->next_batch;
bool synced = false;
if (!util_queue_fence_is_signalled(&last->fence)) {