zink: add surface ref during rebind if unflushed usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11692>
This commit is contained in:
Mike Blumenkrantz
2021-05-11 09:22:25 -04:00
committed by Marge Bot
parent 59b142ae03
commit 447ba04d87
+2
View File
@@ -256,6 +256,8 @@ zink_rebind_surface(struct zink_context *ctx, struct pipe_surface **psurface)
simple_mtx_lock(&screen->surface_mtx);
struct hash_entry *new_entry = _mesa_hash_table_search_pre_hashed(&screen->surface_cache, hash, &ivci);
if (zink_batch_usage_exists(surface->batch_uses))
zink_batch_reference_surface(&ctx->batch, surface);
surface_clear_fb_refs(screen, *psurface);
zink_descriptor_set_refs_clear(&surface->desc_set_refs, surface);
if (new_entry) {