summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-05-10 11:39:50 +0000
committerKeith Whitwell <[email protected]>2005-05-10 11:39:50 +0000
commit8b88f62fbd62153500fc3483003f438561366a00 (patch)
treeba670848647a8efdbe1b30ea88539e6a1bc66cee /src/mesa/main
parent948fa3b295d384592ebc9396413a38aba4edf4a6 (diff)
Better driver notification on changes.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texenvprogram.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 1618287af6d..77879de8acb 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -37,7 +37,7 @@
#include "shader/arbfragparse.h"
-#define DISASSEM 1
+#define DISASSEM 0
/* Use uregs to represent registers internally, translate to Mesa's
* expected formats on emit.
@@ -691,12 +691,10 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
if (ctx->FragmentProgram._Enabled)
return;
- if (ctx->_TexEnvProgram)
- ctx->Driver.DeleteProgram(ctx, ctx->_TexEnvProgram);
-
- ctx->FragmentProgram._Current = ctx->_TexEnvProgram =
- (struct fragment_program *)
- ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+ if (!ctx->_TexEnvProgram)
+ ctx->FragmentProgram._Current = ctx->_TexEnvProgram =
+ (struct fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
p.ctx = ctx;
p.program = ctx->_TexEnvProgram;
@@ -779,6 +777,11 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
p.program->Instructions);
_mesa_printf("\n");
#endif
+
+ /* Notify driver the fragment program has (potentially) changed.
+ */
+ ctx->Driver.ProgramStringNotify( ctx, GL_FRAGMENT_PROGRAM_ARB,
+ p.program );
}