diff options
author | Marek Olšák <[email protected]> | 2018-06-23 01:39:02 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-06-28 22:27:25 -0400 |
commit | 0c554bc5d5f5bc181d157811abd074c033c8cf6f (patch) | |
tree | ca11d58890c9251304a87d249b6da78c6d92ba93 /src/gallium/drivers/radeonsi/si_shader.c | |
parent | 7bac3b589cd542f037ab225797090b9da116eced (diff) |
radeonsi: don't use malloc in si_generate_gs_copy_shader
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 74a1855c976..c6b91ba5cf3 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5728,20 +5728,14 @@ si_generate_gs_copy_shader(struct si_screen *sscreen, struct si_shader_context ctx; struct si_shader *shader; LLVMBuilderRef builder; - struct si_shader_output_values *outputs; + struct si_shader_output_values outputs[SI_MAX_VS_OUTPUTS]; struct tgsi_shader_info *gsinfo = &gs_selector->info; int i, r; - outputs = MALLOC(gsinfo->num_outputs * sizeof(outputs[0])); - - if (!outputs) - return NULL; shader = CALLOC_STRUCT(si_shader); - if (!shader) { - FREE(outputs); + if (!shader) return NULL; - } /* We can leave the fence as permanently signaled because the GS copy * shader only becomes visible globally after it has been compiled. */ @@ -5860,8 +5854,6 @@ si_generate_gs_copy_shader(struct si_screen *sscreen, si_llvm_dispose(&ctx); - FREE(outputs); - if (r != 0) { FREE(shader); shader = NULL; |