diff options
author | Keith Whitwell <[email protected]> | 2005-05-09 17:58:13 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-05-09 17:58:13 +0000 |
commit | 276330b2412910777f7016f427909085f02acbb8 (patch) | |
tree | 147970fe89b69d2d98b2a7c47085c8ed758d174b /src/mesa/main/texenvprogram.c | |
parent | ff6723e3264df15d443a0d6af8baafbab141089c (diff) |
Use driver functions to create TexEnvProgram, TnlProgram
Diffstat (limited to 'src/mesa/main/texenvprogram.c')
-rw-r--r-- | src/mesa/main/texenvprogram.c | 11 |
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"); |