diff options
author | Marek Olšák <[email protected]> | 2019-07-05 23:22:33 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-19 20:16:19 -0400 |
commit | 2683347ba0394a5e17223aab2f685775f87e1fac (patch) | |
tree | 4d621edb6fc1d660562ea26801cdf529763bab4c | |
parent | 1b4354dab9f81c92ff83f98d8d65e3c9d304d421 (diff) |
radeonsi/gfx10: don't use MALLOC for outputs
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/gfx10_shader_ngg.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c index 74be6df30f9..e074449064a 100644 --- a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c +++ b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c @@ -521,7 +521,7 @@ void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, struct si_shader_context *ctx = si_shader_context_from_abi(abi); struct si_shader_selector *sel = ctx->shader->selector; struct tgsi_shader_info *info = &sel->info; - struct si_shader_output_values *outputs = NULL; + struct si_shader_output_values outputs[PIPE_MAX_SHADER_OUTPUTS]; LLVMBuilderRef builder = ctx->ac.builder; struct lp_build_if_state if_state; LLVMValueRef tmp, tmp2; @@ -529,8 +529,6 @@ void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, assert(!ctx->shader->is_gs_copy_shader); assert(info->num_outputs <= max_outputs); - outputs = MALLOC((info->num_outputs + 1) * sizeof(outputs[0])); - LLVMValueRef vertex_ptr = NULL; if (sel->so.num_outputs) @@ -756,8 +754,6 @@ void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, si_llvm_export_vs(ctx, outputs, i); } lp_build_endif(&if_state); - - FREE(outputs); } static LLVMValueRef @@ -1206,8 +1202,7 @@ void gfx10_ngg_gs_emit_epilogue(struct si_shader_context *ctx) tmp = LLVMBuildICmp(builder, LLVMIntULT, tid, vertlive_scan.result_reduce, ""); ac_build_ifcc(&ctx->ac, tmp, 5145); { - struct si_shader_output_values *outputs = NULL; - outputs = MALLOC(info->num_outputs * sizeof(outputs[0])); + struct si_shader_output_values outputs[PIPE_MAX_SHADER_OUTPUTS]; tmp = ngg_gs_vertex_ptr(ctx, tid); LLVMValueRef gep_idx[3] = { @@ -1237,8 +1232,6 @@ void gfx10_ngg_gs_emit_epilogue(struct si_shader_context *ctx) } si_llvm_export_vs(ctx, outputs, info->num_outputs); - - FREE(outputs); } ac_build_endif(&ctx->ac, 5145); } |