mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 10:10:09 +01:00
radeonsi: don't use malloc in si_generate_gs_copy_shader
This commit is contained in:
parent
7bac3b589c
commit
0c554bc5d5
1 changed files with 2 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue