diff options
author | Brian Paul <brianp@vmware.com> | 2022-05-18 20:59:14 -0600 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-15 12:30:04 +0000 |
commit | 3d6192c0b8897ba66085403f465c64dea73ddb38 (patch) | |
tree | 6780043c989e94fe1a3ce08aecd54bf283189eef | |
parent | aa9bd004a93ab7a5caf4c1c978996d5168b6f5e6 (diff) |
gallivm: clean-up in lp_bld_nir.h
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16937>
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_nir.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.h b/src/gallium/auxiliary/gallivm/lp_bld_nir.h index 1ca26caf9a0..6c40d982ad1 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.h @@ -309,11 +309,14 @@ struct lp_build_nir_aos_context const struct lp_build_sampler_aos *sampler; }; + bool lp_build_nir_llvm(struct lp_build_nir_context *bld_base, struct nir_shader *nir); -void lp_build_opt_nir(struct nir_shader *nir); +void +lp_build_opt_nir(struct nir_shader *nir); + static inline LLVMValueRef lp_nir_array_build_gather_values(LLVMBuilderRef builder, @@ -322,16 +325,17 @@ lp_nir_array_build_gather_values(LLVMBuilderRef builder, { LLVMTypeRef arr_type = LLVMArrayType(LLVMTypeOf(values[0]), value_count); LLVMValueRef arr = LLVMGetUndef(arr_type); - unsigned i; - for (i = 0; i < value_count; i++) { + for (unsigned i = 0; i < value_count; i++) { arr = LLVMBuildInsertValue(builder, arr, values[i], i, ""); } return arr; } -static inline struct lp_build_context *get_flt_bld(struct lp_build_nir_context *bld_base, - unsigned op_bit_size) + +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: @@ -344,9 +348,11 @@ static inline struct lp_build_context *get_flt_bld(struct lp_build_nir_context * } } -static inline struct lp_build_context *get_int_bld(struct lp_build_nir_context *bld_base, - bool is_unsigned, - unsigned op_bit_size) + +static inline struct lp_build_context * +get_int_bld(struct lp_build_nir_context *bld_base, + bool is_unsigned, + unsigned op_bit_size) { if (is_unsigned) { switch (op_bit_size) { @@ -375,11 +381,16 @@ static inline struct lp_build_context *get_int_bld(struct lp_build_nir_context * } } + static inline struct lp_build_nir_aos_context * lp_nir_aos_context(struct lp_build_nir_context *bld_base) { - return (struct lp_build_nir_aos_context *)bld_base; + return (struct lp_build_nir_aos_context *) bld_base; } -LLVMValueRef lp_nir_aos_conv_const(struct gallivm_state *gallivm, LLVMValueRef constval, int nc); + +LLVMValueRef +lp_nir_aos_conv_const(struct gallivm_state *gallivm, + LLVMValueRef constval, int nc); + #endif |