Mesa (main): pan/bi: Add explicit cast for lod_or_mode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 22 18:17:45 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Jul 21 15:14:17 2021 -0400

pan/bi: Add explicit cast for lod_or_mode

The enums alias. Fixes the following warning under clang:

../src/panfrost/bifrost/bifrost_compile.c:2515:25: warning: implicit conversion from enumeration type 'enum bifrost_texture_fetch' to different enumeration type 'enum bifrost_lod_mode' [-Wenum-conversion]
                        BIFROST_TEXTURE_FETCH_TEXEL;

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12003>

---

 src/panfrost/bifrost/bifrost_compile.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 4b347fe3cfa..e9ec6f7c637 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -2510,9 +2510,10 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr)
                 computed_lod = true;
                 break;
         case BIFROST_TEX_OP_FETCH:
-                desc.lod_or_fetch = instr->op == nir_texop_tg4 ?
+                desc.lod_or_fetch = (enum bifrost_lod_mode)
+                   (instr->op == nir_texop_tg4 ?
                         BIFROST_TEXTURE_FETCH_GATHER4_R + instr->component :
-                        BIFROST_TEXTURE_FETCH_TEXEL;
+                        BIFROST_TEXTURE_FETCH_TEXEL);
                 break;
         default:
                 unreachable("texture op unsupported");



More information about the mesa-commit mailing list