}
/****************************************************************************
- * util_queue implementation
+ * util_queue_fence
*/
static void
}
void
-util_queue_job_wait(struct util_queue_fence *fence)
+util_queue_fence_wait(struct util_queue_fence *fence)
{
pipe_mutex_lock(fence->mutex);
while (!fence->signalled)
pipe_mutex_unlock(fence->mutex);
}
+void
+util_queue_fence_init(struct util_queue_fence *fence)
+{
+ memset(fence, 0, sizeof(*fence));
+ pipe_mutex_init(fence->mutex);
+ pipe_condvar_init(fence->cond);
+ fence->signalled = true;
+}
+
+void
+util_queue_fence_destroy(struct util_queue_fence *fence)
+{
+ assert(fence->signalled);
+ pipe_condvar_destroy(fence->cond);
+ pipe_mutex_destroy(fence->mutex);
+}
+
+/****************************************************************************
+ * util_queue implementation
+ */
+
struct thread_input {
struct util_queue *queue;
int thread_index;
}
void
-util_queue_fence_init(struct util_queue_fence *fence)
-{
- memset(fence, 0, sizeof(*fence));
- pipe_mutex_init(fence->mutex);
- pipe_condvar_init(fence->cond);
- fence->signalled = true;
-}
-
-void
-util_queue_fence_destroy(struct util_queue_fence *fence)
-{
- assert(fence->signalled);
- pipe_condvar_destroy(fence->cond);
- pipe_mutex_destroy(fence->mutex);
-}
-
-void
util_queue_add_job(struct util_queue *queue,
void *job,
struct util_queue_fence *fence,
* in a compiler thread.
*/
if (thread_index < 0)
- util_queue_job_wait(&sel->ready);
+ util_queue_fence_wait(&sel->ready);
pipe_mutex_lock(sel->mutex);
static void si_delete_shader(struct si_context *sctx, struct si_shader *shader)
{
if (shader->is_optimized) {
- util_queue_job_wait(&shader->optimized_ready);
+ util_queue_fence_wait(&shader->optimized_ready);
util_queue_fence_destroy(&shader->optimized_ready);
}
[PIPE_SHADER_FRAGMENT] = &sctx->ps_shader,
};
- util_queue_job_wait(&sel->ready);
+ util_queue_fence_wait(&sel->ready);
if (current_shader[sel->type]->cso == sel) {
current_shader[sel->type]->cso = NULL;