summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2020-04-30 13:03:48 +0300
committerEric Engestrom <[email protected]>2020-05-05 18:56:45 +0200
commite1e22e38e7ed4cecc44248dd2993f2a9c8e7695e (patch)
tree14f3c7b346ab9c2b02e62483657e13fc22d89070
parent4af564cb9200d61fd77e237cf2d2592cec656b57 (diff)
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: de3d7dbed52 ("mesa/st: release variants for active programs before unref") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2865 Cc: [email protected] Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4831> (cherry picked from commit 46b3cb011fd1c9198aeec33d453206846b579817)
-rw-r--r--.pick_status.json2
-rw-r--r--src/mesa/state_tracker/st_program.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 0e520767ff8..b2e0d1a2560 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -535,7 +535,7 @@
"description": "st/mesa: destroy only own program variants when program is released",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "de3d7dbed521c40344c9f8b2b505b6e2b13a7636"
},
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 3fa5ff7b74c..cb9fcfdbdd6 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -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);
}