diff options
author | Brian Paul <[email protected]> | 2006-07-04 13:37:19 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-07-04 13:37:19 +0000 |
commit | c6e1784062b29aeca6ebb65860e9b021ec3ee43c (patch) | |
tree | 53759f42e76f4084f3c15106ca89235022740a76 /src/mesa/drivers/dri/r128 | |
parent | 2922aa236f11bbbb763cd5dd11075e6f633b3362 (diff) |
enable hw antialiasing (Martijn van Oosterhout)
Diffstat (limited to 'src/mesa/drivers/dri/r128')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_tris.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 46315225165..90cc54b5e38 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -420,8 +420,8 @@ r128_fallback_point( r128ContextPtr rmesa, /**********************************************************************/ #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 r128RasterPrimitive( GLcontext *ctx, GLuint hwprim ) } } +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 ); |