swrast: fix point rendering function selection
authorBrian Paul <brianp@vmware.com>
Tue, 7 Apr 2009 19:28:10 +0000 (13:28 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 7 Apr 2009 19:44:13 +0000 (13:44 -0600)
Need to clamp default point size to min/max range before checking if it's one.
Fixes glean pointAtten test.

src/mesa/swrast/s_points.c

index 61ff4d0b84cde4395ddf641125f8bdd124f21ef8..0a3ad97a71b34d966220ce7607160976f5fed93b 100644 (file)
@@ -570,6 +570,9 @@ void
 _swrast_choose_point(GLcontext *ctx)
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   const GLfloat size = CLAMP(ctx->Point.Size,
+                              ctx->Point.MinSize,
+                              ctx->Point.MaxSize);
 
    if (ctx->RenderMode == GL_RENDER) {
       if (ctx->Point.PointSprite) {
@@ -578,7 +581,7 @@ _swrast_choose_point(GLcontext *ctx)
       else if (ctx->Point.SmoothFlag) {
          swrast->Point = smooth_point;
       }
-      else if (ctx->Point.Size > 1.0 ||
+      else if (size > 1.0 ||
                ctx->Point._Attenuated ||
                ctx->VertexProgram.PointSizeEnabled) {
          swrast->Point = large_point;