st/mesa: destroy only own program variants when program is released

Earlier commit tried to achieve this but actually did more. This makes
sure the variants for other contexts continue to live.

Fixes: de3d7dbed5 ("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>
(cherry picked from commit 46b3cb011f)
This commit is contained in:
Tapani Pälli 2020-04-30 13:03:48 +03:00 committed by Dylan Baker
parent 52ad2d9bb2
commit 52f1498321
2 changed files with 4 additions and 2 deletions

View file

@ -382,7 +382,7 @@
"description": "st/mesa: destroy only own program variants when program is released",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "de3d7dbed521c40344c9f8b2b505b6e2b13a7636"
},

View file

@ -67,6 +67,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,
@ -342,7 +344,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);
}