From 1a68f2eb8f4818944d656b8d0f9102c576815800 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 22 Oct 2021 14:32:40 -0400 Subject: [PATCH] zink: only reset zink_resource::so_valid on buffer rebind otherwise this is going to randomly modify some image properties cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 0ecfd8540db..b2ecb048f56 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3919,12 +3919,13 @@ rebind_image(struct zink_context *ctx, struct zink_resource *res) bool zink_resource_rebind(struct zink_context *ctx, struct zink_resource *res) { - /* force counter buffer reset */ - res->so_valid = false; if (!zink_resource_has_binds(res)) - return true; - if (res->base.b.target == PIPE_BUFFER) + return 0; + if (res->base.b.target == PIPE_BUFFER) { + /* force counter buffer reset */ + res->so_valid = false; return rebind_buffer(ctx, res, 0, 0) == res->bind_count[0] + res->bind_count[1]; + } rebind_image(ctx, res); return false; }