Mesa (master): nir: get_base_type() should return enum type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 21:45:18 UTC 2020


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Jun  3 12:07:52 2020 -0700

nir: get_base_type() should return enum type

Needed by the next patch, for c++ code which is more strict about
conversions between integers and enums.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5318>

---

 src/compiler/nir/nir.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index b7f7e46c9b0..a673a2a8f31 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1023,10 +1023,10 @@ nir_alu_type_get_type_size(nir_alu_type type)
    return type & NIR_ALU_TYPE_SIZE_MASK;
 }
 
-static inline unsigned
+static inline nir_alu_type
 nir_alu_type_get_base_type(nir_alu_type type)
 {
-   return type & NIR_ALU_TYPE_BASE_TYPE_MASK;
+   return (nir_alu_type)(type & NIR_ALU_TYPE_BASE_TYPE_MASK);
 }
 
 static inline nir_alu_type



More information about the mesa-commit mailing list