aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2006-11-02 12:02:13 +0000
committerAlan Hourihane <[email protected]>2006-11-02 12:02:13 +0000
commit6d104cb932080c5c0d951fbc0ec6d30fb7ebef45 (patch)
tree17207f566d6eda4d3884ec03dfff6cdb5a1965ea /src/mesa/swrast/s_context.c
parent18d52f96bb1f20b1887b67e87506835bca05d73a (diff)
merge current trunk into vbo branch
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 18f5fe497bb..62cf6f2f5ae 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -223,11 +223,12 @@ _swrast_update_fog_state( GLcontext *ctx )
* program parameters with current state values.
*/
static void
-_swrast_update_fragment_program( GLcontext *ctx )
+_swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState)
{
if (ctx->FragmentProgram._Enabled) {
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
- _mesa_load_state_parameters(ctx, fp->Base.Parameters);
+ if (fp->Base.Parameters->StateFlags & newState)
+ _mesa_load_state_parameters(ctx, fp->Base.Parameters);
}
}
@@ -521,8 +522,18 @@ _swrast_validate_derived( GLcontext *ctx )
if (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
_swrast_update_fog_state( ctx );
- if (swrast->NewState & _NEW_PROGRAM)
- _swrast_update_fragment_program( ctx );
+ if (swrast->NewState & (_NEW_MODELVIEW |
+ _NEW_PROJECTION |
+ _NEW_TEXTURE_MATRIX |
+ _NEW_FOG |
+ _NEW_LIGHT |
+ _NEW_LINE |
+ _NEW_TEXTURE |
+ _NEW_TRANSFORM |
+ _NEW_POINT |
+ _NEW_VIEWPORT |
+ _NEW_PROGRAM))
+ _swrast_update_fragment_program( ctx, swrast->NewState );
if (swrast->NewState & _NEW_TEXTURE)
_swrast_update_texture_samplers( ctx );