From 0810f15046f3bcbcb8c9c9895e2b676b97720df1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 21 Jun 2018 18:52:47 -0400 Subject: [PATCH] radeonsi: stop using lp_build_alloc Reviewed-by: Timothy Arceri --- src/gallium/drivers/radeonsi/si_shader.c | 7 +++---- .../drivers/radeonsi/si_shader_tgsi_setup.c | 19 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 133cb556ae7..9bc679f3296 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -6158,7 +6158,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx) sel->tcs_info.tessfactors_are_def_in_all_invocs) { for (unsigned i = 0; i < 6; i++) { ctx->invoc0_tess_factors[i] = - lp_build_alloca_undef(&ctx->gallivm, ctx->i32, ""); + ac_build_alloca_undef(&ctx->ac, ctx->i32, ""); } } @@ -6166,13 +6166,12 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx) int i; for (i = 0; i < 4; i++) { ctx->gs_next_vertex[i] = - lp_build_alloca(&ctx->gallivm, - ctx->i32, ""); + ac_build_alloca(&ctx->ac, ctx->i32, ""); } } if (sel->force_correct_derivs_after_kill) { - ctx->postponed_kill = lp_build_alloca_undef(&ctx->gallivm, ctx->i1, ""); + ctx->postponed_kill = ac_build_alloca_undef(&ctx->ac, ctx->i1, ""); /* true = don't kill. */ LLVMBuildStore(ctx->ac.builder, LLVMConstInt(ctx->i1, 1, 0), ctx->postponed_kill); diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 4fd44549f7a..de3a6cbf0d7 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -625,9 +625,8 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) { unsigned chan; for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) { - ctx->addrs[idx][chan] = lp_build_alloca_undef( - &ctx->gallivm, - ctx->i32, ""); + ctx->addrs[idx][chan] = ac_build_alloca_undef( + &ctx->ac, ctx->i32, ""); } } break; @@ -672,7 +671,7 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, */ if (array_size > 16 || !ctx->screen->llvm_has_working_vgpr_indexing) { - array_alloca = lp_build_alloca_undef(&ctx->gallivm, + array_alloca = ac_build_alloca_undef(&ctx->ac, LLVMArrayType(ctx->f32, array_size), "array"); ctx->temp_array_allocas[id] = array_alloca; @@ -690,7 +689,7 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, first + i / 4, "xyzw"[i % 4]); #endif ctx->temps[first * TGSI_NUM_CHANNELS + i] = - lp_build_alloca_undef(&ctx->gallivm, + ac_build_alloca_undef(&ctx->ac, ctx->f32, name); } @@ -708,9 +707,8 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, * a shader ever reads from a channel that * it never writes to. */ - ctx->undef_alloca = lp_build_alloca_undef( - &ctx->gallivm, - ctx->f32, "undef"); + ctx->undef_alloca = ac_build_alloca_undef( + &ctx->ac, ctx->f32, "undef"); } for (i = 0; i < decl_size; ++i) { @@ -774,9 +772,8 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base, snprintf(name, sizeof(name), "OUT%d.%c", idx, "xyzw"[chan % 4]); #endif - ctx->outputs[idx][chan] = lp_build_alloca_undef( - &ctx->gallivm, - ctx->f32, name); + ctx->outputs[idx][chan] = ac_build_alloca_undef( + &ctx->ac, ctx->f32, name); } } break; -- 2.30.2