fix bug rendering points with fragment program (see #11330)
authorBrian <brian.paul@tungstengraphics.com>
Fri, 22 Jun 2007 15:47:30 +0000 (09:47 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 22 Jun 2007 15:47:30 +0000 (09:47 -0600)
src/mesa/swrast/s_points.c
src/mesa/swrast/s_span.c

index 02c9d9b425105b346f127eb58ed7e942ab7a378b..b91ce73d7a32dfd2f74af163c3697ae571c1a09c 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  7.1
  *
- * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -208,6 +208,14 @@ _swrast_choose_point( GLcontext *ctx )
    GLboolean specular = (ctx->Fog.ColorSumEnabled ||
                          (ctx->Light.Enabled &&
                           ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR));
+   GLboolean attribs = (ctx->FragmentProgram._Current ||
+                        ctx->Texture._EnabledCoordUnits ||
+                        swrast->_FogEnabled ||
+                        specular);
+
+   /*
+    * XXX this is a mess that should be cleaned up someday
+    */
 
    if (ctx->RenderMode==GL_RENDER) {
       if (ctx->Point.PointSprite) {
@@ -218,7 +226,7 @@ _swrast_choose_point( GLcontext *ctx )
          else
             USE(sprite_point);
       }
-      else if (ctx->Point.SmoothFlag) {
+      else if (ctx->Point.SmoothFlag && !attribs) {
          /* Smooth points */
          if (rgbMode) {
             if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
@@ -237,7 +245,7 @@ _swrast_choose_point( GLcontext *ctx )
       }
       else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
          if (rgbMode) {
-            if (ctx->Texture._EnabledCoordUnits) {
+            if (attribs) {
                if (ctx->Point.SmoothFlag) {
                   USE(atten_antialiased_rgba_point);
                }
@@ -254,9 +262,7 @@ _swrast_choose_point( GLcontext *ctx )
             USE(atten_general_ci_point);
          }
       }
-      else if ((ctx->Texture._EnabledCoordUnits
-                || specular
-                || swrast->_FogEnabled) && rgbMode) {
+      else if (attribs && rgbMode) {
          /* textured, fogged */
          USE(textured_rgba_point);
       }
index 9777391ded2338ceabb09a442c4b63a769b96497..4ab6e2e9fbfb3dc6e3e99f39ee94be36252afe64 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.3
+ * Version:  7.1
  *
  * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
@@ -1178,7 +1178,10 @@ shade_texture_span(GLcontext *ctx, SWspan *span)
       if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) {
          convert_color_type(span, GL_FLOAT, 0);
       }
-      interpolate_active_attribs(ctx, span, ~0);
+      if (span->primitive != GL_POINT) {
+         /* for points, we populated the arrays already */
+         interpolate_active_attribs(ctx, span, ~0);
+      }
       span->array->ChanType = GL_FLOAT;
 
       if (!(span->arrayMask & SPAN_Z))