Better fix to get tuxracer working.
authorAapo Tahkola <aet@rasterburn.org>
Tue, 8 Feb 2005 05:33:44 +0000 (05:33 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Tue, 8 Feb 2005 05:33:44 +0000 (05:33 +0000)
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c

index 51d721cdb7948a679a54806f59716ee526e98bf8..c6d57a35517bf96af462aae12f7b6de7aab905fc 100644 (file)
@@ -249,6 +249,37 @@ static int r300_get_num_verts(r300ContextPtr rmesa,
        return num_verts - verts_off;
 }
 
+void dump_inputs(GLcontext *ctx, int render_inputs)
+{
+       int k;
+       fprintf(stderr, "inputs:");
+       if(render_inputs & _TNL_BIT_POS)
+               fprintf(stderr, "_TNL_BIT_POS ");
+       if(render_inputs & _TNL_BIT_NORMAL)
+               fprintf(stderr, "_TNL_BIT_NORMAL ");
+               
+               /* color components */
+       if(render_inputs & _TNL_BIT_COLOR0)
+               fprintf(stderr, "_TNL_BIT_COLOR0 ");
+       if(render_inputs & _TNL_BIT_COLOR1)
+               fprintf(stderr, "_TNL_BIT_COLOR1 ");
+
+       if(render_inputs & _TNL_BIT_FOG)
+               fprintf(stderr, "_TNL_BIT_FOG ");
+                                       
+               /* texture coordinates */
+       for(k=0;k < ctx->Const.MaxTextureUnits;k++)
+               if(render_inputs & (_TNL_BIT_TEX0<<k))
+                       fprintf(stderr, "_TNL_BIT_TEX%d ", k);
+               
+       if(render_inputs & _TNL_BIT_INDEX)
+               fprintf(stderr, "_TNL_BIT_INDEX ");
+       if(render_inputs & _TNL_BIT_POINTSIZE)
+               fprintf(stderr, "_TNL_BIT_POINTSIZE ");
+       
+       fprintf(stderr, "\n");
+}
+
 /* This function compiles GL context into state registers that 
    describe data routing inside of R300 pipeline.
    
@@ -327,6 +358,8 @@ static void r300_render_immediate_primitive(r300ContextPtr rmesa,
        WARN_ONCE("Aeiee ! render_inputs==0. Skipping rendering.\n");
        return;
        }
+
+       //dump_inputs(ctx, render_inputs); return ;
        
    start_immediate_packet(num_verts, type, 4*rmesa->state.aos_count);
 
@@ -358,8 +391,8 @@ static void r300_render_immediate_primitive(r300ContextPtr rmesa,
                if(render_inputs & _TNL_BIT_COLOR1)
                        output_vector(VB->SecondaryColorPtr[0], i);
 
-               if(render_inputs & _TNL_BIT_FOG)
-                       output_vector(VB->FogCoordPtr, i);
+/*             if(render_inputs & _TNL_BIT_FOG) // Causes lock ups when immediate mode is on
+                       output_vector(VB->FogCoordPtr, i);*/
                                        
                /* texture coordinates */
                for(k=0;k < ctx->Const.MaxTextureUnits;k++)
@@ -557,6 +590,7 @@ static void upload_vertex_buffer(r300ContextPtr rmesa, GLcontext *ctx)
                fprintf(stderr, "Aieee ! Maximum AOS arrays count exceeded.. \n");
                exit(-1);
                }
+       //dump_inputs(ctx, render_inputs); return ;
 }
 
 static void r300_render_vb_primitive(r300ContextPtr rmesa, 
@@ -657,10 +691,6 @@ static GLboolean r300_run_render(GLcontext *ctx,
    #if 1
        
        #if 1
-       /* I dont recall fog locking up before polygon offset modifications.
-          Or then having fog on only locks up if immediate mode is on... */
-       if(ctx->Fog.Enabled)
-               return GL_FALSE;
        
         return r300_run_immediate_render(ctx, stage);
        #else 
index f8d3de65d31f40e89016c8619982b0717f2bb2bc..0dc3293ab23df4ad55d7fec1e49d0c8ff7f507e3 100644 (file)
@@ -932,8 +932,8 @@ void r300_setup_routing(GLcontext *ctx, GLboolean immediate)
        if(tnl->render_inputs & _TNL_BIT_COLOR1)
                CONFIGURE_AOS(VB->SecondaryColorPtr[0], 0, i_color[1], AOS_FORMAT_FLOAT_COLOR);
        
-       if(tnl->render_inputs & _TNL_BIT_FOG)
-               CONFIGURE_AOS(VB->FogCoordPtr, 0, i_fog, AOS_FORMAT_FLOAT);
+       /*if(tnl->render_inputs & _TNL_BIT_FOG) // Causes lock ups when immediate mode is on
+               CONFIGURE_AOS(VB->FogCoordPtr, 0, i_fog, AOS_FORMAT_FLOAT);*/
        
        for(i=0;i < ctx->Const.MaxTextureUnits;i++)
                if(tnl->render_inputs & (_TNL_BIT_TEX0<<i))