Michel Dänzer wrote:
On Son, 2003-02-09 at 23:40, Keith Whitwell wrote:
Felix Kühling wrote:
On Sun, 09 Feb 2003 09:53:55 -0700 Keith Whitwell <[EMAIL PROTECTED]> wrote:
diff -u -r1.1.2.7 radeon_state.c --- radeon_state.c 7 Feb 2003 20:22:16 -0000 1.1.2.7 +++ radeon_state.c 9 Feb 2003 16:52:03 -0000 @@ -990,6 +990,7 @@ case GL_TEXTURE_1D: case GL_TEXTURE_2D: case GL_TEXTURE_3D: + RADEON_FIREVERTICES( rmesa ); break;
case GL_ALPHA_TEST:
What became of this? It seems to fix the flag in bzflag having the wrong texture with the r200 driver with SW TCL as well.
I think I figured out the underlying problem.
In core mesa, all statechanges are preceded by a call to ctx->Driver.FlushVertices(), to ensure all buffered vertices are fired before the state is changed. This is currently set to _tnl_FlushVertices(), which doesn't do anything to notify the driver about this impending statechange.
We should probably wrap _tnl_FlushVertices() and install that instead in ctx->Driver.FlushVertices().
I'll code something up & post a patch.
Keith
Can you test this change?
Keith
? diff Index: radeon_context.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v retrieving revision 1.30 diff -u -r1.30 radeon_context.c --- radeon_context.c 6 Feb 2003 20:41:39 -0000 1.30 +++ radeon_context.c 25 Feb 2003 03:59:14 -0000 @@ -382,6 +380,7 @@ */ _tnl_destroy_pipeline( ctx ); _tnl_install_pipeline( ctx, radeon_pipeline ); + ctx->Driver.FlushVertices = radeonFlushVertices; /* Try and keep materials and vertices separate: */ Index: radeon_swtcl.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v retrieving revision 1.11 diff -u -r1.11 radeon_swtcl.c --- radeon_swtcl.c 13 Feb 2003 10:21:09 -0000 1.11 +++ radeon_swtcl.c 25 Feb 2003 03:59:21 -0000 @@ -45,6 +45,7 @@ #include "math/m_translate.h" #include "tnl/tnl.h" #include "tnl/t_context.h" +#include "tnl/t_imm_exec.h" #include "tnl/t_pipeline.h" #include "radeon_context.h" @@ -1135,6 +1136,14 @@ } } + +void radeonFlushVertices( GLcontext *ctx, GLuint flags ) +{ + _tnl_flush_vertices( ctx, flags ); + + if (flags & FLUSH_STORED_VERTICES) + RADEON_FIREVERTICES( RADEON_CONTEXT( ctx ) ); +} /**********************************************************************/ /* Initialization. */ Index: radeon_swtcl.h =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.h,v retrieving revision 1.2 diff -u -r1.2 radeon_swtcl.h --- radeon_swtcl.h 12 Jun 2002 15:50:26 -0000 1.2 +++ radeon_swtcl.h 25 Feb 2003 03:59:21 -0000 @@ -43,6 +43,7 @@ extern void radeonInitSwtcl( GLcontext *ctx ); extern void radeonDestroySwtcl( GLcontext *ctx ); +extern void radeonFlushVertices( GLcontext *ctx, GLuint flags ); extern void radeonChooseRenderState( GLcontext *ctx ); extern void radeonChooseVertexState( GLcontext *ctx ); Index: radeon_vtxfmt.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_vtxfmt.c,v retrieving revision 1.9 diff -u -r1.9 radeon_vtxfmt.c --- radeon_vtxfmt.c 17 Dec 2002 01:19:38 -0000 1.9 +++ radeon_vtxfmt.c 25 Feb 2003 03:59:22 -0000 @@ -55,11 +55,12 @@ #include "radeon_ioctl.h" #include "radeon_tex.h" #include "radeon_tcl.h" +#include "radeon_swtcl.h" #include "radeon_vtxfmt.h" struct radeon_vb vb; -static void radeonFlushVertices( GLcontext *, GLuint ); +static void radeonVtxfmtFlushVertices( GLcontext *, GLuint ); static void count_func( const char *name, struct dynfn *l ) { @@ -336,12 +337,13 @@ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller); if (ctx->Driver.NeedFlush) - radeonFlushVertices( ctx, ctx->Driver.NeedFlush ); + radeonVtxfmtFlushVertices( ctx, ctx->Driver.NeedFlush ); if (ctx->NewState) _mesa_update_state( ctx ); /* clear state so fell_back sticks */ _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; assert( rmesa->dma.flush == 0 ); rmesa->vb.fell_back = GL_TRUE; @@ -382,6 +384,7 @@ prim = rmesa->vb.prim[0]; ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1; _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; assert(rmesa->dma.flush == 0); rmesa->vb.fell_back = GL_TRUE; @@ -734,7 +737,7 @@ fprintf(stderr, "reinstall (new install)\n"); _mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); - ctx->Driver.FlushVertices = radeonFlushVertices; + ctx->Driver.FlushVertices = radeonVtxfmtFlushVertices; ctx->Driver.NewList = radeonNewList; rmesa->vb.installed = GL_TRUE; vb.context = ctx; @@ -750,6 +753,7 @@ if (rmesa->dma.flush) rmesa->dma.flush( rmesa ); _tnl_wakeup_exec( ctx ); + ctx->Driver.FlushVertices = radeonFlushVertices; rmesa->vb.installed = GL_FALSE; vb.context = 0; } @@ -908,7 +912,7 @@ return GL_TRUE; } -static void radeonFlushVertices( GLcontext *ctx, GLuint flags ) +static void radeonVtxfmtFlushVertices( GLcontext *ctx, GLuint flags ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx );