_swrast_update_fragment_program( GLcontext *ctx )
{
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 (swrast->NewState & (_NEW_FOG | _NEW_PROGRAM))
_swrast_update_fog_state( ctx );
- if (swrast->NewState & _NEW_PROGRAM)
+ 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 );
if (swrast->NewState & _NEW_TEXTURE)
ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */
-#if 0 /* we really shouldn't need this here... */
- if (program->Base.Parameters) {
- _mesa_load_state_parameters(ctx, program->Base.Parameters);
- }
-#endif
run_program(ctx, span, 0, span->end);
if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) {