Mesa (main): zink: make samplerview bind mask apply to buffer resources too

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 7 01:42:34 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue May 11 10:13:45 2021 -0400

zink: make samplerview bind mask apply to buffer resources too

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

---

 src/gallium/drivers/zink/zink_context.c  | 5 ++---
 src/gallium/drivers/zink/zink_resource.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 0602d3e13bb..708aed3d346 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1338,8 +1338,7 @@ unbind_samplerview(struct zink_context *ctx, enum pipe_shader_type stage, unsign
    struct zink_resource *res = zink_resource(sv->base.texture);
    check_samplerview_for_batch_ref(ctx, sv);
    update_res_bind_count(ctx, res, stage == PIPE_SHADER_COMPUTE, true);
-   if (!res->obj->is_buffer)
-      res->sampler_binds[stage] &= ~BITFIELD_BIT(slot);
+   res->sampler_binds[stage] &= ~BITFIELD_BIT(slot);
 }
 
 static void
@@ -1401,12 +1400,12 @@ zink_set_sampler_views(struct pipe_context *pctx,
              } else  if (a != b)
                 update = true;
              flush_pending_clears(ctx, res);
-             res->sampler_binds[shader_type] |= BITFIELD_BIT(start_slot + i);
              check_for_layout_update(ctx, res, shader_type == PIPE_SHADER_COMPUTE);
              zink_batch_usage_set(&b->image_view->batch_uses, ctx->batch.state);
              if (!a)
                 update = true;
          }
+         res->sampler_binds[shader_type] |= BITFIELD_BIT(start_slot + i);
          zink_batch_resource_usage_set(&ctx->batch, res, false);
       } else if (a) {
          unbind_samplerview(ctx, shader_type, start_slot + i);
diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h
index d92258d8164..bd447898e0f 100644
--- a/src/gallium/drivers/zink/zink_resource.h
+++ b/src/gallium/drivers/zink/zink_resource.h
@@ -114,11 +114,11 @@ struct zink_resource {
          VkImageLayout layout;
          VkImageAspectFlags aspect;
          bool optimal_tiling;
-         uint32_t sampler_binds[PIPE_SHADER_TYPES];
          uint8_t fb_binds;
          uint16_t image_bind_count[2]; //gfx, compute
       };
    };
+   uint32_t sampler_binds[PIPE_SHADER_TYPES];
    uint16_t write_bind_count[2]; //gfx, compute
    uint16_t bind_count[2]; //gfx, compute
 



More information about the mesa-commit mailing list