zink: only update usage on buffer rebind if rebinds occurred

this is a harmless case, but it's still wrong

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>
(cherry picked from commit 8294d45424)
This commit is contained in:
Mike Blumenkrantz 2022-03-17 11:29:30 -04:00 committed by Dylan Baker
parent e5af048e71
commit 8c4d047a73

View file

@ -3898,7 +3898,8 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
}
}
end:
zink_batch_resource_usage_set(&ctx->batch, res, has_write);
if (num_rebinds)
zink_batch_resource_usage_set(&ctx->batch, res, has_write);
return num_rebinds;
}