From a845baff169d503386f6eaa22adecc3fa67071db Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 26 Jun 2019 15:49:16 +1000 Subject: [PATCH] gallivm: move mask_vec function up higher so it can be reused. Reviewed-by: Roland Scheidegger --- .../auxiliary/gallivm/lp_bld_tgsi_soa.c | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index edc66c4a37e..c8002c232d5 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -133,6 +133,21 @@ mask_has_loop(struct lp_exec_mask *mask) return FALSE; } +static LLVMValueRef +mask_vec(struct lp_build_tgsi_context *bld_base) +{ + struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base); + LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder; + struct lp_exec_mask *exec_mask = &bld->exec_mask; + + if (!exec_mask->has_mask) { + return lp_build_mask_value(bld->mask); + } + return LLVMBuildAnd(builder, lp_build_mask_value(bld->mask), + exec_mask->exec_mask, ""); +} + + /* * Returns true if we're inside a switch statement. * It's global, meaning that it returns true even if there's @@ -3356,20 +3371,6 @@ lod_emit( FALSE, LP_SAMPLER_OP_LODQ, emit_data->output); } -static LLVMValueRef -mask_vec(struct lp_build_tgsi_context *bld_base) -{ - struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base); - LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder; - struct lp_exec_mask *exec_mask = &bld->exec_mask; - - if (!exec_mask->has_mask) { - return lp_build_mask_value(bld->mask); - } - return LLVMBuildAnd(builder, lp_build_mask_value(bld->mask), - exec_mask->exec_mask, ""); -} - static void increment_vec_ptr_by_mask(struct lp_build_tgsi_context * bld_base, LLVMValueRef ptr, -- 2.30.2