diff options
author | Marek Olšák <[email protected]> | 2017-09-29 16:23:45 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-10-06 02:56:11 +0200 |
commit | 723a23905f475670e8866c86ccb73ead4ee05d50 (patch) | |
tree | fa2912d56336cb66ee3e54d2749c0bee30017226 /src | |
parent | b4600b474069d77ef889f0e79093c8e7f6b767e4 (diff) |
radeonsi: don't use lp_build_const_*
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c index 242f056e7bd..972b26f2acc 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c @@ -33,7 +33,6 @@ static void kill_if_fetch_args(struct lp_build_tgsi_context *bld_base, { const struct tgsi_full_instruction *inst = emit_data->inst; struct si_shader_context *ctx = si_shader_context(bld_base); - struct gallivm_state *gallivm = bld_base->base.gallivm; LLVMBuilderRef builder = ctx->ac.builder; unsigned i; LLVMValueRef conds[TGSI_NUM_CHANNELS]; @@ -52,7 +51,7 @@ static void kill_if_fetch_args(struct lp_build_tgsi_context *bld_base, emit_data->dst_type = ctx->voidt; emit_data->arg_count = 1; emit_data->args[0] = LLVMBuildSelect(builder, conds[0], - lp_build_const_float(gallivm, -1.0f), + LLVMConstReal(ctx->f32, -1.0f), bld_base->base.zero, ""); } @@ -476,7 +475,6 @@ static void emit_bfi(const struct lp_build_tgsi_action *action, struct lp_build_emit_data *emit_data) { struct si_shader_context *ctx = si_shader_context(bld_base); - struct gallivm_state *gallivm = bld_base->base.gallivm; LLVMBuilderRef builder = ctx->ac.builder; LLVMValueRef bfi_args[3]; LLVMValueRef bfi_sm5; @@ -511,7 +509,7 @@ static void emit_bfi(const struct lp_build_tgsi_action *action, * and disagrees with GLSL semantics when bits (src3) is 32. */ cond = LLVMBuildICmp(builder, LLVMIntUGE, emit_data->args[3], - lp_build_const_int32(gallivm, 32), ""); + LLVMConstInt(ctx->i32, 32, 0), ""); emit_data->output[emit_data->chan] = LLVMBuildSelect(builder, cond, emit_data->args[1], bfi_sm5, ""); } @@ -541,7 +539,6 @@ static void emit_lsb(const struct lp_build_tgsi_action *action, struct lp_build_emit_data *emit_data) { struct si_shader_context *ctx = si_shader_context(bld_base); - struct gallivm_state *gallivm = bld_base->base.gallivm; LLVMValueRef args[2] = { emit_data->args[0], @@ -566,7 +563,7 @@ static void emit_lsb(const struct lp_build_tgsi_action *action, LLVMBuildSelect(ctx->ac.builder, LLVMBuildICmp(ctx->ac.builder, LLVMIntEQ, args[0], ctx->i32_0, ""), - lp_build_const_int32(gallivm, -1), lsb, ""); + LLVMConstInt(ctx->i32, -1, 0), lsb, ""); } /* Find the last bit set. */ @@ -675,13 +672,12 @@ static void emit_up2h(const struct lp_build_tgsi_action *action, struct lp_build_emit_data *emit_data) { struct si_shader_context *ctx = si_shader_context(bld_base); - struct lp_build_context *uint_bld = &bld_base->uint_bld; LLVMTypeRef i16; LLVMValueRef const16, input, val; unsigned i; i16 = LLVMInt16TypeInContext(ctx->ac.context); - const16 = lp_build_const_int32(uint_bld->gallivm, 16); + const16 = LLVMConstInt(ctx->i32, 16, 0); input = emit_data->args[0]; for (i = 0; i < 2; i++) { diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 6a8668110c8..31d7924e0e3 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -1193,7 +1193,7 @@ void si_llvm_context_init(struct si_shader_context *ctx, /* metadata allowing 2.5 ULP */ ctx->fpmath_md_kind = LLVMGetMDKindIDInContext(ctx->ac.context, "fpmath", 6); - LLVMValueRef arg = lp_build_const_float(&ctx->gallivm, 2.5); + LLVMValueRef arg = LLVMConstReal(ctx->ac.f32, 2.5); ctx->fpmath_md_2p5_ulp = LLVMMDNodeInContext(ctx->ac.context, &arg, 1); |