Lines Matching refs:glthread
71 struct glthread_state *glthread = calloc(1, sizeof(*glthread)); in _mesa_glthread_init() local
73 if (!glthread) in _mesa_glthread_init()
76 if (!util_queue_init(&glthread->queue, "glthread", MARSHAL_MAX_BATCHES - 2, in _mesa_glthread_init()
78 free(glthread); in _mesa_glthread_init()
84 util_queue_destroy(&glthread->queue); in _mesa_glthread_init()
85 free(glthread); in _mesa_glthread_init()
90 glthread->batches[i].ctx = ctx; in _mesa_glthread_init()
91 util_queue_fence_init(&glthread->batches[i].fence); in _mesa_glthread_init()
94 glthread->stats.queue = &glthread->queue; in _mesa_glthread_init()
96 ctx->GLThread = glthread; in _mesa_glthread_init()
101 util_queue_add_job(&glthread->queue, ctx, &fence, in _mesa_glthread_init()
110 struct glthread_state *glthread = ctx->GLThread; in _mesa_glthread_destroy() local
112 if (!glthread) in _mesa_glthread_destroy()
116 util_queue_destroy(&glthread->queue); in _mesa_glthread_destroy()
119 util_queue_fence_destroy(&glthread->batches[i].fence); in _mesa_glthread_destroy()
121 free(glthread); in _mesa_glthread_destroy()
145 struct glthread_state *glthread = ctx->GLThread; in _mesa_glthread_flush_batch() local
146 if (!glthread) in _mesa_glthread_flush_batch()
149 struct glthread_batch *next = &glthread->batches[glthread->next]; in _mesa_glthread_flush_batch()
164 p_atomic_add(&glthread->stats.num_offloaded_items, next->used); in _mesa_glthread_flush_batch()
166 util_queue_add_job(&glthread->queue, next, &next->fence, in _mesa_glthread_flush_batch()
168 glthread->last = glthread->next; in _mesa_glthread_flush_batch()
169 glthread->next = (glthread->next + 1) % MARSHAL_MAX_BATCHES; in _mesa_glthread_flush_batch()
181 struct glthread_state *glthread = ctx->GLThread; in _mesa_glthread_finish() local
182 if (!glthread) in _mesa_glthread_finish()
190 if (u_thread_is_self(glthread->queue.threads[0])) in _mesa_glthread_finish()
193 struct glthread_batch *last = &glthread->batches[glthread->last]; in _mesa_glthread_finish()
194 struct glthread_batch *next = &glthread->batches[glthread->next]; in _mesa_glthread_finish()
203 p_atomic_add(&glthread->stats.num_direct_items, next->used); in _mesa_glthread_finish()
219 p_atomic_inc(&glthread->stats.num_syncs); in _mesa_glthread_finish()