diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_surface.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 58fbc220624..56211a4d0ee 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -777,6 +777,11 @@ zink_destroy_buffer_view(struct zink_screen *screen, struct zink_buffer_view *bu { struct zink_resource *res = zink_resource(buffer_view->pres); simple_mtx_lock(&res->bufferview_mtx); + if (buffer_view->reference.count) { + /* got a cache hit during deletion */ + simple_mtx_unlock(&res->bufferview_mtx); + return; + } struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&res->bufferview_cache, buffer_view->hash, &buffer_view->bvci); assert(he); _mesa_hash_table_remove(&res->bufferview_cache, he); diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 08dc0057ffa..e7af9963529 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -281,6 +281,11 @@ zink_destroy_surface(struct zink_screen *screen, struct pipe_surface *psurface) struct zink_resource *res = zink_resource(psurface->texture); if (!psurface->nr_samples) { simple_mtx_lock(&res->surface_mtx); + if (psurface->reference.count) { + /* got a cache hit during deletion */ + simple_mtx_unlock(&res->surface_mtx); + return; + } struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&res->surface_cache, surface->hash, &surface->ivci); assert(he); assert(he->data == surface); |