commit 2ed8d084b995ba06d4831f7c8ecb64f904c9cffb Author: Michel Dänzer Date: Tue Oct 28 11:28:29 2014 +0900 radeon/llvm: Increase maximum branch depth diff --git a/src/gallium/drivers/radeon/radeon_llvm.h b/src/gallium/drivers/radeon/radeon_llvm.h index 00714fb..fe27ab6 100644 --- a/src/gallium/drivers/radeon/radeon_llvm.h +++ b/src/gallium/drivers/radeon/radeon_llvm.h @@ -33,7 +33,7 @@ #define RADEON_LLVM_MAX_INPUTS 32 * 4 #define RADEON_LLVM_MAX_OUTPUTS 32 * 4 -#define RADEON_LLVM_MAX_BRANCH_DEPTH 16 +#define RADEON_LLVM_MAX_BRANCH_DEPTH 64 #define RADEON_LLVM_MAX_LOOP_DEPTH 16 #define RADEON_LLVM_MAX_ARRAYS 16 diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index 2fa23ed..cf5d4fd 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -33,6 +33,7 @@ #include "gallivm/lp_bld_swizzle.h" #include "tgsi/tgsi_info.h" #include "tgsi/tgsi_parse.h" +#include "util/macros.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_debug.h" @@ -447,6 +448,7 @@ static void bgnloop_emit( LLVMBuildBr(gallivm->builder, loop_block); LLVMPositionBuilderAtEnd(gallivm->builder, loop_block); ctx->loop_depth++; + assert(ctx->loop_depth < ARRAY_SIZE(ctx->loop)); ctx->loop[ctx->loop_depth - 1].loop_block = loop_block; ctx->loop[ctx->loop_depth - 1].endloop_block = endloop_block; } @@ -578,6 +580,7 @@ static void if_cond_emit( LLVMPositionBuilderAtEnd(gallivm->builder, if_block); ctx->branch_depth++; + assert(ctx->branch_depth < ARRAY_SIZE(ctx->branch)); ctx->branch[ctx->branch_depth - 1].endif_block = endif_block; ctx->branch[ctx->branch_depth - 1].if_block = if_block; ctx->branch[ctx->branch_depth - 1].else_block = else_block;