Hi, Attached is a small patch for the Radeon driver. It allows use of the full range of point sizes defined in Mesa. It uses the rasterization fallback mechanism when rendering points outside the hardware supported range (!= 1.0). Since point sizes greater than one don't seem be be an implementation requirement this behaviour only occurs when the enironment variable RADEON_LARGE_POINTS is set.
I am interested in finding a more efficient solution, but I'm not very familiar with the code yet. Could anyone suggest a good place to start? Regards, Dylan Perry
Index: xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c,v retrieving revision 1.39 diff -u -a -d -r1.39 radeon_context.c --- xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c 10 Jun 2003 18:50:43 -0000 1.39 +++ xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.c 12 Jul 2003 16:46:48 -0000 @@ -316,13 +316,19 @@ ctx->Const.MaxTextureMaxAnisotropy = 16.0; - /* No wide points. + if ( getenv( "RADEON_LARGE_POINTS" ) == NULL ) { + /* No wide points. + */ + ctx->Const.MinPointSize = 1.0; + ctx->Const.MinPointSizeAA = 1.0; + ctx->Const.MaxPointSize = 1.0; + ctx->Const.MaxPointSizeAA = 1.0; + } + /* This is just a sanity check. If it's zero it would be problematic. */ - ctx->Const.MinPointSize = 1.0; - ctx->Const.MinPointSizeAA = 1.0; - ctx->Const.MaxPointSize = 1.0; - ctx->Const.MaxPointSizeAA = 1.0; - + if ( ctx->Const.PointSizeGranularity < 1.0/1024.0 ) + ctx->Const.PointSizeGranularity = 1.0/1024.0; + ctx->Const.MinLineWidth = 1.0; ctx->Const.MinLineWidthAA = 1.0; ctx->Const.MaxLineWidth = 10.0; Index: xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h,v retrieving revision 1.30 diff -u -a -d -r1.30 radeon_context.h --- xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h 20 Jun 2003 17:50:21 -0000 1.30 +++ xc/xc/lib/GL/mesa/src/drv/radeon/radeon_context.h 12 Jul 2003 16:46:49 -0000 @@ -67,6 +67,7 @@ #define RADEON_FALLBACK_BLEND_FUNC 0x0020 #define RADEON_FALLBACK_DISABLE 0x0040 #define RADEON_FALLBACK_BORDER_MODE 0x0080 +#define RADEON_FALLBACK_POINT_SIZE 0x0100 /* The blit width for texture uploads */ Index: xc/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c,v retrieving revision 1.29 diff -u -a -d -r1.29 radeon_state.c --- xc/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c 9 Jun 2003 23:13:22 -0000 1.29 +++ xc/xc/lib/GL/mesa/src/drv/radeon/radeon_state.c 12 Jul 2003 16:46:54 -0000 @@ -620,6 +620,28 @@ } } +/* ============================================================= + * Point state + */ +static void update_pointsize( GLcontext *ctx, GLfloat size, GLboolean smooth ) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + GLfloat effsize; + if ( !smooth ) { + effsize = CLAMP( size, ctx->Const.MinPointSize, + ctx->Const.MaxPointSize ); + } else { + effsize = CLAMP( size, ctx->Const.MinPointSizeAA, + ctx->Const.MaxPointSizeAA ); + } + FALLBACK( rmesa, RADEON_FALLBACK_POINT_SIZE, + effsize - 1.0 >= ctx->Const.PointSizeGranularity ); +} + +static void radeonPointSize( GLcontext *ctx, GLfloat size ) +{ + update_pointsize( ctx, size, ctx->Point.SmoothFlag != GL_FALSE); +} /* ============================================================= * Polygon state @@ -1784,6 +1806,11 @@ } break; + case GL_POINT_SMOOTH: + update_pointsize( ctx, ctx->Point.Size, + ctx->Point.SmoothFlag != GL_FALSE ); + break; + case GL_POLYGON_OFFSET_POINT: if (rmesa->dri.drmMinor == 1) { radeonChooseRenderState( ctx ); @@ -2135,6 +2162,7 @@ ctx->Driver.LineStipple = radeonLineStipple; ctx->Driver.LineWidth = radeonLineWidth; ctx->Driver.LogicOpcode = radeonLogicOpCode; + ctx->Driver.PointSize = radeonPointSize; ctx->Driver.PolygonMode = radeonPolygonMode; if (RADEON_CONTEXT(ctx)->dri.drmMinor > 1) Index: xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c =================================================================== RCS file: /cvsroot/dri/xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c,v retrieving revision 1.19 diff -u -a -d -r1.19 radeon_swtcl.c --- xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c 10 Jun 2003 18:50:46 -0000 1.19 +++ xc/xc/lib/GL/mesa/src/drv/radeon/radeon_swtcl.c 12 Jul 2003 16:46:59 -0000 @@ -1207,7 +1207,8 @@ "glBlendEquation", "glBlendFunc", "RADEON_NO_RAST", - "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)" + "Mixing GL_CLAMP_TO_BORDER and GL_CLAMP (or GL_MIRROR_CLAMP_ATI)", + "glPointSize(P) where P > 1.0" };