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

Author: Dave Airlie <[email protected]>
Date:   Fri Mar 19 11:58:18 2021 +1000

gallivm: move get_flt_bld to header.

Rewrite a little as we have to add 16-bit support later in life

Reviewed-by: Roland Scheidegger <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9645>

---

 src/gallium/auxiliary/gallivm/lp_bld_nir.c |  9 ---------
 src/gallium/auxiliary/gallivm/lp_bld_nir.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c 
b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
index f21f0a21caa..db7ce2023b6 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c
@@ -97,15 +97,6 @@ static LLVMValueRef cast_type(struct lp_build_nir_context 
*bld_base, LLVMValueRe
 }
 
 
-static struct lp_build_context *get_flt_bld(struct lp_build_nir_context 
*bld_base,
-                                            unsigned op_bit_size)
-{
-   if (op_bit_size == 64)
-      return &bld_base->dbl_bld;
-   else
-      return &bld_base->base;
-}
-
 static unsigned glsl_sampler_to_pipe(int sampler_dim, bool is_array)
 {
    unsigned pipe_target = PIPE_BUFFER;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.h 
b/src/gallium/auxiliary/gallivm/lp_bld_nir.h
index 45b8794c9f7..9de1ccbd16f 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_nir.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.h
@@ -272,6 +272,17 @@ lp_nir_array_build_gather_values(LLVMBuilderRef builder,
    return arr;
 }
 
+static inline struct lp_build_context *get_flt_bld(struct lp_build_nir_context 
*bld_base,
+                                                   unsigned op_bit_size)
+{
+   switch (op_bit_size) {
+   case 64:
+      return &bld_base->dbl_bld;
+   default:
+   case 32:
+      return &bld_base->base;
+   }
+}
 
 static inline struct lp_build_context *get_int_bld(struct lp_build_nir_context 
*bld_base,
                                                    bool is_unsigned,

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to