-/* $Id: s_context.h,v 1.24 2003/02/23 04:10:54 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 5.1
#include "swrast.h"
-/**
- * \struct sw_span
- * \brief Contains data for either a horizontal line or a set of
- * pixels that are passed through a pipeline of functions before being
- * drawn.
- *
- * The sw_span structure describes the colors, Z, fogcoord, texcoords,
- * etc for either a horizontal run or a set of independent pixels. We
- * can either specify a base/step to indicate interpolated values, or
- * fill in arrays of values. The interpMask and arrayMask bitfields
- * indicate which are active.
- *
- * With this structure it's easy to hand-off span rasterization to
- * subroutines instead of doing it all inline in the triangle functions
- * like we used to do.
- * It also cleans up the local variable namespace a great deal.
- *
- * It would be interesting to experiment with multiprocessor rasterization
- * with this structure. The triangle rasterizer could simply emit a
- * stream of these structures which would be consumed by one or more
- * span-processing threads which could run in parallel.
- */
-
-
/**
* \defgroup SpanFlags SPAN_XXX-flags
* Bitmasks to indicate which span_arrays need to be computed
};
+/**
+ * \struct sw_span
+ * \brief Contains data for either a horizontal line or a set of
+ * pixels that are passed through a pipeline of functions before being
+ * drawn.
+ *
+ * The sw_span structure describes the colors, Z, fogcoord, texcoords,
+ * etc for either a horizontal run or an array of independent pixels.
+ * We can either specify a base/step to indicate interpolated values, or
+ * fill in arrays of values. The interpMask and arrayMask bitfields
+ * indicate which are active.
+ *
+ * With this structure it's easy to hand-off span rasterization to
+ * subroutines instead of doing it all inline in the triangle functions
+ * like we used to do.
+ * It also cleans up the local variable namespace a great deal.
+ *
+ * It would be interesting to experiment with multiprocessor rasterization
+ * with this structure. The triangle rasterizer could simply emit a
+ * stream of these structures which would be consumed by one or more
+ * span-processing threads which could run in parallel.
+ */
struct sw_span {
GLint x, y;
*/
GLuint interpMask;
+ /* For horizontal spans, step is the partial derivative wrt X.
+ * For lines, step is the delta from one fragment to the next.
+ */
#if CHAN_TYPE == GL_FLOAT
GLfloat red, redStep;
GLfloat green, greenStep;
GLfloat specRed, specRedStep;
GLfloat specGreen, specGreenStep;
GLfloat specBlue, specBlueStep;
-#else /* CHAN_TYPE == GL_UNSIGNED_BYTE or GL_UNSIGNED SHORT */
+#else /* CHAN_TYPE == GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT */
GLfixed red, redStep;
GLfixed green, greenStep;
GLfixed blue, blueStep;
GLfloat texStepY[MAX_TEXTURE_COORD_UNITS][4];
GLfixed intTex[2], intTexStep[2]; /* s, t only */
+ /* 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
* which of the fragment arrays in the span_arrays struct are relevant.
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4]);
-#ifdef USE_MMX_ASM
typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n,
const GLubyte mask[],
GLchan src[][4], CONST GLchan dst[][4] );
-#else
-typedef void (*blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[],
- GLchan src[][4], CONST GLchan dst[][4] );
-#endif
typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
/**< buffer or no buffers. */
#define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */
#define TEXTURE_BIT 0x1000 /**< Texturing really enabled */
+#define FRAGPROG_BIT 0x2000 /**< Fragment program enabled */
/*@}*/
#define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \
_NEW_COLOR| \
_NEW_DEPTH| \
_NEW_FOG| \
+ _NEW_PROGRAM| \
_NEW_STENCIL| \
_NEW_TEXTURE| \
_NEW_VIEWPORT| \
*/
GLuint _RasterMask;
GLfloat _MinMagThresh[MAX_TEXTURE_IMAGE_UNITS];
- GLfloat _backface_sign;
+ GLfloat _BackfaceSign;
GLboolean _PreferPixelFog;
GLboolean _AnyTextureCombine;