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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13490>
This commit is contained in:
Mike Blumenkrantz 2021-10-22 14:32:40 -04:00 committed by Marge Bot
parent dabe477b4f
commit 1a68f2eb8f

View file

@ -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;
}