Am Sonntag, 29. August 2004 18:03 schrieb Dieter Nützel: > Am Sonntag, 29. August 2004 17:48 schrieb Dieter Nützel: > > Am Sonntag, 29. August 2004 16:54 schrieben Sie: > > > I'm happy to see this go in. It is probably excessively cautious to > > > keep it out & it's certainly not getting any testing out of the tree. > > > > /opt/Mesa> cd src/mesa/drivers/dri/r200/ > > dri/r200> patch -p0 -E -N < > > ~/Dokumente/DRI-Mesa/r200-maybe-flush-less.diff patching file r200_tcl.c > > Hunk #1 FAILED at 140. > > 1 out of 1 hunk FAILED -- saving rejects to file r200_tcl.c.rej > > OK, > > here is mine. > > Compiling, now.
r200-maybe-flush-less-2.diff was wrong. Try this one. Compiled and works. Benching for sphere resolutions : 32, 64, 128, 256, 512 Setting(s) : window is 400 x 400, sphere radius is 0.9 Option(s) : [wireframe] 32x32 : 832.9 kpolys/s 64x64 : 2098.1 kpolys/s 128x128 : 2574.3 kpolys/s 256x256 : 2679.7 kpolys/s 512x512 : 2720.1 kpolys/s But what's this? VTK/bin> ./vtk /opt/VTK/Local/sphere-bench.tcl-2.1 & [1] 32753 VTK/bin> [1] Speicherschutzverletzung ./vtk /opt/VTK/Local/sphere-bench.tcl-2.1 I'll try with debug when I have some more time. -Dieter
--- r200_tcl.c.orig 2004-08-29 19:37:09.000000000 +0200 +++ r200_tcl.c 2004-08-29 19:42:49.791511506 +0200 @@ -140,21 +140,37 @@ static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr ) { - if (rmesa->dma.flush) - rmesa->dma.flush( rmesa ); + if (rmesa->dma.flush == r200FlushElts && + rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { - r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) + - rmesa->hw.max_state_size + ELTS_BUFSZ(nr) ); - - r200EmitAOS( rmesa, - rmesa->tcl.aos_components, - rmesa->tcl.nr_aos_components, 0 ); + GLushort *dest = (GLushort *)(rmesa->store.cmd_buf + + rmesa->store.cmd_used); + + rmesa->store.cmd_used += nr*2; + + return dest; + } + else { + if (rmesa->dma.flush) + rmesa->dma.flush( rmesa ); + + r200EnsureCmdBufSpace( rmesa, AOS_BUFSZ(rmesa->tcl.nr_aos_components) + + rmesa->hw.max_state_size + ELTS_BUFSZ(nr) ); - return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr ); + r200EmitAOS( rmesa, + rmesa->tcl.aos_components, + rmesa->tcl.nr_aos_components, 0 ); + + return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr ); + } } -#define CLOSE_ELTS() R200_NEWPRIM( rmesa ) +#define CLOSE_ELTS() \ +do { \ + if (0) R200_NEWPRIM( rmesa ); \ +} \ +while (0) /* TODO: Try to extend existing primitive if both are identical,