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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user