radeonsi: stop using lp_build_alloc
authorMarek Olšák <marek.olsak@amd.com>
Thu, 21 Jun 2018 22:52:47 +0000 (18:52 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 25 Jun 2018 22:33:58 +0000 (18:33 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index 133cb556ae744f47333ff309e07e6d58188b1450..9bc679f3296f24e848e64ca2f3a08f24bb50b1d0 100644 (file)
@@ -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);
index 4fd44549f7ac091bdb8268b59487e0325f19ae3c..de3a6cbf0d76fe85f42909ea0f74a82147dc5cc2 100644 (file)
@@ -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;