st/mesa: destroy only own program variants when program is released
authorTapani Pälli <tapani.palli@intel.com>
Thu, 30 Apr 2020 10:03:48 +0000 (13:03 +0300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 13:28:49 +0000 (13:28 +0000)
Earlier commit tried to achieve this but actually did more. This makes
sure the variants for other contexts continue to live.

Fixes: de3d7dbed52 ("mesa/st: release variants for active programs before unref")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2865
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4831>

src/mesa/state_tracker/st_program.c

index 3fa5ff7b74cb2e729d7a88dfee719501dd7db023..cb9fcfdbdd620deb2d00facd7468de290c392980 100644 (file)
@@ -70,6 +70,8 @@
 #include "cso_cache/cso_context.h"
 
 
+static void
+destroy_program_variants(struct st_context *st, struct gl_program *target);
 
 static void
 set_affected_state_flags(uint64_t *states,
@@ -345,7 +347,7 @@ st_release_program(struct st_context *st, struct st_program **p)
    if (!*p)
       return;
 
-   st_release_variants(st, *p);
+   destroy_program_variants(st, &((*p)->Base));
    st_reference_prog(st, p, NULL);
 }