summaryrefslogtreecommitdiff
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 561f5763a2..13b6a7d80c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -90,6 +90,7 @@
#include "nvfragprog.h"
#include "nvprogram.h"
#include "program.h"
+#include "texenvprogram.h"
#endif
#if FEATURE_ARB_shader_objects
#include "shaderobjects.h"
@@ -939,7 +940,11 @@ update_program(GLcontext *ctx)
ctx->FragmentProgram._Active = ctx->FragmentProgram._Enabled;
if (ctx->_MaintainTexEnvProgram && !ctx->FragmentProgram._Enabled) {
- ctx->FragmentProgram._Current = &ctx->_TexEnvProgram;
+ if (!ctx->_TexEnvProgram)
+ ctx->_TexEnvProgram = (struct fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+
+ ctx->FragmentProgram._Current = ctx->_TexEnvProgram;
ctx->FragmentProgram._Active = GL_TRUE;
}
}
@@ -997,7 +1002,7 @@ _mesa_update_state( GLcontext *ctx )
update_arrays( ctx );
if (ctx->_MaintainTexEnvProgram) {
- if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR))
+ if (new_state & (_NEW_TEXTURE | _DD_NEW_SEPARATE_SPECULAR | _NEW_FOG))
_mesa_UpdateTexEnvProgram(ctx);
}