r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_span.h
index 292679bda144472cf8a7689755a0dc84aaefdf8e..f650a27d6650f6f4d1869301bcab81301feec61e 100644 (file)
@@ -35,6 +35,8 @@
  * \defgroup SpanFlags
  * Bitflags used for interpMask and arrayMask fields below to indicate
  * which interpolant values and fragment arrays are in use, respectively.
+ *
+ * XXX We should replace these flags with the FRAG_BIT_ values someday...
  */
 /*@{*/
 #define SPAN_RGBA         0x001
@@ -81,6 +83,9 @@ struct arrays2 {
 typedef struct sw_span_arrays
 {
    /** Per-fragment attributes (indexed by FRAG_ATTRIB_* tokens) */
+   /* XXX someday look at transposing first two indexes for better memory
+    * access pattern.
+    */
    GLfloat attribs[FRAG_ATTRIB_MAX][MAX_WIDTH][4];
 
    /** This mask indicates which fragments are alive or culled */
@@ -124,11 +129,11 @@ typedef struct sw_span_arrays
  */
 typedef struct sw_span
 {
+   /** Coord of first fragment in horizontal span/run */
    GLint x, y;
 
-   /** Only need to process pixels between start <= i < end */
-   /** At this time, start is always zero. */
-   GLuint start, end;
+   /** Number of fragments in the span */
+   GLuint end;
 
    /** This flag indicates that mask[] array is effectively filled with ones */
    GLboolean writeAll;
@@ -141,10 +146,17 @@ typedef struct sw_span
 
    /**
     * This bitmask (of  \link SpanFlags SPAN_* flags\endlink) indicates
-    * which of the x/xStep variables are relevant.
+    * which of the attrStart/StepX/StepY variables are relevant.
     */
    GLbitfield interpMask;
 
+   /** Fragment attribute interpolants */
+   GLfloat attrStart[FRAG_ATTRIB_MAX][4];   /**< initial value */
+   GLfloat attrStepX[FRAG_ATTRIB_MAX][4];   /**< dvalue/dx */
+   GLfloat attrStepY[FRAG_ATTRIB_MAX][4];   /**< dvalue/dy */
+
+   /* XXX the rest of these will go away eventually... */
+
    /* For horizontal spans, step is the partial derivative wrt X.
     * For lines, step is the delta from one fragment to the next.
     */
@@ -167,26 +179,7 @@ typedef struct sw_span
 #endif
    GLfixed index, indexStep;
    GLfixed z, zStep;    /* XXX z should probably be GLuint */
-   GLfloat fog, fogStep;
-   GLfloat tex[MAX_TEXTURE_COORD_UNITS][4];  /* s, t, r, q */
-   GLfloat texStepX[MAX_TEXTURE_COORD_UNITS][4];
-   GLfloat texStepY[MAX_TEXTURE_COORD_UNITS][4];
    GLfixed intTex[2], intTexStep[2];  /* s, t only */
-   GLfloat var[MAX_VARYING][4];
-   GLfloat varStepX[MAX_VARYING][4];
-   GLfloat varStepY[MAX_VARYING][4];
-
-   /* partial derivatives wrt X and Y. */
-   GLfloat dzdx, dzdy;
-   GLfloat w, dwdx, dwdy;
-   GLfloat drdx, drdy;
-   GLfloat dgdx, dgdy;
-   GLfloat dbdx, dbdy;
-   GLfloat dadx, dady;
-   GLfloat dsrdx, dsrdy;
-   GLfloat dsgdx, dsgdy;
-   GLfloat dsbdx, dsbdy;
-   GLfloat dfogdx, dfogdy;
 
    /**
     * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
@@ -210,7 +203,6 @@ do {                                                                \
    (S).primitive = (PRIMITIVE);                                        \
    (S).interpMask = (INTERP_MASK);                             \
    (S).arrayMask = (ARRAY_MASK);                               \
-   (S).start = 0;                                              \
    (S).end = (END);                                            \
    (S).facing = 0;                                             \
    (S).array = SWRAST_CONTEXT(ctx)->SpanArrays;                        \
@@ -230,6 +222,9 @@ _swrast_span_default_fog( GLcontext *ctx, SWspan *span );
 extern void
 _swrast_span_default_color( GLcontext *ctx, SWspan *span );
 
+extern void
+_swrast_span_default_secondary_color(GLcontext *ctx, SWspan *span);
+
 extern void
 _swrast_span_default_texcoords( GLcontext *ctx, SWspan *span );