summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texenvprogram.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/texenvprogram.c
parentff6723e3264df15d443a0d6af8baafbab141089c (diff)
Use driver functions to create TexEnvProgram, TnlProgram
Diffstat (limited to 'src/mesa/main/texenvprogram.c')
-rw-r--r--src/mesa/main/texenvprogram.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 187526e6775..efc406b72a3 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -651,14 +651,19 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
if (ctx->FragmentProgram._Enabled)
return;
+ if (!ctx->_TexEnvProgram)
+ ctx->_TexEnvProgram = (struct fragment_program *)
+ ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
+
p.ctx = ctx;
- p.program = &ctx->_TexEnvProgram;
+ p.program = ctx->_TexEnvProgram;
if (p.program->Instructions == NULL) {
p.program->Instructions = MALLOC(sizeof(struct fp_instruction) * 100);
}
p.program->Base.NumInstructions = 0;
+ p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
p.program->NumTexIndirections = 1; /* correct? */
p.program->NumTexInstructions = 0;
p.program->NumAluInstructions = 0;
@@ -702,6 +707,10 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
*/
emit_arith( &p, FP_OPCODE_END, undef, WRITEMASK_XYZW, 0, undef, undef, undef);
+ if (ctx->Fog.Enabled)
+ p.program->FogOption = ctx->Fog.Mode;
+ else
+ p.program->FogOption = GL_NONE;
if (p.program->NumTexIndirections > ctx->Const.MaxFragmentProgramTexIndirections)
program_error(&p, "Exceeded max nr indirect texture lookups");