Mesa (main): zink: store the real (non-compact) binding usage for programs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 1 02:33:38 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri May 27 15:01:52 2022 -0400

zink: store the real (non-compact) binding usage for programs

this is useful for quickly determining whether a program has a certain
type of descriptor usage

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

---

 src/gallium/drivers/zink/zink_descriptors.h      | 1 +
 src/gallium/drivers/zink/zink_descriptors_lazy.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_descriptors.h b/src/gallium/drivers/zink/zink_descriptors.h
index d0ea7a95d20..38651d10e0b 100644
--- a/src/gallium/drivers/zink/zink_descriptors.h
+++ b/src/gallium/drivers/zink/zink_descriptors.h
@@ -158,6 +158,7 @@ struct zink_program_descriptor_data {
    bool bindless;
    bool fbfetch;
    uint8_t binding_usage;
+   uint8_t real_binding_usage;
    struct zink_descriptor_pool_key *pool_key[ZINK_DESCRIPTOR_TYPES]; //push set doesn't need one
    struct zink_descriptor_layout *layouts[ZINK_DESCRIPTOR_TYPES + 1];
    VkDescriptorUpdateTemplateKHR templates[ZINK_DESCRIPTOR_TYPES + 1];
diff --git a/src/gallium/drivers/zink/zink_descriptors_lazy.c b/src/gallium/drivers/zink/zink_descriptors_lazy.c
index f878706143b..b8f12368a79 100644
--- a/src/gallium/drivers/zink/zink_descriptors_lazy.c
+++ b/src/gallium/drivers/zink/zink_descriptors_lazy.c
@@ -225,6 +225,7 @@ zink_descriptor_program_init_lazy(struct zink_context *ctx, struct zink_program
             init_template_entry(shader, j, k, &entries[desc_set][entry_idx[desc_set]], &entry_idx[desc_set], screen->descriptor_mode == ZINK_DESCRIPTOR_MODE_LAZY);
             num_bindings[desc_set]++;
             has_bindings |= BITFIELD_BIT(desc_set);
+            pg->dd->real_binding_usage |= BITFIELD_BIT(j);
          }
          num_type_sizes[desc_set] = screen->compact_descriptors ?
                                     descriptor_program_num_sizes_compact(sizes, desc_set) :



More information about the mesa-commit mailing list