r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_points.c
index 0c3b4d0f08448075b7adf30a6be9981f60ef5682..1401b772caf531445db958ac2ab93297d0300c57 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: s_points.c,v 1.15 2001/03/12 00:48:42 gareth Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  6.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  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"),
 #include "colormac.h"
 #include "context.h"
 #include "macros.h"
-#include "mmath.h"
 #include "texstate.h"
 #include "s_context.h"
 #include "s_feedback.h"
-#include "s_pb.h"
 #include "s_points.h"
 #include "s_span.h"
 
 
 
-#define INDEX      0x0
 #define RGBA       0x1
-#define SMOOTH     0x2
-#define TEXTURE    0x4
-#define SPECULAR   0x8
-#define LARGE     0x10
-#define ATTENUATE 0x20
-#define SPRITE    0x40
+#define INDEX      0x2
+#define SMOOTH     0x4
+#define ATTRIBS    0x8
+#define SPECULAR  0x10
+#define LARGE     0x20
+#define ATTENUATE 0x40
+#define SPRITE    0x80
 
 
 /*
 /*
  * Textured RGBA points.
  */
-#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR)
 #define NAME textured_rgba_point
 #include "s_pointtemp.h"
 
 /*
  * Antialiased points with texture mapping.
  */
-#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR)
 #define NAME antialiased_tex_rgba_point
 #include "s_pointtemp.h"
 
 /*
  * Distance attenuated, textured RGBA points.
  */
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR)
 #define NAME atten_textured_rgba_point
 #include "s_pointtemp.h"
 
 /*
  * Distance attenuated, antialiased points with or without texture mapping.
  */
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH)
+#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH)
 #define NAME atten_antialiased_rgba_point
 #include "s_pointtemp.h"
 
 /*
  * Sprite (textured point)
  */
-#define FLAGS (RGBA | TEXTURE | SPRITE)
+#define FLAGS (RGBA | SPRITE | SPECULAR)
 #define NAME sprite_point
 #include "s_pointtemp.h"
 
 
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPRITE)
+#define FLAGS (RGBA | SPRITE | SPECULAR | ATTENUATE)
 #define NAME atten_sprite_point
 #include "s_pointtemp.h"
 
@@ -202,7 +198,8 @@ _swrast_choose_point( GLcontext *ctx )
    GLboolean rgbMode = ctx->Visual.rgbMode;
 
    if (ctx->RenderMode==GL_RENDER) {
-      if (ctx->Point.SpriteMode) {
+      if (ctx->Point.PointSprite) {
+         /* GL_ARB_point_sprite / GL_NV_point_sprite */
          /* XXX this might not be good enough */
          if (ctx->Point._Attenuated)
             USE(atten_sprite_point);
@@ -212,10 +209,10 @@ _swrast_choose_point( GLcontext *ctx )
       else if (ctx->Point.SmoothFlag) {
          /* Smooth points */
          if (rgbMode) {
-            if (ctx->Point._Attenuated) {
+            if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
                USE(atten_antialiased_rgba_point);
             }
-            else if (ctx->Texture._ReallyEnabled) {
+            else if (ctx->Texture._EnabledCoordUnits) {
                USE(antialiased_tex_rgba_point);
             }
             else {
@@ -226,9 +223,9 @@ _swrast_choose_point( GLcontext *ctx )
             USE(antialiased_ci_point);
          }
       }
-      else if (ctx->Point._Attenuated) {
+      else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
          if (rgbMode) {
-            if (ctx->Texture._ReallyEnabled) {
+            if (ctx->Texture._EnabledCoordUnits) {
                if (ctx->Point.SmoothFlag) {
                   USE(atten_antialiased_rgba_point);
                }
@@ -245,11 +242,11 @@ _swrast_choose_point( GLcontext *ctx )
             USE(atten_general_ci_point);
          }
       }
-      else if (ctx->Texture._ReallyEnabled && rgbMode) {
+      else if (ctx->Texture._EnabledCoordUnits && rgbMode) {
          /* textured */
          USE(textured_rgba_point);
       }
-      else if (ctx->Point.Size != 1.0) {
+      else if (ctx->Point._Size != 1.0) {
          /* large points */
          if (rgbMode) {
             USE(general_rgba_point);
@@ -269,10 +266,10 @@ _swrast_choose_point( GLcontext *ctx )
       }
    }
    else if (ctx->RenderMode==GL_FEEDBACK) {
-      USE(_mesa_feedback_point);
+      USE(_swrast_feedback_point);
    }
    else {
       /* GL_SELECT mode */
-      USE(_mesa_select_point);
+      USE(_swrast_select_point);
    }
 }