diff options
author | Brian Paul <[email protected]> | 2006-10-31 19:53:38 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-10-31 19:53:38 +0000 |
commit | 5050b565deca3cad165cd2f68badc084b9aa5377 (patch) | |
tree | c32ff6ce5d412b69b900405317e4ddeea63e3104 /src/mesa/swrast/s_context.c | |
parent | ef987aa1d78b705dc75fb962941410f53238dbc8 (diff) |
make use of Parameters->StateFlags in _swrast_update_fragment_program()
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r-- | src/mesa/swrast/s_context.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0de6dc25b4a..62cf6f2f5ae 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -223,15 +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) { - /* XXX it would be nice to have a per-program bitmask indicating - * what global state vars are used (lighting, point, fog, etc) to - * avoid doing this when not needed. - */ 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); } } @@ -536,7 +533,7 @@ _swrast_validate_derived( GLcontext *ctx ) _NEW_POINT | _NEW_VIEWPORT | _NEW_PROGRAM)) - _swrast_update_fragment_program( ctx ); + _swrast_update_fragment_program( ctx, swrast->NewState ); if (swrast->NewState & _NEW_TEXTURE) _swrast_update_texture_samplers( ctx ); |