zink: fix buffer rebind early-out check

this was accidentally inverted; the rebind attempt is over if the
number of enacted rebinds >= the expected rebinds

Fixes: c32bcb9a8c ("zink: improve handling of buffer rebinds using tc info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26959>
This commit is contained in:
Mike Blumenkrantz 2024-01-10 10:27:45 -05:00 committed by Marge Bot
parent 8ddd89ffa5
commit 6e4d901a2e

View file

@ -4374,7 +4374,7 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
}
rebind_mask &= ~BITFIELD_BIT(TC_BINDING_STREAMOUT_BUFFER);
}
if (num_rebinds && expected_num_rebinds >= num_rebinds && !rebind_mask)
if (expected_num_rebinds && num_rebinds >= expected_num_rebinds && !rebind_mask)
goto end;
if ((rebind_mask & BITFIELD_BIT(TC_BINDING_VERTEX_BUFFER)) || (!rebind_mask && res->vbo_bind_mask)) {
@ -4389,7 +4389,7 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
rebind_mask &= ~BITFIELD_BIT(TC_BINDING_VERTEX_BUFFER);
ctx->vertex_buffers_dirty = true;
}
if (num_rebinds && expected_num_rebinds >= num_rebinds && !rebind_mask)
if (expected_num_rebinds && num_rebinds >= expected_num_rebinds && !rebind_mask)
goto end;
const uint32_t ubo_mask = rebind_mask ?
@ -4405,7 +4405,7 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
}
}
rebind_mask &= ~BITFIELD_RANGE(TC_BINDING_UBO_VS, MESA_SHADER_STAGES);
if (num_rebinds && expected_num_rebinds >= num_rebinds && !rebind_mask)
if (expected_num_rebinds && num_rebinds >= expected_num_rebinds && !rebind_mask)
goto end;
const unsigned ssbo_mask = rebind_mask ?
@ -4422,7 +4422,7 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
}
}
rebind_mask &= ~BITFIELD_RANGE(TC_BINDING_SSBO_VS, MESA_SHADER_STAGES);
if (num_rebinds && expected_num_rebinds >= num_rebinds && !rebind_mask)
if (expected_num_rebinds && num_rebinds >= expected_num_rebinds && !rebind_mask)
goto end;
const unsigned sampler_mask = rebind_mask ?
rebind_mask & BITFIELD_RANGE(TC_BINDING_SAMPLERVIEW_VS, MESA_SHADER_STAGES) :
@ -4437,7 +4437,7 @@ rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uint32_t rebi
}
}
rebind_mask &= ~BITFIELD_RANGE(TC_BINDING_SAMPLERVIEW_VS, MESA_SHADER_STAGES);
if (num_rebinds && expected_num_rebinds >= num_rebinds && !rebind_mask)
if (expected_num_rebinds && num_rebinds >= expected_num_rebinds && !rebind_mask)
goto end;
const unsigned image_mask = rebind_mask ?