lavapipe: Fix the locking around cso destruction

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24956>
This commit is contained in:
Konstantin Seurer
2023-08-30 18:30:28 +02:00
committed by Marge Bot
parent 3d0ed8bb26
commit 8bc0f6be67
@@ -58,6 +58,10 @@ shader_destroy(struct lvp_device *device, struct lvp_shader *shader, bool locked
device->queue.ctx->delete_ts_state,
device->queue.ctx->delete_ms_state,
};
if (!locked)
simple_mtx_lock(&device->queue.lock);
set_foreach(&shader->inlines.variants, entry) {
struct lvp_inline_variant *variant = (void*)entry->key;
destroy[stage](device->queue.ctx, variant->cso);
@@ -65,9 +69,6 @@ shader_destroy(struct lvp_device *device, struct lvp_shader *shader, bool locked
}
ralloc_free(shader->inlines.variants.table);
if (!locked)
simple_mtx_lock(&device->queue.lock);
if (shader->shader_cso)
destroy[stage](device->queue.ctx, shader->shader_cso);
if (shader->tess_ccw_cso)