mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 23:09:05 +02:00
mesa/st: Make sure that prog_to_nir NIR gets freed.
GLSL NIR gets freed on relink by _mesa_delete_program(), but for ARB
programs we need to free the old NIR when PSN is used to set up new NIR in
the same gl_program. Additionally, set the base .nir field so that it
will get freed by _mesa_delete_program().
Fixes: 3d7611e9a6 ("st/nir: use NIR for asm programs")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
1ea42894c7
commit
e0806c1ea0
1 changed files with 6 additions and 0 deletions
|
|
@ -579,8 +579,11 @@ st_translate_vertex_program(struct st_context *st,
|
|||
nir_shader *nir =
|
||||
st_translate_prog_to_nir(st, &stvp->Base, MESA_SHADER_VERTEX);
|
||||
|
||||
if (stvp->tgsi.ir.nir)
|
||||
ralloc_free(stvp->tgsi.ir.nir);
|
||||
stvp->tgsi.type = PIPE_SHADER_IR_NIR;
|
||||
stvp->tgsi.ir.nir = nir;
|
||||
stvp->Base.nir = nir;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -763,8 +766,11 @@ st_translate_fragment_program(struct st_context *st,
|
|||
nir_shader *nir =
|
||||
st_translate_prog_to_nir(st, &stfp->Base, MESA_SHADER_FRAGMENT);
|
||||
|
||||
if (stfp->tgsi.ir.nir)
|
||||
ralloc_free(stfp->tgsi.ir.nir);
|
||||
stfp->tgsi.type = PIPE_SHADER_IR_NIR;
|
||||
stfp->tgsi.ir.nir = nir;
|
||||
stfp->Base.nir = nir;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue