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>
This commit is contained in:
Mike Blumenkrantz 2022-03-17 11:29:30 -04:00 committed by Marge Bot
parent 7da211e24f
commit 8294d45424

View file

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