1 /* $Id: s_trispan.h,v 1.1 2001/05/14 16:23:04 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 * The triangle_span structure is used by the triangle template code in
34 * s_tritemp.h. It describes how colors, Z, texcoords, etc are to be
35 * interpolated across each scanline of triangle.
36 * With this structure it's easy to hand-off span rasterization to a
37 * subroutine instead of doing it all inline like we used to do.
38 * It also cleans up the local variable namespace a great deal.
40 * It would be interesting to experiment with multiprocessor rasterization
41 * with this structure. The triangle rasterizer could simply emit a
42 * stream of these structures which would be consumed by one or more
43 * span-processing threads which could run in parallel.
47 #define SPAN_RGBA 0x01
48 #define SPAN_SPEC 0x02
49 #define SPAN_INDEX 0x04
52 #define SPAN_TEXTURE 0x20
53 #define SPAN_INT_TEXTURE 0x40
54 #define SPAN_LAMBDA 0x80
57 struct triangle_span
{
60 GLuint activeMask
; /* OR of the SPAN_* flags */
62 GLfixed green
, greenStep
;
63 GLfixed blue
, blueStep
;
64 GLfixed alpha
, alphaStep
;
65 GLfixed specRed
, specRedStep
;
66 GLfixed specGreen
, specGreenStep
;
67 GLfixed specBlue
, specBlueStep
;
68 GLfixed index
, indexStep
;
71 GLfloat tex
[MAX_TEXTURE_UNITS
][4], texStep
[MAX_TEXTURE_UNITS
][4];
72 GLfixed intTex
[2], intTexStep
[2];
73 /* Needed for texture lambda (LOD) computation */
74 GLfloat rho
[MAX_TEXTURE_UNITS
];
75 GLfloat texWidth
[MAX_TEXTURE_UNITS
], texHeight
[MAX_TEXTURE_UNITS
];
79 #endif /* S_TRISPAN_H */