On Wed, 17 Jul 2002, Leif Delgass wrote:
> On 17 Jul 2002, Michel D�nzer wrote:
>
> > On Wed, 2002-07-17 at 20:05, Keith Whitwell wrote:
> > > I've fixed this for drivers that use t_dd_triemit.h -- currently only radeon
> > > and r200.
> >
> > Great job! The clipping problems I originally reported with the
> > xscreensaver gears hack and fsv are fixed.
>
> I've applied this fix to the mach64 FastRenderClippedPoly function and
> reverted my previous fix.
>
> I've tested the fix on r128 and it works there as well. It looks like it
> needs to be applied to all drivers with the FastRenderClippedPoly
> function, but I can't test any of the other drivers.
>
> There's another fix I made to the mach64 driver that I think needs to be
> applied to all drivers, and that's setting the read buffer equal to the
> draw buffer when switching draw buffers. This fixes software fallbacks
> when drawing on the front buffer. I've tested it on r128 and it works.
> Should I try my hand at combining these into a single patch for all the
> drivers?
At any rate, the patch for r128 with the read buffer + flatshade fix is
attached. If nobody has any objections, I can commit this. Maybe someone
with access to other cards would like to try making the changes for other
drivers?
--
Leif Delgass
http://www.retinalburn.net
? r128-drawbuffer+flatshade.diff
Index: r128_state.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/r128/r128_state.c,v
retrieving revision 1.22
diff -u -r1.22 r128_state.c
--- r128_state.c 12 Jun 2002 15:50:25 -0000 1.22
+++ r128_state.c 17 Jul 2002 19:27:03 -0000
@@ -689,13 +689,13 @@
switch ( mode ) {
case GL_FRONT_LEFT:
- rmesa->drawOffset = rmesa->r128Screen->frontOffset;
- rmesa->drawPitch = rmesa->r128Screen->frontPitch;
+ rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset;
+ rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch;
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case GL_BACK_LEFT:
- rmesa->drawOffset = rmesa->r128Screen->backOffset;
- rmesa->drawPitch = rmesa->r128Screen->backPitch;
+ rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset;
+ rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch;
FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
Index: r128_tris.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/r128/r128_tris.c,v
retrieving revision 1.17
diff -u -r1.17 r128_tris.c
--- r128_tris.c 2 Jun 2002 16:00:43 -0000 1.17
+++ r128_tris.c 17 Jul 2002 19:27:04 -0000
@@ -501,9 +501,9 @@
rmesa->num_verts += (n-2) * 3;
for (i = 2 ; i < n ; i++) {
- COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) start );
COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i-1]) );
COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) VERT(elts[i]) );
+ COPY_DWORDS( j, vb, vertsize, (r128VertexPtr) start );
}
}