mesa/st: Make sure that prog_to_nir NIR gets freed.
authorEric Anholt <eric@anholt.net>
Wed, 13 Mar 2019 00:07:16 +0000 (17:07 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 14 Mar 2019 23:18:38 +0000 (16:18 -0700)
commite0806c1ea079b1d78735290b0e24b02eb042b2c3
treec98f1424fac5f9d79ad869d8d14c45a880a5c1b5
parent1ea42894c70f271c6ea958a9d3cc7ba8c5948c2e
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: 3d7611e9a6c6 ("st/nir: use NIR for asm programs")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/state_tracker/st_program.c