Mesa (master): util/panfrost/glsl: rename BITSET_LAST_BIT to BITSET_LAST_BIT_SIZED

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 9 21:04:32 UTC 2021


Module: Mesa
Branch: master
Commit: 0e1afe7c70a9037b6038ffac3a8c11c58a97df90
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e1afe7c70a9037b6038ffac3a8c11c58a97df90

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Mar  9 11:17:17 2021 +1000

util/panfrost/glsl: rename BITSET_LAST_BIT to BITSET_LAST_BIT_SIZED

The current users all pass in the number of dwords, but I'd like
to provide an interface that doess ARRAY_SIZE implicitly.

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9456>

---

 src/compiler/glsl/gl_nir_link_uniforms.c    | 2 +-
 src/panfrost/midgard/mir_promote_uniforms.c | 2 +-
 src/util/bitset.h                           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c
index 008f07d287e..05bce275f79 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++ b/src/compiler/glsl/gl_nir_link_uniforms.c
@@ -134,7 +134,7 @@ update_array_sizes(struct gl_shader_program *prog, nir_variable *var,
          _mesa_hash_table_search(referenced_uniforms[stage], var->name);
       if (entry) {
          ainfo = (struct uniform_array_info *)  entry->data;
-         max_array_size = MAX2(BITSET_LAST_BIT(ainfo->indices, words),
+         max_array_size = MAX2(BITSET_LAST_BIT_SIZED(ainfo->indices, words),
                                max_array_size);
       }
 
diff --git a/src/panfrost/midgard/mir_promote_uniforms.c b/src/panfrost/midgard/mir_promote_uniforms.c
index 19525efbc59..aead024130d 100644
--- a/src/panfrost/midgard/mir_promote_uniforms.c
+++ b/src/panfrost/midgard/mir_promote_uniforms.c
@@ -128,7 +128,7 @@ mir_dump_ubo_analysis(struct mir_ubo_analysis *res)
                 BITSET_WORD *uses = res->blocks[i].uses;
                 BITSET_WORD *push = res->blocks[i].pushed;
 
-                unsigned last = BITSET_LAST_BIT(uses, BITSET_WORDS(MAX_UBO_QWORDS));
+                unsigned last = BITSET_LAST_BIT_SIZED(uses, BITSET_WORDS(MAX_UBO_QWORDS));
 
                 printf("\t");
 
diff --git a/src/util/bitset.h b/src/util/bitset.h
index 5313f85fcee..61f6db8f4d1 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -109,7 +109,7 @@ __bitset_last_bit(const BITSET_WORD *x, int n)
 }
 
 #define BITSET_FFS(x) __bitset_ffs(x, ARRAY_SIZE(x))
-#define BITSET_LAST_BIT(x, size) __bitset_last_bit(x, size)
+#define BITSET_LAST_BIT_SIZED(x, size) __bitset_last_bit(x, size)
 
 static inline unsigned
 __bitset_next_set(unsigned i, BITSET_WORD *tmp,



More information about the mesa-commit mailing list