summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-05-09 17:58:13 +0000
committerKeith Whitwell <[email protected]>2005-05-09 17:58:13 +0000
commit276330b2412910777f7016f427909085f02acbb8 (patch)
tree147970fe89b69d2d98b2a7c47085c8ed758d174b /src/mesa/main/state.c
parentff6723e3264df15d443a0d6af8baafbab141089c (diff)
Use driver functions to create TexEnvProgram, TnlProgram
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 561f5763a20..13b6a7d80c4 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);
}