summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-29 09:17:53 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-31 15:00:22 +0200
commit2879a602dd5d133c792d262b6be98aa6f810c16d (patch)
treeff4295818e3dbff895212b0e90bbef0078fc30f0
parentdfe237aef9e39c02df92299fb30c44d3534dc524 (diff)
radeonsi: ensure that temp array allocas are in the entry block
Otherwise, code generation fails. This has become necessary since some shaders are wrapped in control flow. Fixes: 081ac6e5c6d2 ("radeonsi/gfx9: always wrap GS and TCS in an if-block (v2)") Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
index 9c4a2343f5..df37267d37 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c
@@ -756,7 +756,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 = LLVMBuildAlloca(builder,
+ array_alloca = lp_build_alloca_undef(&ctx->gallivm,
LLVMArrayType(ctx->f32,
array_size), "array");
ctx->temp_array_allocas[id] = array_alloca;