r300: only init swtcl on tcl-less cards
authorDave Airlie <airlied@linux.ie>
Wed, 4 Jul 2007 05:29:31 +0000 (15:29 +1000)
committerDave Airlie <airlied@linux.ie>
Wed, 4 Jul 2007 05:30:40 +0000 (15:30 +1000)
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_swtcl.c

index 04e3fffa5df681c81014685ec60d0651d508dfb8..14e0f052fd57aec1b6f7b038c5cb5bcffc7896f0 100644 (file)
@@ -318,15 +318,17 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        _tnl_allow_vertex_fog(ctx, GL_TRUE);
 
        /* currently bogus data */
-       ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4;
-       ctx->Const.VertexProgram.MaxNativeInstructions =
-           VSF_MAX_FRAGMENT_LENGTH / 4;
-       ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */
-       ctx->Const.VertexProgram.MaxTemps = 32;
-       ctx->Const.VertexProgram.MaxNativeTemps =
-           /*VSF_MAX_FRAGMENT_TEMPS */ 32;
-       ctx->Const.VertexProgram.MaxNativeParameters = 256;     /* r420 */
-       ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
+       if (screen->chip_flags & RADEON_CHIPSET_TCL) {
+               ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4;
+               ctx->Const.VertexProgram.MaxNativeInstructions =
+                 VSF_MAX_FRAGMENT_LENGTH / 4;
+               ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */
+               ctx->Const.VertexProgram.MaxTemps = 32;
+               ctx->Const.VertexProgram.MaxNativeTemps =
+                 /*VSF_MAX_FRAGMENT_TEMPS */ 32;
+               ctx->Const.VertexProgram.MaxNativeParameters = 256;     /* r420 */
+               ctx->Const.VertexProgram.MaxNativeAddressRegs = 1;
+       }
 
        ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS;
        ctx->Const.FragmentProgram.MaxNativeAttribs = 11;       /* copy i915... */
@@ -364,7 +366,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        radeonInitSpanFuncs(ctx);
        r300InitCmdBuf(r300);
        r300InitState(r300);
-       r300InitSwtcl(ctx);
+       if (!(screen->chip_flags & RADEON_CHIPSET_TCL))
+               r300InitSwtcl(ctx);
 
        TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
 
index 7aea063447a0e6a4d68a44c14500e20cee39b7e9..c949f33bf33eb348432555c2aa15971258073408 100644 (file)
@@ -668,6 +668,11 @@ void r300InitSwtcl(GLcontext *ctx)
 
        _tnl_need_projected_coords( ctx, GL_FALSE );
        r300ChooseRenderState(ctx);
+
+       _mesa_validate_all_lighting_tables( ctx ); 
+
+       tnl->Driver.NotifyMaterialChange = 
+         _mesa_validate_all_lighting_tables;
 }
 
 void r300DestroySwtcl(GLcontext *ctx)