/* Don't check the "current" shader. We checked it above. */
if (current != iter &&
memcmp(&iter->key, key, sizeof(*key)) == 0) {
+ mtx_unlock(&sel->mutex);
+
if (unlikely(!util_queue_fence_is_signalled(&iter->ready))) {
/* If it's an optimized shader and its compilation has
* been started but isn't done, use the unoptimized
*/
if (iter->is_optimized) {
memset(&key->opt, 0, sizeof(key->opt));
- mtx_unlock(&sel->mutex);
goto again;
}
}
if (iter->compilation_failed) {
- mtx_unlock(&sel->mutex);
return -1; /* skip the draw call */
}
state->current = iter;
- mtx_unlock(&sel->mutex);
return 0;
}
}
sel->last_variant = shader;
}
+ mtx_unlock(&sel->mutex);
+
assert(!shader->is_optimized);
si_build_shader_variant(shader, thread_index, false);
if (!shader->compilation_failed)
state->current = shader;
- mtx_unlock(&sel->mutex);
return shader->compilation_failed ? -1 : 0;
}