zink: break out of zs mixed layout update loop when work is done
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 7 Jun 2022 00:54:25 +0000 (20:54 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Jun 2022 02:55:05 +0000 (02:55 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16900>

src/gallium/drivers/zink/zink_context.c

index a05a6b0..4960f9a 100644 (file)
@@ -2212,7 +2212,7 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns
    zink_resource_image_barrier(ctx, res, layout, access, pipeline);
    if (i == ctx->fb_state.nr_cbufs && res->bind_count[0] && res->bind_count[0] != res->image_bind_count[0]) {
       unsigned find = res->bind_count[0] - res->image_bind_count[0];
-      for (unsigned i = 0; i < PIPE_SHADER_COMPUTE; i++) {
+      for (unsigned i = 0; find && i < PIPE_SHADER_COMPUTE; i++) {
          u_foreach_bit(slot, res->sampler_binds[i]) {
             update_descriptor_state_sampler(ctx, i, slot, res);
             find--;