added missing \'s
[mesa.git] / src / mesa / swrast / s_trispan.h
1 /* $Id: s_trispan.h,v 1.1 2001/05/14 16:23:04 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
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:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
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.
25 */
26
27
28 #ifndef S_TRISPAN_H
29 #define S_TRISPAN_H
30
31
32 /*
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.
39 *
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.
44 */
45
46
47 #define SPAN_RGBA 0x01
48 #define SPAN_SPEC 0x02
49 #define SPAN_INDEX 0x04
50 #define SPAN_Z 0x08
51 #define SPAN_FOG 0x10
52 #define SPAN_TEXTURE 0x20
53 #define SPAN_INT_TEXTURE 0x40
54 #define SPAN_LAMBDA 0x80
55
56
57 struct triangle_span {
58 GLint x, y;
59 GLuint count;
60 GLuint activeMask; /* OR of the SPAN_* flags */
61 GLfixed red, redStep;
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;
69 GLfixed z, zStep;
70 GLfloat fog, fogStep;
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];
76 };
77
78
79 #endif /* S_TRISPAN_H */