Attached is a patch I've worked up for enabling antialising on lines
and triangles for the r128. To my eye it looks like antialiasing, but
not of particularly high quality. The r128 also offers something
called "supersampling" for the antialiasing. Is this likely to be
better?

Does anyone have recommendations for programs that test antialiasing,
so I can play with the options to see what happens?

Thanks in advance,
--
Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/
Index: src/mesa/drivers/dri/r128/r128_tris.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r128/r128_tris.c,v
retrieving revision 1.14
diff -u -r1.14 r128_tris.c
--- src/mesa/drivers/dri/r128/r128_tris.c	11 Apr 2006 11:41:11 -0000	1.14
+++ src/mesa/drivers/dri/r128/r128_tris.c	4 Jul 2006 12:47:32 -0000
@@ -420,8 +420,8 @@
 /**********************************************************************/
 
 #define POINT_FALLBACK (DD_POINT_SMOOTH)
-#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH)
-#define TRI_FALLBACK (DD_TRI_SMOOTH)
+#define LINE_FALLBACK (DD_LINE_STIPPLE)
+#define TRI_FALLBACK (0)
 #define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)
 #define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
 #define _R128_NEW_RENDER_STATE (ANY_FALLBACK_FLAGS | ANY_RASTER_FLAGS)
@@ -531,11 +531,36 @@
    }
 }
 
+static void r128SetupAntialias( GLcontext *ctx, GLenum prim )
+{
+   r128ContextPtr rmesa = R128_CONTEXT(ctx);
+
+   GLuint currAA, wantAA;
+   
+   currAA = (rmesa->setup.pm4_vc_fpu_setup & R128_EDGE_ANTIALIAS) != 0;
+   if( prim >= GL_TRIANGLES )
+      wantAA = ctx->Polygon.SmoothFlag;
+   else if( prim >= GL_LINES )
+      wantAA = ctx->Line.SmoothFlag;
+   else
+      wantAA = 0;
+      
+   if( wantAA != currAA )
+   {
+     FLUSH_BATCH( rmesa );
+     rmesa->setup.pm4_vc_fpu_setup ^= R128_EDGE_ANTIALIAS;
+     rmesa->dirty |= R128_UPLOAD_SETUP;
+   }
+}
+
 static void r128RenderPrimitive( GLcontext *ctx, GLenum prim )
 {
    r128ContextPtr rmesa = R128_CONTEXT(ctx);
    GLuint hw = hw_prim[prim];
    rmesa->render_primitive = prim;
+
+   r128SetupAntialias( ctx, prim );
+   
    if (prim >= GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED))
       return;
    r128RasterPrimitive( ctx, hw );
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to