From 0a6f5ec942158af5ff0e0d9171a621bf0acfae87 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 22 Oct 2021 14:33:29 -0400 Subject: [PATCH] zink: don't check rebind count outside of buffer/image rebind function zink_resource_has_binds() only checks descriptor binds, and this doesn't include streamout or fb bindings, so call these functions from the specific rebind points to ensure those cases are also checked fixes #5541 cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index b2ecb048f56..7ebd1cc665d 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3768,6 +3768,9 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi unsigned num_rebinds = 0; bool has_write = false; + if (!zink_resource_has_binds(res)) + return 0; + assert(!res->bindless[1]); //TODO if ((rebind_mask & BITFIELD_BIT(TC_BINDING_STREAMOUT_BUFFER)) || (!rebind_mask && res->so_bind_count && ctx->num_so_targets)) { for (unsigned i = 0; i < ctx->num_so_targets; i++) { @@ -3919,8 +3922,6 @@ rebind_image(struct zink_context *ctx, struct zink_resource *res) bool zink_resource_rebind(struct zink_context *ctx, struct zink_resource *res) { - if (!zink_resource_has_binds(res)) - return 0; if (res->base.b.target == PIPE_BUFFER) { /* force counter buffer reset */ res->so_valid = false;