From 8294d454245d4318befac7c8915e55db3d47cefd Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 17 Mar 2022 11:29:30 -0400 Subject: [PATCH] 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 Part-of: --- src/gallium/drivers/zink/zink_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index c969016f26b..a79ab9d0913 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3926,7 +3926,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; }