summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-02-27 02:13:29 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-02-27 02:13:29 +0000
commitdb79b5683cfc3f2ea3f9b0aca8c4d149bf9a63f7 (patch)
tree4e90aaabeba36a62853377c8ad7cc5d6eed2a981 /src/mesa/swrast/s_context.c
parent579ea7ff7a98c95ae5c11f7483910d4d82662ca3 (diff)
move _mesa_load_state_parameters() to state validation stage
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 800f79080f..0a81048e6f 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -30,6 +30,7 @@
#include "context.h"
#include "colormac.h"
#include "mtypes.h"
+#include "program.h"
#include "texobj.h"
#include "nvfragprog.h"
@@ -201,6 +202,16 @@ _swrast_update_fog_state( GLcontext *ctx )
}
+static void
+_swrast_update_fragment_program( GLcontext *ctx )
+{
+ if (ctx->FragmentProgram.Enabled) {
+ struct fragment_program *program = ctx->FragmentProgram.Current;
+ _mesa_load_state_parameters(ctx, program->Parameters);
+ }
+}
+
+
#define _SWRAST_NEW_DERIVED (_SWRAST_NEW_RASTERMASK | \
_NEW_TEXTURE | \
@@ -432,9 +443,11 @@ _swrast_validate_derived( GLcontext *ctx )
if (swrast->NewState & _SWRAST_NEW_TEXTURE_ENV_MODE)
_swrast_update_texture_env( ctx );
- if (swrast->NewState & _NEW_FOG) {
+ if (swrast->NewState & _NEW_FOG)
_swrast_update_fog_state( ctx );
- }
+
+ if (swrast->NewState & _NEW_PROGRAM)
+ _swrast_update_fragment_program( ctx );
swrast->NewState = 0;
swrast->StateChanges = 0;