summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-03-14 10:19:19 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-03-14 10:23:56 -0600
commitee55eaa609aee9ffd7ddbc839d7d6161727cee3a (patch)
treee20af4d359def3d21f40981c9c6bb453db7ea754
parente4cdce43cebe6a2b38f7ea5145474ca2b12c57bb (diff)
gallium: in st_program_string_notify() free shader tokens.
When the shader instructions change, free the TGSI tokens. This signals the state tracker to recompile the shader. Fixes a regression caused by recent shader/state-tracker changes.
-rw-r--r--src/mesa/state_tracker/st_cb_program.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c
index 4dc76f19b1..0a62e20e0c 100644
--- a/src/mesa/state_tracker/st_cb_program.c
+++ b/src/mesa/state_tracker/st_cb_program.c
@@ -178,6 +178,11 @@ static void st_program_string_notify( GLcontext *ctx,
stfp->param_state = stfp->Base.Base.Parameters->StateFlags;
+ if (stfp->state.tokens) {
+ FREE((void *) stfp->state.tokens);
+ stfp->state.tokens = NULL;
+ }
+
if (st->fp == stfp)
st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM;
}
@@ -201,6 +206,11 @@ static void st_program_string_notify( GLcontext *ctx,
stvp->param_state = stvp->Base.Base.Parameters->StateFlags;
+ if (stvp->state.tokens) {
+ FREE((void *) stvp->state.tokens);
+ stvp->state.tokens = NULL;
+ }
+
if (st->vp == stvp)
st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
}