diff options
author | Brian Paul <[email protected]> | 2002-04-19 14:05:50 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-04-19 14:05:50 +0000 |
commit | bf80e1ed620836e2ca0dd3f7d2d4cb187d17563d (patch) | |
tree | 8666b72f2ff74ac9499d2f9668212fcf4f2e3f5b /src/mesa/swrast/swrast.h | |
parent | 05be7ae1253ad68d80816395c3d09665e5619ebc (diff) |
Allocate a sw_span struct in the swrast context instead of allocating it
on the stack frame in the point/line/triangle functions. (Klaus Niederkrueger)
This should solve the performance problem Karl found on Windows.
Diffstat (limited to 'src/mesa/swrast/swrast.h')
-rw-r--r-- | src/mesa/swrast/swrast.h | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index a90d498eb59..f36031cfb4a 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -1,4 +1,4 @@ -/* $Id: swrast.h,v 1.23 2002/04/12 15:47:21 brianp Exp $ */ +/* $Id: swrast.h,v 1.24 2002/04/19 14:05:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,12 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * Authors: - * Keith Whitwell <[email protected]> + */ + +/** + * \file swrast/swrast.h + * \brief Defines basic structures for sw_rasterizer. + * \author Keith Whitwell <[email protected]> */ #ifndef SWRAST_H @@ -32,8 +36,11 @@ #include "mtypes.h" - -/* The software rasterizer now uses this format for vertices. Thus a +/** + * \struct SWvertex + * \brief Data-structure to handle vertices in the software rasterizer. + * + * The software rasterizer now uses this format for vertices. Thus a * 'RasterSetup' stage or other translation is required between the * tnl module and the swrast rasterization functions. This serves to * isolate the swrast module from the internals of the tnl module, and @@ -66,11 +73,17 @@ typedef struct { } SWvertex; -/* +/** + * \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 a horizontal run of 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. + * 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 @@ -102,14 +115,14 @@ typedef struct { struct sw_span { GLint x, y; - /* Only need to process pixels between start <= i < end */ - /* At this time, start is always zero. */ + /** Only need to process pixels between start <= i < end */ + /** At this time, start is always zero. */ GLuint start, end; - /* This flag indicates that mask[] array is effectively filled with ones */ + /** This flag indicates that mask[] array is effectively filled with ones */ GLboolean writeAll; - /* either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */ + /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */ GLenum primitive; /** @@ -159,26 +172,26 @@ struct sw_span { GLuint index[MAX_WIDTH]; } color; GLchan specArray[MAX_WIDTH][4]; - GLint xArray[MAX_WIDTH]; /* X/Y used for point/line rendering only */ - GLint yArray[MAX_WIDTH]; + GLint xArray[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ + GLint yArray[MAX_WIDTH]; /**< X/Y used for point/line rendering only */ GLdepth zArray[MAX_WIDTH]; GLfloat fogArray[MAX_WIDTH]; GLfloat texcoords[MAX_TEXTURE_UNITS][MAX_WIDTH][4]; GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH]; GLfloat coverage[MAX_WIDTH]; - /* This mask indicates if fragment is alive or culled */ + /** This mask indicates if fragment is alive or culled */ GLubyte mask[MAX_WIDTH]; }; #define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \ do { \ - S.primitive = (PRIMITIVE); \ - S.interpMask = (INTERP_MASK); \ - S.arrayMask = (ARRAY_MASK); \ - S.start = 0; \ - S.end = (END); \ + S->primitive = (PRIMITIVE); \ + S->interpMask = (INTERP_MASK); \ + S->arrayMask = (ARRAY_MASK); \ + S->start = 0; \ + S->end = (END); \ } while (0) |