summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2014-09-18 23:48:04 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-27 19:10:23 +0100
commitbda7518e7ce22d2702900e47d9272b8e09e3cab5 (patch)
treef2c276bc6c988ac653c85a61f95367848854d296 /src/gallium
parent7d3f6f79950636a83753797b85e7f6af01fd6824 (diff)
radeonsi: properly destroy the GS copy shader and scratch_bo for compute
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit dc05a9e4e089d66a2ffe8919857ad9660e108c28) [Emil Velikov: remove unref scratch_bo, s/si_shader/si_pipe_shader/] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c3
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 397b6ee384c..6b6a5caab5a 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -2616,5 +2616,8 @@ out:
void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_pipe_shader *shader)
{
+ if (shader->gs_copy_shader)
+ si_pipe_shader_destroy(ctx, shader->gs_copy_shader);
+
r600_resource_reference(&shader->bo, NULL);
}
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 7f65c4726a9..18806456a06 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2244,9 +2244,10 @@ static void si_delete_shader_selector(struct pipe_context *ctx,
while (p) {
c = p->next_variant;
- if (sel->type == PIPE_SHADER_GEOMETRY)
+ if (sel->type == PIPE_SHADER_GEOMETRY) {
si_pm4_delete_state(sctx, gs, p->pm4);
- else if (sel->type == PIPE_SHADER_FRAGMENT)
+ si_pm4_delete_state(sctx, vs, p->gs_copy_shader->pm4);
+ } else if (sel->type == PIPE_SHADER_FRAGMENT)
si_pm4_delete_state(sctx, ps, p->pm4);
else if (p->key.vs.as_es)
si_pm4_delete_state(sctx, es, p->pm4);
@@ -2259,7 +2260,7 @@ static void si_delete_shader_selector(struct pipe_context *ctx,
free(sel->tokens);
free(sel);
- }
+}
static void si_delete_vs_shader(struct pipe_context *ctx, void *state)
{