zink: allocate keys for surface cache to stop using zink_surface::ivci

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35722>
This commit is contained in:
Mike Blumenkrantz
2025-06-18 16:25:59 -04:00
parent b3c02d2bca
commit a9c928954e
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -213,6 +213,7 @@ zink_destroy_resource_surface_cache(struct zink_screen *screen, struct hash_tabl
hash_table_foreach_remove(ht, he) {
struct zink_surface *surf = he->data;
VKSCR(DestroyImageView)(screen->dev, surf->image_view, NULL);
free((void*)he->key);
FREE(surf);
}
ralloc_free(ht->table);
+1 -1
View File
@@ -222,7 +222,7 @@ zink_get_surface(struct zink_context *ctx,
/* only transient surfaces have nr_samples set */
surface->base.nr_samples = zink_screen(ctx->base.screen)->info.have_EXT_multisampled_render_to_single_sampled ? templ->nr_samples : 0;
surface->ivci = *ivci;
entry = _mesa_hash_table_insert_pre_hashed(ht, hash, &surface->ivci, surface);
entry = _mesa_hash_table_insert_pre_hashed(ht, hash, mem_dup(ivci, sizeof(*ivci)), surface);
if (!entry) {
simple_mtx_unlock(&res->obj->surface_mtx);
return NULL;