core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

sw_span Struct Reference

#include <s_span.h>


Detailed Description

The SWspan 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 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
SWspanarraysarray
 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.


Field Documentation

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

GLfixed sw_span::red

GLfixed sw_span::redStep

GLfixed sw_span::green

GLfixed sw_span::greenStep

GLfixed sw_span::blue

GLfixed sw_span::blueStep

GLfixed sw_span::alpha

GLfixed sw_span::alphaStep

GLfixed sw_span::index

GLfixed sw_span::indexStep

GLfixed sw_span::z

GLfixed sw_span::zStep

XXX z should probably be GLuint.

GLfixed sw_span::intTex[2]

GLfixed sw_span::intTexStep[2]

(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

SWspanarrays* sw_span::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.

The span_arrays struct is about 1.4MB while the sw_span struct is only about 512 bytes.


The documentation for this struct was generated from the following file:
Generated on Sun Sep 27 06:48:05 2009 for Mesa Software Rasterization (swrast) by  doxygen 1.5.4