summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_program.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 7015e503d12..ebedf4daa21 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -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;
}