Mesa (main): zink: use correct type for u_bit_scan

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 15 15:04:19 UTC 2021


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Jun 14 11:59:04 2021 +0200

zink: use correct type for u_bit_scan

Since we're going to iterate over each bit of this variable using
u_bit_scan, we should make sure we use an unsigned int for the variable.

While this works on GCC, it's not guaranteed to work, and produces a
warning on MSVC.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11358>

---

 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index c3d9dd04459..bb47ce30078 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -153,7 +153,7 @@ block_label(struct ntv_context *ctx, nir_block *block)
 static void
 emit_access_decorations(struct ntv_context *ctx, nir_variable *var, SpvId var_id)
 {
-    enum gl_access_qualifier access = var->data.access;
+    unsigned access = var->data.access;
     while (access) {
        unsigned bit = u_bit_scan(&access);
        switch (1 << bit) {



More information about the mesa-commit mailing list