Split _MaintainTexEnvProgram into two flags _Maintain and _Use. This
authorKeith Whitwell <keith@tungstengraphics.com>
Mon, 12 Dec 2005 12:57:08 +0000 (12:57 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 12 Dec 2005 12:57:08 +0000 (12:57 +0000)
restores the ability to run the software driver with program TNL but
tradtional swrast.

src/mesa/main/context.c
src/mesa/main/mtypes.h
src/mesa/main/state.c

index 8fd9af760ef251c9c03815b367d84f9bf3d8d9c7..a50632615d0f370ea8cff2dffdbad3f67b256484 100644 (file)
@@ -1237,7 +1237,11 @@ _mesa_initialize_context( GLcontext *ctx,
 #endif
 
    ctx->_MaintainTexEnvProgram = (_mesa_getenv("MESA_TEX_PROG") != NULL);
+   ctx->_UseTexEnvProgram = ctx->_MaintainTexEnvProgram;
+
    ctx->_MaintainTnlProgram = (_mesa_getenv("MESA_TNL_PROG") != NULL);
+   if (ctx->_MaintainTnlProgram)
+      ctx->_MaintainTexEnvProgram = 1; /* this is required... */
 
    ctx->FirstTimeCurrent = GL_TRUE;
 
index 3a7ae03b459720947f04e6848185d579549e849f..81f10cb1f7392430cd176118df53f0650c9fdc3f 100644 (file)
@@ -2803,8 +2803,9 @@ struct __GLcontextRec
    struct fragment_program *_TexEnvProgram;     /**< Texture state as fragment program */
    struct vertex_program *_TnlProgram;          /**< Fixed func TNL state as vertex program */
 
-   GLboolean _MaintainTexEnvProgram;
    GLboolean _MaintainTnlProgram;
+   GLboolean _MaintainTexEnvProgram;
+   GLboolean _UseTexEnvProgram;
 
    struct gl_query_state Query;  /**< GL_ARB_occlusion_query */
 
index 57fa4a836c8f178e28d82715e86e0772f4ad6639..56cb358c4a37280ec02dbc8b7fa960c002866522 100644 (file)
@@ -949,7 +949,9 @@ update_program(GLcontext *ctx)
            ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
 
       ctx->FragmentProgram._Current = ctx->_TexEnvProgram;
-      ctx->FragmentProgram._Active = GL_TRUE;
+
+      if (ctx->_UseTexEnvProgram)
+        ctx->FragmentProgram._Active = GL_TRUE;
    }
 }