summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-02-24 15:51:41 -0700
committerBrian <brian@yutani.localnet.net>2007-02-24 15:51:41 -0700
commitefcfdbd4d16071088e60a59cb966abd730d9d111 (patch)
treed7e38108b9473407d3a85faa028e5c22fa4a2212
parent292a80466d3e0b1cec998f2dc1b0abe25dc10fb8 (diff)
Undo some changes to _mesa_UpdateTexEnvProgram(). Fixes broken i915 texturing.
-rw-r--r--src/mesa/main/texenvprogram.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 917acf06d7..54ae7ce0a1 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -1239,10 +1239,12 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx )
ASSERT(ctx->FragmentProgram._MaintainTexEnvProgram);
/* If a conventional fragment program/shader isn't in effect... */
- if (!ctx->FragmentProgram._Current) {
+ if (!ctx->FragmentProgram._Enabled &&
+ !ctx->Shader.CurrentProgram) {
make_state_key(ctx, &key);
hash = hash_key(&key);
+ ctx->FragmentProgram._Current =
ctx->FragmentProgram._TexEnvProgram =
search_cache(&ctx->Texture.env_fp_cache, hash, &key, sizeof(key));
@@ -1251,7 +1253,9 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx )
_mesa_printf("Building new texenv proggy for key %x\n", hash);
/* create new tex env program */
- ctx->FragmentProgram._TexEnvProgram = (struct gl_fragment_program *)
+ ctx->FragmentProgram._Current =
+ ctx->FragmentProgram._TexEnvProgram =
+ (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
create_new_program(ctx, &key, ctx->FragmentProgram._TexEnvProgram);
@@ -1263,8 +1267,10 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx )
if (0)
_mesa_printf("Found existing texenv program for key %x\n", hash);
}
- ctx->FragmentProgram._Current = ctx->FragmentProgram._TexEnvProgram;
}
+ else {
+ ctx->FragmentProgram._Current = ctx->FragmentProgram.Current;
+ }
/* Tell the driver about the change. Could define a new target for
* this?