From 4885a9eb207655ac23b64274034e1d51d2c8e6ce Mon Sep 17 00:00:00 2001 From: Aapo Tahkola Date: Tue, 8 Feb 2005 05:33:44 +0000 Subject: Better fix to get tuxracer working. --- src/mesa/drivers/dri/r300/r300_render.c | 42 ++++++++++++++++++++++++++++----- src/mesa/drivers/dri/r300/r300_state.c | 4 ++-- 2 files changed, 38 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 51d721cdb79..c6d57a35517 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -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<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 diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index f8d3de65d31..0dc3293ab23 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -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<