summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-10-05 22:46:44 +0200
committerMarek Olšák <[email protected]>2015-10-09 22:02:18 +0200
commitee01942eb595b05aff47b4fdcd358508f2d6f14c (patch)
treece86b96692f1c4ea1a4ff548396c155484d8b0ff /src
parente5073e8d0c1ea98c7e5cfff8fe69cd779bc129d9 (diff)
st/mesa: release the glsl_to_tgsi visitor after translation
Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_program.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 3317071ed59..6a69ba7aa26 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -425,6 +425,9 @@ st_translate_vertex_program(struct st_context *st,
st_translate_stream_output_info(stvp->glsl_to_tgsi,
stvp->result_to_output,
&stvp->tgsi.stream_output);
+
+ free_glsl_to_tgsi_visitor(stvp->glsl_to_tgsi);
+ stvp->glsl_to_tgsi = NULL;
} else
error = st_translate_mesa_program(st->ctx,
TGSI_PROCESSOR_VERTEX,
@@ -815,7 +818,7 @@ st_translate_fragment_program(struct st_context *st,
}
}
- if (stfp->glsl_to_tgsi)
+ if (stfp->glsl_to_tgsi) {
st_translate_program(st->ctx,
TGSI_PROCESSOR_FRAGMENT,
ureg,
@@ -835,7 +838,10 @@ st_translate_fragment_program(struct st_context *st,
NULL,
fs_output_semantic_name,
fs_output_semantic_index);
- else
+
+ free_glsl_to_tgsi_visitor(stfp->glsl_to_tgsi);
+ stfp->glsl_to_tgsi = NULL;
+ } else
st_translate_mesa_program(st->ctx,
TGSI_PROCESSOR_FRAGMENT,
ureg,
@@ -1309,6 +1315,9 @@ st_translate_geometry_program(struct st_context *st,
st_translate_program_common(st, &stgp->Base.Base, stgp->glsl_to_tgsi, ureg,
TGSI_PROCESSOR_GEOMETRY, &stgp->tgsi);
+
+ free_glsl_to_tgsi_visitor(stgp->glsl_to_tgsi);
+ stgp->glsl_to_tgsi = NULL;
return true;
}
@@ -1381,6 +1390,9 @@ st_translate_tessctrl_program(struct st_context *st,
st_translate_program_common(st, &sttcp->Base.Base, sttcp->glsl_to_tgsi,
ureg, TGSI_PROCESSOR_TESS_CTRL, &sttcp->tgsi);
+
+ free_glsl_to_tgsi_visitor(sttcp->glsl_to_tgsi);
+ sttcp->glsl_to_tgsi = NULL;
return true;
}
@@ -1475,6 +1487,9 @@ st_translate_tesseval_program(struct st_context *st,
st_translate_program_common(st, &sttep->Base.Base, sttep->glsl_to_tgsi,
ureg, TGSI_PROCESSOR_TESS_EVAL, &sttep->tgsi);
+
+ free_glsl_to_tgsi_visitor(sttep->glsl_to_tgsi);
+ sttep->glsl_to_tgsi = NULL;
return true;
}