summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/state_tracker/st_cb_program.c12
-rw-r--r--src/mesa/state_tracker/st_program.c13
-rw-r--r--src/mesa/state_tracker/st_program.h4
-rw-r--r--src/mesa/state_tracker/st_shader_cache.c12
4 files changed, 13 insertions, 28 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 2d47af9b363..9ca1ada109d 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -112,8 +112,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog)
{
struct st_common_program *p = st_common_program(prog);
- st_release_basic_variants(st, p->Base.Target, &p->variants,
- &p->tgsi);
+ st_release_basic_variants(st, p);
if (p->glsl_to_tgsi)
free_glsl_to_tgsi_visitor(p->glsl_to_tgsi);
@@ -184,8 +183,7 @@ st_program_string_notify( struct gl_context *ctx,
else if (target == GL_GEOMETRY_PROGRAM_NV) {
struct st_common_program *stgp = st_common_program(prog);
- st_release_basic_variants(st, stgp->Base.Target, &stgp->variants,
- &stgp->tgsi);
+ st_release_basic_variants(st, stgp);
if (!st_translate_geometry_program(st, stgp))
return false;
@@ -206,8 +204,7 @@ st_program_string_notify( struct gl_context *ctx,
struct st_common_program *sttcp =
st_common_program(prog);
- st_release_basic_variants(st, sttcp->Base.Target, &sttcp->variants,
- &sttcp->tgsi);
+ st_release_basic_variants(st, sttcp);
if (!st_translate_tessctrl_program(st, sttcp))
return false;
@@ -218,8 +215,7 @@ st_program_string_notify( struct gl_context *ctx,
struct st_common_program *sttep =
st_common_program(prog);
- st_release_basic_variants(st, sttep->Base.Target, &sttep->variants,
- &sttep->tgsi);
+ st_release_basic_variants(st, sttep);
if (!st_translate_tesseval_program(st, sttep))
return false;
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 3446388c966..73a2bf3d280 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -370,21 +370,18 @@ delete_basic_variant(struct st_context *st, struct st_basic_variant *v,
* Free all basic program variants.
*/
void
-st_release_basic_variants(struct st_context *st, GLenum target,
- struct st_basic_variant **variants,
- struct pipe_shader_state *tgsi)
+st_release_basic_variants(struct st_context *st, struct st_common_program *p)
{
struct st_basic_variant *v;
- for (v = *variants; v; ) {
+ for (v = p->variants; v; ) {
struct st_basic_variant *next = v->next;
- delete_basic_variant(st, v, target);
+ delete_basic_variant(st, v, p->Base.Target);
v = next;
}
- *variants = NULL;
-
- delete_ir(tgsi);
+ p->variants = NULL;
+ delete_ir(&p->tgsi);
}
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index 77b335993a5..4b0fcff96a7 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -450,9 +450,7 @@ st_release_cp_variants(struct st_context *st,
struct st_compute_program *stcp);
extern void
-st_release_basic_variants(struct st_context *st, GLenum target,
- struct st_basic_variant **variants,
- struct pipe_shader_state *tgsi);
+st_release_basic_variants(struct st_context *st, struct st_common_program *p);
extern void
st_destroy_program_variants(struct st_context *st);
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c
index a56e9fa354c..344bd93d667 100644
--- a/src/mesa/state_tracker/st_shader_cache.c
+++ b/src/mesa/state_tracker/st_shader_cache.c
@@ -237,9 +237,7 @@ st_deserialise_ir_program(struct gl_context *ctx,
case MESA_SHADER_TESS_CTRL: {
struct st_common_program *sttcp = st_common_program(prog);
- st_release_basic_variants(st, sttcp->Base.Target,
- &sttcp->variants, &sttcp->tgsi);
-
+ st_release_basic_variants(st, sttcp);
read_stream_out_from_cache(&blob_reader, &sttcp->tgsi);
if (nir) {
@@ -260,9 +258,7 @@ st_deserialise_ir_program(struct gl_context *ctx,
case MESA_SHADER_TESS_EVAL: {
struct st_common_program *sttep = st_common_program(prog);
- st_release_basic_variants(st, sttep->Base.Target,
- &sttep->variants, &sttep->tgsi);
-
+ st_release_basic_variants(st, sttep);
read_stream_out_from_cache(&blob_reader, &sttep->tgsi);
if (nir) {
@@ -283,9 +279,7 @@ st_deserialise_ir_program(struct gl_context *ctx,
case MESA_SHADER_GEOMETRY: {
struct st_common_program *stgp = st_common_program(prog);
- st_release_basic_variants(st, stgp->Base.Target, &stgp->variants,
- &stgp->tgsi);
-
+ st_release_basic_variants(st, stgp);
read_stream_out_from_cache(&blob_reader, &stgp->tgsi);
if (nir) {