51
51
* \defgroup SpanFlags SPAN_XXX-flags
52
* Bitmasks to indicate which span_arrays need to be computed
52
* Bitmasks to indicate which sw_span_arrays need to be computed
53
53
* (sw_span::interpMask) or have already been filled in (sw_span::arrayMask)
69
69
#define SPAN_VARYING 0x2000
73
/* alternate arrangement for code below */
76
GLubyte sz1[MAX_WIDTH][4]; /* primary color */
77
GLushort sz2[MAX_WIDTH][4];
78
GLfloat sz4[MAX_WIDTH][4];
81
GLubyte sz1[MAX_WIDTH][4]; /* specular color and temp storage */
82
GLushort sz2[MAX_WIDTH][4];
83
GLfloat sz4[MAX_WIDTH][4];
75
91
* \brief Arrays of fragment values.
77
93
* These will either be computed from the x/xStep values above or
78
94
* filled in by glDraw/CopyPixels, etc.
79
95
* These arrays are separated out of sw_span to conserve memory.
82
/* XXX the next three fields could go into a union */
83
GLchan rgb[MAX_WIDTH][3];
84
GLchan rgba[MAX_WIDTH][4];
97
typedef struct sw_span_arrays {
98
GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */
101
GLubyte rgba[MAX_WIDTH][4]; /**< primary color */
102
GLubyte spec[MAX_WIDTH][4]; /**< specular color and temp storage */
105
GLushort rgba[MAX_WIDTH][4];
106
GLushort spec[MAX_WIDTH][4];
109
GLfloat rgba[MAX_WIDTH][4];
110
GLfloat spec[MAX_WIDTH][4];
113
/** XXX these are temporary fields, pointing into above color arrays */
85
117
GLuint index[MAX_WIDTH];
86
GLchan spec[MAX_WIDTH][4]; /* specular color */
87
118
GLint x[MAX_WIDTH]; /**< X/Y used for point/line rendering only */
88
119
GLint y[MAX_WIDTH]; /**< X/Y used for point/line rendering only */
89
120
GLuint z[MAX_WIDTH];
197
228
* a lot of memory. The span_arrays struct is about 400KB while the
198
229
* sw_span struct is only about 512 bytes.
200
struct span_arrays *array;
204
236
#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \
221
253
typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n,
222
254
const GLubyte mask[],
223
GLchan src[][4], CONST GLchan dst[][4] );
255
GLvoid *src, const GLvoid *dst,
225
258
typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
356
388
* this object is big and causes problems when allocated on the stack
357
389
* on some systems.
359
struct span_arrays *SpanArrays;
391
SWspanarrays *SpanArrays;
362
394
* Used to buffer N GL_POINTS, instead of rendering one by one.
364
struct sw_span PointSpan;
366
398
/** Internal hooks, kept up to date by the same mechanism as above.
436
* Size of an RGBA pixel, in bytes, for given datatype.
438
#define RGBA_PIXEL_SIZE(TYPE) \
439
((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \
440
((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \
441
: 4 * sizeof(GLfloat)))
404
446
* XXX these macros are just bandages for now in order to make
405
447
* CHAN_BITS==32 compile cleanly.