diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-05-11 09:22:25 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-07-07 00:22:10 +0000 |
commit | 447ba04d87aac19f6162ca5e0414c2f4a7421561 (patch) | |
tree | c4fe013f382444b7b1c7f2016057d032ef261de5 /src/gallium | |
parent | 59b142ae03c41dd93d093efba04a60c92761af2d (diff) |
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>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/zink/zink_surface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 1ec88765f44..7cfc211e14a 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -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) { |