Lines Matching refs:glthread
79 struct glthread_state *glthread = &ctx->GLThread; in _mesa_glthread_init() local
81 assert(!glthread->enabled); in _mesa_glthread_init()
83 if (!util_queue_init(&glthread->queue, "gl", MARSHAL_MAX_BATCHES - 2, in _mesa_glthread_init()
88 glthread->VAOs = _mesa_NewHashTable(); in _mesa_glthread_init()
89 if (!glthread->VAOs) { in _mesa_glthread_init()
90 util_queue_destroy(&glthread->queue); in _mesa_glthread_init()
94 _mesa_glthread_reset_vao(&glthread->DefaultVAO); in _mesa_glthread_init()
95 glthread->CurrentVAO = &glthread->DefaultVAO; in _mesa_glthread_init()
99 _mesa_DeleteHashTable(glthread->VAOs); in _mesa_glthread_init()
100 util_queue_destroy(&glthread->queue); in _mesa_glthread_init()
105 glthread->batches[i].ctx = ctx; in _mesa_glthread_init()
106 util_queue_fence_init(&glthread->batches[i].fence); in _mesa_glthread_init()
108 glthread->next_batch = &glthread->batches[glthread->next]; in _mesa_glthread_init()
110 glthread->enabled = true; in _mesa_glthread_init()
111 glthread->stats.queue = &glthread->queue; in _mesa_glthread_init()
113 glthread->SupportsBufferUploads = in _mesa_glthread_init()
121 glthread->SupportsNonVBOUploads = glthread->SupportsBufferUploads && in _mesa_glthread_init()
129 util_queue_add_job(&glthread->queue, ctx, &fence, in _mesa_glthread_init()
144 struct glthread_state *glthread = &ctx->GLThread; in _mesa_glthread_destroy() local
146 if (!glthread->enabled) in _mesa_glthread_destroy()
150 util_queue_destroy(&glthread->queue); in _mesa_glthread_destroy()
153 util_queue_fence_destroy(&glthread->batches[i].fence); in _mesa_glthread_destroy()
155 _mesa_HashDeleteAll(glthread->VAOs, free_vao, NULL); in _mesa_glthread_destroy()
156 _mesa_DeleteHashTable(glthread->VAOs); in _mesa_glthread_destroy()
191 struct glthread_state *glthread = &ctx->GLThread; in _mesa_glthread_flush_batch() local
192 if (!glthread->enabled) in _mesa_glthread_flush_batch()
195 struct glthread_batch *next = glthread->next_batch; in _mesa_glthread_flush_batch()
205 ++glthread->pin_thread_counter % 128 == 0) { in _mesa_glthread_flush_batch()
211 util_set_thread_affinity(glthread->queue.threads[0], in _mesa_glthread_flush_batch()
229 p_atomic_add(&glthread->stats.num_offloaded_items, next->used); in _mesa_glthread_flush_batch()
231 util_queue_add_job(&glthread->queue, next, &next->fence, in _mesa_glthread_flush_batch()
233 glthread->last = glthread->next; in _mesa_glthread_flush_batch()
234 glthread->next = (glthread->next + 1) % MARSHAL_MAX_BATCHES; in _mesa_glthread_flush_batch()
235 glthread->next_batch = &glthread->batches[glthread->next]; in _mesa_glthread_flush_batch()
247 struct glthread_state *glthread = &ctx->GLThread; in _mesa_glthread_finish() local
248 if (!glthread->enabled) in _mesa_glthread_finish()
256 if (u_thread_is_self(glthread->queue.threads[0])) in _mesa_glthread_finish()
259 struct glthread_batch *last = &glthread->batches[glthread->last]; in _mesa_glthread_finish()
260 struct glthread_batch *next = glthread->next_batch; in _mesa_glthread_finish()
269 p_atomic_add(&glthread->stats.num_direct_items, next->used); in _mesa_glthread_finish()
285 p_atomic_inc(&glthread->stats.num_syncs); in _mesa_glthread_finish()