Mesa (main): zink: use sampler_bind_count to simplify some code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 15 14:35:38 UTC 2022


Module: Mesa
Branch: main
Commit: 960a6316d4f817ed20ea261e6f10baf22bc9abbd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=960a6316d4f817ed20ea261e6f10baf22bc9abbd

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jul 11 21:49:55 2022 -0400

zink: use sampler_bind_count to simplify some code

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17524>

---

 src/gallium/drivers/zink/zink_context.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 92f28dcbf32..82e9dc9ba97 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -2354,8 +2354,8 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns
       layout = zink_render_pass_attachment_get_barrier_info(&rt, i < ctx->fb_state.nr_cbufs, &pipeline, &access);
    }
    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];
+   if (i == ctx->fb_state.nr_cbufs && res->sampler_bind_count[0]) {
+      unsigned find = res->sampler_bind_count[0];
       for (unsigned i = 0; find && i < PIPE_SHADER_COMPUTE; i++) {
          u_foreach_bit(slot, res->sampler_binds[i]) {
             /* only set layout, skip rest of update */



More information about the mesa-commit mailing list