diff options
author | Ian Romanick <[email protected]> | 2012-01-19 17:23:51 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-01-24 12:30:52 -0800 |
commit | 34db7a8c1e775aaefad7952133e087f1c1a569f6 (patch) | |
tree | 37b70999f357e8ea53f32aec4fe3d94650d9ea4e /src | |
parent | 3e01c3f3baee82524e23107aecb2de4c7ee8b978 (diff) |
mesa: Make sure _TexEnvProgram points at the current ff fragment program
At least one place, the _mesa_need_secondary_color function in
state.h, uses this to make decisions. The next patch in this series
will add another dependency. Ideally, this field would go away and be
replace by a flag or something.
NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/state.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 39d7294f75b..20fd17d060c 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -136,6 +136,8 @@ update_program(struct gl_context *ctx) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, (struct gl_fragment_program *) fsProg->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, + NULL); } else if (ctx->FragmentProgram._Enabled) { /* Use user-defined fragment program */ @@ -144,6 +146,8 @@ update_program(struct gl_context *ctx) NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, ctx->FragmentProgram.Current); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, + NULL); } else if (ctx->FragmentProgram._MaintainTexEnvProgram) { /* Use fragment program generated from fixed-function state */ @@ -155,10 +159,15 @@ update_program(struct gl_context *ctx) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, (struct gl_fragment_program *) f->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, + (struct gl_fragment_program *) + f->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program); } else { /* No fragment program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, + NULL); } if (gsProg && gsProg->LinkStatus |