Lines Matching defs:glthread

24 /** @file glthread.c
26 * Support functions for the glthread feature of Mesa.
36 #include "main/glthread.h"
71 struct glthread_state *glthread = calloc(1, sizeof(*glthread));
73 if (!glthread)
76 if (!util_queue_init(&glthread->queue, "gl", MARSHAL_MAX_BATCHES - 2,
78 free(glthread);
84 util_queue_destroy(&glthread->queue);
85 free(glthread);
90 glthread->batches[i].ctx = ctx;
91 util_queue_fence_init(&glthread->batches[i].fence);
94 glthread->stats.queue = &glthread->queue;
96 ctx->GLThread = glthread;
101 util_queue_add_job(&glthread->queue, ctx, &fence,
110 struct glthread_state *glthread = ctx->GLThread;
112 if (!glthread)
116 util_queue_destroy(&glthread->queue);
119 util_queue_fence_destroy(&glthread->batches[i].fence);
121 free(glthread);
140 printf("glthread disabled: %s\n", func);
148 struct glthread_state *glthread = ctx->GLThread;
149 if (!glthread)
152 struct glthread_batch *next = &glthread->batches[glthread->next];
167 p_atomic_add(&glthread->stats.num_offloaded_items, next->used);
169 util_queue_add_job(&glthread->queue, next, &next->fence,
171 glthread->last = glthread->next;
172 glthread->next = (glthread->next + 1) % MARSHAL_MAX_BATCHES;
184 struct glthread_state *glthread = ctx->GLThread;
185 if (!glthread)
193 if (u_thread_is_self(glthread->queue.threads[0]))
196 struct glthread_batch *last = &glthread->batches[glthread->last];
197 struct glthread_batch *next = &glthread->batches[glthread->next];
206 p_atomic_add(&glthread->stats.num_direct_items, next->used);
222 p_atomic_inc(&glthread->stats.num_syncs);