#include <s_span.h>
We can either specify a base/step to indicate interpolated values, or fill in explicit arrays of values. The interpMask and arrayMask bitfields indicate which attributes are active interpolants or arrays, respectively.
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.
Data Fields | |
GLint | x |
Coord of first fragment in horizontal span/run. | |
GLint | y |
GLuint | end |
Number of fragments in the span. | |
GLuint | leftClip |
for clipping left edge of spans | |
GLboolean | writeAll |
This flag indicates that mask[] array is effectively filled with ones. | |
GLenum | primitive |
either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP | |
GLuint | facing |
0 = front-facing span, 1 = back-facing span (for two-sided stencil) | |
GLbitfield | interpMask |
This bitmask (of SPAN_* flags) indicates which of the attrStart/StepX/StepY variables are relevant. | |
GLfloat | attrStart [FRAG_ATTRIB_MAX][4] |
Fragment attribute interpolants. | |
GLfloat | attrStepX [FRAG_ATTRIB_MAX][4] |
dvalue/dx | |
GLfloat | attrStepY [FRAG_ATTRIB_MAX][4] |
dvalue/dy | |
GLfixed | red |
GLfixed | redStep |
GLfixed | green |
GLfixed | greenStep |
GLfixed | blue |
GLfixed | blueStep |
GLfixed | alpha |
GLfixed | alphaStep |
GLfixed | index |
GLfixed | indexStep |
GLfixed | z |
GLfixed | zStep |
XXX z should probably be GLuint. | |
GLfixed | intTex [2] |
GLfixed | intTexStep [2] |
(s,t) for unit[0] only | |
GLbitfield | arrayMask |
This bitmask (of SPAN_* flags) indicates which of the fragment arrays in the span_arrays struct are relevant. | |
GLbitfield | arrayAttribs |
SWspanarrays * | array |
We store the arrays of fragment values in a separate struct so that we can allocate sw_span structs on the stack without using a lot of memory. |
GLint sw_span::x |
Coord of first fragment in horizontal span/run.
GLint sw_span::y |
GLuint sw_span::end |
Number of fragments in the span.
GLuint sw_span::leftClip |
for clipping left edge of spans
GLboolean sw_span::writeAll |
This flag indicates that mask[] array is effectively filled with ones.
GLenum sw_span::primitive |
either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP
GLuint sw_span::facing |
0 = front-facing span, 1 = back-facing span (for two-sided stencil)
GLbitfield sw_span::interpMask |
This bitmask (of SPAN_* flags) indicates which of the attrStart/StepX/StepY variables are relevant.
GLfloat sw_span::attrStart[FRAG_ATTRIB_MAX][4] |
Fragment attribute interpolants.
initial value
GLfloat sw_span::attrStepX[FRAG_ATTRIB_MAX][4] |
dvalue/dx
GLfloat sw_span::attrStepY[FRAG_ATTRIB_MAX][4] |
dvalue/dy
XXX z should probably be GLuint.
(s,t) for unit[0] only
GLbitfield sw_span::arrayMask |
This bitmask (of SPAN_* flags) indicates which of the fragment arrays in the span_arrays struct are relevant.
GLbitfield sw_span::arrayAttribs |