3 * Main Mesa data structures.
5 * Please try to mark derived values with a leading underscore ('_').
9 * Mesa 3-D graphics library
12 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the "Software"),
16 * to deal in the Software without restriction, including without limitation
17 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 * and/or sell copies of the Software, and to permit persons to whom the
19 * Software is furnished to do so, subject to the following conditions:
21 * The above copyright notice and this permission notice shall be included
22 * in all copies or substantial portions of the Software.
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
28 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 #include "config.h" /* Hardwired parameters */
40 #include "glapitable.h"
42 #include "math/m_matrix.h" /* GLmatrix */
46 * Color channel data type.
49 typedef GLubyte GLchan
;
51 #define CHAN_MAXF 255.0F
52 #define CHAN_TYPE GL_UNSIGNED_BYTE
54 typedef GLushort GLchan
;
55 #define CHAN_MAX 65535
56 #define CHAN_MAXF 65535.0F
57 #define CHAN_TYPE GL_UNSIGNED_SHORT
59 typedef GLfloat GLchan
;
61 #define CHAN_MAXF 1.0F
62 #define CHAN_TYPE GL_FLOAT
64 #error "illegal number of color channel bits"
69 * Accumulation buffer data type.
72 typedef GLbyte GLaccum
;
74 typedef GLshort GLaccum
;
76 typedef GLfloat GLaccum
;
78 # error "illegal number of accumulation bits"
83 * Stencil buffer data type.
86 typedef GLubyte GLstencil
;
87 # define STENCIL_MAX 0xff
88 #elif STENCIL_BITS==16
89 typedef GLushort GLstencil
;
90 # define STENCIL_MAX 0xffff
92 # error "illegal number of stencil bits"
97 * Depth buffer data type.
99 * \note Must be 32-bits!
101 typedef GLuint GLdepth
;
105 * Fixed point data type.
109 * Fixed point arithmetic macros
111 #ifndef FIXED_FRAC_BITS
112 #define FIXED_FRAC_BITS 11
115 #define FIXED_SHIFT FIXED_FRAC_BITS
116 #define FIXED_ONE (1 << FIXED_SHIFT)
117 #define FIXED_HALF (1 << (FIXED_SHIFT-1))
118 #define FIXED_FRAC_MASK (FIXED_ONE - 1)
119 #define FIXED_INT_MASK (~FIXED_FRAC_MASK)
120 #define FIXED_EPSILON 1
121 #define FIXED_SCALE ((float) FIXED_ONE)
122 #define FIXED_DBL_SCALE ((double) FIXED_ONE)
123 #define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
124 #define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))
125 #define IntToFixed(I) ((I) << FIXED_SHIFT)
126 #define FixedToInt(X) ((X) >> FIXED_SHIFT)
127 #define FixedToUns(X) (((unsigned int)(X)) >> FIXED_SHIFT)
128 #define FixedCeil(X) (((X) + FIXED_ONE - FIXED_EPSILON) & FIXED_INT_MASK)
129 #define FixedFloor(X) ((X) & FIXED_INT_MASK)
130 #define FixedToFloat(X) ((X) * (1.0F / FIXED_SCALE))
131 #define PosFloatToFixed(X) FloatToFixed(X)
132 #define SignedFloatToFixed(X) FloatToFixed(X)
137 * \name Some forward type declarations
140 struct _mesa_HashTable
;
141 struct gl_texture_image
;
142 struct gl_texture_object
;
143 typedef struct __GLcontextRec GLcontext
;
144 typedef struct __GLcontextModesRec GLvisual
;
145 typedef struct gl_frame_buffer GLframebuffer
;
146 struct gl_pixelstore_attrib
;
147 struct gl_texture_format
;
153 * Indexes for vertex program attributes.
154 * GL_NV_vertex_program aliases generic attributes over the conventional
155 * attributes. In GL_ARB_vertex_program shader the aliasing is optional.
156 * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
157 * generic attributes are distinct/separate).
161 VERT_ATTRIB_WEIGHT
= 1,
162 VERT_ATTRIB_NORMAL
= 2,
163 VERT_ATTRIB_COLOR0
= 3,
164 VERT_ATTRIB_COLOR1
= 4,
167 VERT_ATTRIB_SEVEN
= 7,
168 VERT_ATTRIB_TEX0
= 8,
169 VERT_ATTRIB_TEX1
= 9,
170 VERT_ATTRIB_TEX2
= 10,
171 VERT_ATTRIB_TEX3
= 11,
172 VERT_ATTRIB_TEX4
= 12,
173 VERT_ATTRIB_TEX5
= 13,
174 VERT_ATTRIB_TEX6
= 14,
175 VERT_ATTRIB_TEX7
= 15,
176 VERT_ATTRIB_GENERIC0
= 16,
177 VERT_ATTRIB_GENERIC1
= 17,
178 VERT_ATTRIB_GENERIC2
= 18,
179 VERT_ATTRIB_GENERIC3
= 19,
184 * Bitflags for vertex attributes.
185 * These are used in bitfields in many places.
188 #define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
189 #define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
190 #define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
191 #define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
192 #define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
193 #define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
194 #define VERT_BIT_SIX (1 << VERT_ATTRIB_SIX)
195 #define VERT_BIT_SEVEN (1 << VERT_ATTRIB_SEVEN)
196 #define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
197 #define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
198 #define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
199 #define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
200 #define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
201 #define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
202 #define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
203 #define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
204 #define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0)
205 #define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1)
206 #define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2)
207 #define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3)
209 #define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
210 #define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g)))
215 * Indexes for fragment program input attributes.
218 FRAG_ATTRIB_WPOS
= 0,
219 FRAG_ATTRIB_COL0
= 1,
220 FRAG_ATTRIB_COL1
= 2,
221 FRAG_ATTRIB_FOGC
= 3,
222 FRAG_ATTRIB_TEX0
= 4,
223 FRAG_ATTRIB_TEX1
= 5,
224 FRAG_ATTRIB_TEX2
= 6,
225 FRAG_ATTRIB_TEX3
= 7,
226 FRAG_ATTRIB_TEX4
= 8,
227 FRAG_ATTRIB_TEX5
= 9,
228 FRAG_ATTRIB_TEX6
= 10,
229 FRAG_ATTRIB_TEX7
= 11
233 * Bitflags for fragment attributes.
236 #define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
237 #define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
238 #define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
239 #define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
240 #define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
241 #define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
242 #define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
243 #define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
244 #define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
245 #define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
246 #define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
247 #define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
249 #define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
261 * Bits for each basic buffer in a complete framebuffer.
262 * When glDrawBuffer(GL_FRONT_AND_BACK) is called (non-stereo),
263 * _DrawDestMask will be set to (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT),
264 * for example. Also passed to ctx->Driver.Clear() to indicate which
268 #define DD_FRONT_LEFT_BIT 0x1
269 #define DD_FRONT_RIGHT_BIT 0x2
270 #define DD_BACK_LEFT_BIT 0x4
271 #define DD_BACK_RIGHT_BIT 0x8
272 #define DD_AUX0_BIT 0x10
273 #define DD_AUX1_BIT 0x20
274 #define DD_AUX2_BIT 0x40
275 #define DD_AUX3_BIT 0x80
276 #define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */
277 #define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */
278 #define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */
283 * Data structure for color tables
285 struct gl_color_table
{
286 GLenum Format
; /**< GL_ALPHA, GL_RGB, GL_RGB, etc */
288 GLuint Size
; /**< number of entries (rows) in table */
289 GLvoid
*Table
; /**< points to data of <Type> */
290 GLenum Type
; /**< GL_UNSIGNED_BYTE or GL_FLOAT */
295 GLubyte LuminanceSize
;
296 GLubyte IntensitySize
;
301 * \name Bit flags used for updating material values.
304 #define MAT_ATTRIB_FRONT_AMBIENT 0
305 #define MAT_ATTRIB_BACK_AMBIENT 1
306 #define MAT_ATTRIB_FRONT_DIFFUSE 2
307 #define MAT_ATTRIB_BACK_DIFFUSE 3
308 #define MAT_ATTRIB_FRONT_SPECULAR 4
309 #define MAT_ATTRIB_BACK_SPECULAR 5
310 #define MAT_ATTRIB_FRONT_EMISSION 6
311 #define MAT_ATTRIB_BACK_EMISSION 7
312 #define MAT_ATTRIB_FRONT_SHININESS 8
313 #define MAT_ATTRIB_BACK_SHININESS 9
314 #define MAT_ATTRIB_FRONT_INDEXES 10
315 #define MAT_ATTRIB_BACK_INDEXES 11
316 #define MAT_ATTRIB_MAX 12
318 #define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f))
319 #define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f))
320 #define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f))
321 #define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f))
322 #define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f))
323 #define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f))
325 #define MAT_INDEX_AMBIENT 0
326 #define MAT_INDEX_DIFFUSE 1
327 #define MAT_INDEX_SPECULAR 2
329 #define MAT_BIT_FRONT_AMBIENT (1<<MAT_ATTRIB_FRONT_AMBIENT)
330 #define MAT_BIT_BACK_AMBIENT (1<<MAT_ATTRIB_BACK_AMBIENT)
331 #define MAT_BIT_FRONT_DIFFUSE (1<<MAT_ATTRIB_FRONT_DIFFUSE)
332 #define MAT_BIT_BACK_DIFFUSE (1<<MAT_ATTRIB_BACK_DIFFUSE)
333 #define MAT_BIT_FRONT_SPECULAR (1<<MAT_ATTRIB_FRONT_SPECULAR)
334 #define MAT_BIT_BACK_SPECULAR (1<<MAT_ATTRIB_BACK_SPECULAR)
335 #define MAT_BIT_FRONT_EMISSION (1<<MAT_ATTRIB_FRONT_EMISSION)
336 #define MAT_BIT_BACK_EMISSION (1<<MAT_ATTRIB_BACK_EMISSION)
337 #define MAT_BIT_FRONT_SHININESS (1<<MAT_ATTRIB_FRONT_SHININESS)
338 #define MAT_BIT_BACK_SHININESS (1<<MAT_ATTRIB_BACK_SHININESS)
339 #define MAT_BIT_FRONT_INDEXES (1<<MAT_ATTRIB_FRONT_INDEXES)
340 #define MAT_BIT_BACK_INDEXES (1<<MAT_ATTRIB_BACK_INDEXES)
343 #define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \
344 MAT_BIT_FRONT_AMBIENT | \
345 MAT_BIT_FRONT_DIFFUSE | \
346 MAT_BIT_FRONT_SPECULAR | \
347 MAT_BIT_FRONT_SHININESS | \
348 MAT_BIT_FRONT_INDEXES)
350 #define BACK_MATERIAL_BITS (MAT_BIT_BACK_EMISSION | \
351 MAT_BIT_BACK_AMBIENT | \
352 MAT_BIT_BACK_DIFFUSE | \
353 MAT_BIT_BACK_SPECULAR | \
354 MAT_BIT_BACK_SHININESS | \
355 MAT_BIT_BACK_INDEXES)
357 #define ALL_MATERIAL_BITS (FRONT_MATERIAL_BITS | BACK_MATERIAL_BITS)
361 #define EXP_TABLE_SIZE 512 /**< Specular exponent lookup table sizes */
362 #define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes */
365 * Material shininess lookup table.
367 struct gl_shine_tab
{
368 struct gl_shine_tab
*next
, *prev
;
369 GLfloat tab
[SHINE_TABLE_SIZE
+1];
379 struct gl_light
*next
; /**< double linked list with sentinel */
380 struct gl_light
*prev
;
382 GLfloat Ambient
[4]; /**< ambient color */
383 GLfloat Diffuse
[4]; /**< diffuse color */
384 GLfloat Specular
[4]; /**< specular color */
385 GLfloat EyePosition
[4]; /**< position in eye coordinates */
386 GLfloat EyeDirection
[4]; /**< spotlight dir in eye coordinates */
387 GLfloat SpotExponent
;
388 GLfloat SpotCutoff
; /**< in degrees */
389 GLfloat _CosCutoff
; /**< = MAX(0, cos(SpotCutoff)) */
390 GLfloat ConstantAttenuation
;
391 GLfloat LinearAttenuation
;
392 GLfloat QuadraticAttenuation
;
393 GLboolean Enabled
; /**< On/off flag */
396 * \name Derived fields
399 GLuint _Flags
; /**< State */
401 GLfloat _Position
[4]; /**< position in eye/obj coordinates */
402 GLfloat _VP_inf_norm
[3]; /**< Norm direction to infinite light */
403 GLfloat _h_inf_norm
[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */
404 GLfloat _NormDirection
[4]; /**< normalized spotlight direction */
405 GLfloat _VP_inf_spot_attenuation
;
407 GLfloat _SpotExpTable
[EXP_TABLE_SIZE
][2]; /**< to replace a pow() call */
408 GLfloat _MatAmbient
[2][3]; /**< material ambient * light ambient */
409 GLfloat _MatDiffuse
[2][3]; /**< material diffuse * light diffuse */
410 GLfloat _MatSpecular
[2][3]; /**< material spec * light specular */
411 GLfloat _dli
; /**< CI diffuse light intensity */
412 GLfloat _sli
; /**< CI specular light intensity */
420 struct gl_lightmodel
{
421 GLfloat Ambient
[4]; /**< ambient color */
422 GLboolean LocalViewer
; /**< Local (or infinite) view point? */
423 GLboolean TwoSide
; /**< Two (or one) sided lighting? */
424 GLenum ColorControl
; /**< either GL_SINGLE_COLOR
425 * or GL_SEPARATE_SPECULAR_COLOR */
434 GLfloat Attrib
[MAT_ATTRIB_MAX
][4];
439 * Accumulation buffer attributes.
441 struct gl_accum_attrib
{
442 GLfloat ClearColor
[4]; /**< Accumulation buffer clear color */
447 * Color buffer attributes.
449 struct gl_colorbuffer_attrib
{
450 GLuint ClearIndex
; /**< Index to use for glClear */
451 GLclampf ClearColor
[4]; /**< Color to use for glClear */
453 GLuint IndexMask
; /**< Color index write mask */
454 GLubyte ColorMask
[4]; /**< Each flag is 0xff or 0x0 */
456 GLenum DrawBuffer
[MAX_DRAW_BUFFERS
]; /**< Which buffer to draw into */
457 GLbitfield _DrawDestMask
[MAX_DRAW_BUFFERS
];/**< bitmask of DD_*_BIT bits */
460 * \name alpha testing
463 GLboolean AlphaEnabled
; /**< Alpha test enabled flag */
464 GLenum AlphaFunc
; /**< Alpha test function */
465 GLclampf AlphaRef
; /**< Alpha reference value */
472 GLboolean BlendEnabled
; /**< Blending enabled flag */
473 GLenum BlendSrcRGB
; /**< Blending source operator */
474 GLenum BlendDstRGB
; /**< Blending destination operator */
475 GLenum BlendSrcA
; /**< GL_INGR_blend_func_separate */
476 GLenum BlendDstA
; /**< GL_INGR_blend_func_separate */
477 GLenum BlendEquationRGB
; /**< Blending equation */
478 GLenum BlendEquationA
; /**< GL_EXT_blend_equation_separate */
479 GLfloat BlendColor
[4]; /**< Blending color */
486 GLenum LogicOp
; /**< Logic operator */
487 GLboolean IndexLogicOpEnabled
; /**< Color index logic op enabled flag */
488 GLboolean ColorLogicOpEnabled
; /**< RGBA logic op enabled flag */
489 GLboolean _LogicOpEnabled
; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
492 GLboolean DitherFlag
; /**< Dither enable flag */
497 * Current attributes.
499 struct gl_current_attrib
{
501 * \name Values valid only when FLUSH_VERTICES has been called.
504 GLfloat Attrib
[VERT_ATTRIB_MAX
][4]; /**< Current vertex attributes
505 * indexed by VERT_ATTRIB_* */
506 GLfloat Index
; /**< Current color index */
507 GLboolean EdgeFlag
; /**< Current edge flag */
511 * \name Values are always valid.
513 * \note BTW, note how similar this set of attributes is to the SWvertex
514 * data type in the software rasterizer...
517 GLfloat RasterPos
[4]; /**< Current raster position */
518 GLfloat RasterDistance
; /**< Current raster distance */
519 GLfloat RasterColor
[4]; /**< Current raster color */
520 GLfloat RasterSecondaryColor
[4]; /**< Current raster secondary color */
521 GLfloat RasterIndex
; /**< Current raster index */
522 GLfloat RasterTexCoords
[MAX_TEXTURE_UNITS
][4];/**< Current raster texcoords */
523 GLboolean RasterPosValid
; /**< Raster pos valid flag */
529 * Depth buffer attributes.
531 struct gl_depthbuffer_attrib
{
532 GLenum Func
; /**< Function for depth buffer compare */
533 GLclampd Clear
; /**< Value to clear depth buffer to */
534 GLboolean Test
; /**< Depth buffering enabled flag */
535 GLboolean Mask
; /**< Depth buffer writable? */
536 GLboolean OcclusionTest
; /**< GL_HP_occlusion_test */
537 GLboolean BoundsTest
; /**< GL_EXT_depth_bounds_test */
538 GLfloat BoundsMin
, BoundsMax
;/**< GL_EXT_depth_bounds_test */
543 * glEnable()/glDisable() attributes.
545 struct gl_enable_attrib
{
547 GLboolean AutoNormal
;
550 GLboolean ColorMaterial
;
551 GLboolean ColorTable
; /* SGI_color_table */
552 GLboolean PostColorMatrixColorTable
; /* SGI_color_table */
553 GLboolean PostConvolutionColorTable
; /* SGI_color_table */
554 GLboolean Convolution1D
;
555 GLboolean Convolution2D
;
556 GLboolean Separable2D
;
562 GLboolean Light
[MAX_LIGHTS
];
564 GLboolean LineSmooth
;
565 GLboolean LineStipple
;
566 GLboolean IndexLogicOp
;
567 GLboolean ColorLogicOp
;
568 GLboolean Map1Color4
;
570 GLboolean Map1Normal
;
571 GLboolean Map1TextureCoord1
;
572 GLboolean Map1TextureCoord2
;
573 GLboolean Map1TextureCoord3
;
574 GLboolean Map1TextureCoord4
;
575 GLboolean Map1Vertex3
;
576 GLboolean Map1Vertex4
;
577 GLboolean Map1Attrib
[16]; /* GL_NV_vertex_program */
578 GLboolean Map2Color4
;
580 GLboolean Map2Normal
;
581 GLboolean Map2TextureCoord1
;
582 GLboolean Map2TextureCoord2
;
583 GLboolean Map2TextureCoord3
;
584 GLboolean Map2TextureCoord4
;
585 GLboolean Map2Vertex3
;
586 GLboolean Map2Vertex4
;
587 GLboolean Map2Attrib
[16]; /* GL_NV_vertex_program */
590 GLboolean PixelTexture
;
591 GLboolean PointSmooth
;
592 GLboolean PolygonOffsetPoint
;
593 GLboolean PolygonOffsetLine
;
594 GLboolean PolygonOffsetFill
;
595 GLboolean PolygonSmooth
;
596 GLboolean PolygonStipple
;
597 GLboolean RescaleNormals
;
600 GLboolean MultisampleEnabled
; /* GL_ARB_multisample */
601 GLboolean SampleAlphaToCoverage
; /* GL_ARB_multisample */
602 GLboolean SampleAlphaToOne
; /* GL_ARB_multisample */
603 GLboolean SampleCoverage
; /* GL_ARB_multisample */
604 GLboolean SampleCoverageInvert
; /* GL_ARB_multisample */
605 GLboolean RasterPositionUnclipped
; /* GL_IBM_rasterpos_clip */
606 GLuint Texture
[MAX_TEXTURE_IMAGE_UNITS
];
607 GLuint TexGen
[MAX_TEXTURE_COORD_UNITS
];
608 /* SGI_texture_color_table */
609 GLboolean TextureColorTable
[MAX_TEXTURE_IMAGE_UNITS
];
610 /* GL_NV_vertex_program */
611 GLboolean VertexProgram
;
612 GLboolean VertexProgramPointSize
;
613 GLboolean VertexProgramTwoSide
;
614 /* GL_ARB_point_sprite / GL_NV_point_sprite */
615 GLboolean PointSprite
;
622 struct gl_eval_attrib
{
627 GLboolean Map1Color4
;
629 GLboolean Map1Normal
;
630 GLboolean Map1TextureCoord1
;
631 GLboolean Map1TextureCoord2
;
632 GLboolean Map1TextureCoord3
;
633 GLboolean Map1TextureCoord4
;
634 GLboolean Map1Vertex3
;
635 GLboolean Map1Vertex4
;
636 GLboolean Map1Attrib
[16]; /* GL_NV_vertex_program */
637 GLboolean Map2Color4
;
639 GLboolean Map2Normal
;
640 GLboolean Map2TextureCoord1
;
641 GLboolean Map2TextureCoord2
;
642 GLboolean Map2TextureCoord3
;
643 GLboolean Map2TextureCoord4
;
644 GLboolean Map2Vertex3
;
645 GLboolean Map2Vertex4
;
646 GLboolean Map2Attrib
[16]; /* GL_NV_vertex_program */
647 GLboolean AutoNormal
;
651 * \name Map Grid endpoints and divisions and calculated du values
655 GLfloat MapGrid1u1
, MapGrid1u2
, MapGrid1du
;
656 GLint MapGrid2un
, MapGrid2vn
;
657 GLfloat MapGrid2u1
, MapGrid2u2
, MapGrid2du
;
658 GLfloat MapGrid2v1
, MapGrid2v2
, MapGrid2dv
;
666 struct gl_fog_attrib
{
667 GLboolean Enabled
; /**< Fog enabled flag */
668 GLfloat Color
[4]; /**< Fog color */
669 GLfloat Density
; /**< Density >= 0.0 */
670 GLfloat Start
; /**< Start distance in eye coords */
671 GLfloat End
; /**< End distance in eye coords */
672 GLfloat Index
; /**< Fog index */
673 GLenum Mode
; /**< Fog mode */
674 GLboolean ColorSumEnabled
;
675 GLenum FogCoordinateSource
; /**< GL_EXT_fog_coord */
682 * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE.
684 struct gl_hint_attrib
{
685 GLenum PerspectiveCorrection
;
688 GLenum PolygonSmooth
;
690 GLenum ClipVolumeClipping
; /**< GL_EXT_clip_volume_hint */
691 GLenum TextureCompression
; /**< GL_ARB_texture_compression */
692 GLenum GenerateMipmap
; /**< GL_SGIS_generate_mipmap */
697 * Histogram attributes.
699 struct gl_histogram_attrib
{
700 GLuint Width
; /**< number of table entries */
701 GLint Format
; /**< GL_ALPHA, GL_RGB, etc */
702 GLuint Count
[HISTOGRAM_TABLE_SIZE
][4]; /**< the histogram */
703 GLboolean Sink
; /**< terminate image transfer? */
704 GLubyte RedSize
; /**< Bits per counter */
708 GLubyte LuminanceSize
;
713 * Color Min/max state.
715 struct gl_minmax_attrib
{
718 GLfloat Min
[4], Max
[4]; /**< RGBA */
723 * Image convolution state.
725 struct gl_convolution_attrib
{
727 GLenum InternalFormat
;
730 GLfloat Filter
[MAX_CONVOLUTION_WIDTH
* MAX_CONVOLUTION_HEIGHT
* 4];
738 #define LIGHT_SPOT 0x1
739 #define LIGHT_LOCAL_VIEWER 0x2
740 #define LIGHT_POSITIONAL 0x4
741 #define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
746 * Lighting attributes.
748 struct gl_light_attrib
{
749 struct gl_light Light
[MAX_LIGHTS
]; /**< Array of lights */
750 struct gl_lightmodel Model
; /**< Lighting model */
753 * Must flush FLUSH_VERTICES before referencing:
756 struct gl_material Material
; /**< Includes front & back values */
759 GLboolean Enabled
; /**< Lighting enabled flag */
760 GLenum ShadeModel
; /**< GL_FLAT or GL_SMOOTH */
761 GLenum ColorMaterialFace
; /**< GL_FRONT, BACK or FRONT_AND_BACK */
762 GLenum ColorMaterialMode
; /**< GL_AMBIENT, GL_DIFFUSE, etc */
763 GLuint ColorMaterialBitmask
; /**< bitmask formed from Face and Mode */
764 GLboolean ColorMaterialEnabled
;
766 struct gl_light EnabledList
; /**< List sentinel */
769 * Derived for optimizations:
772 GLboolean _NeedEyeCoords
;
773 GLboolean _NeedVertices
; /**< Use fast shader? */
774 GLuint _Flags
; /**< LIGHT_* flags, see above */
775 GLfloat _BaseColor
[2][3];
783 struct gl_line_attrib
{
784 GLboolean SmoothFlag
; /**< GL_LINE_SMOOTH enabled? */
785 GLboolean StippleFlag
; /**< GL_LINE_STIPPLE enabled? */
786 GLushort StipplePattern
; /**< Stipple pattern */
787 GLint StippleFactor
; /**< Stipple repeat factor */
788 GLfloat Width
; /**< Line width */
789 GLfloat _Width
; /**< Clamped Line width */
794 * Display list state.
796 struct gl_list_attrib
{
801 struct gl_list_instruction
{
803 void (*Execute
)( GLcontext
*ctx
, void *data
);
804 void (*Destroy
)( GLcontext
*ctx
, void *data
);
805 void (*Print
)( GLcontext
*ctx
, void *data
);
808 #define MAX_DLIST_EXT_OPCODES 16
810 struct gl_list_extensions
{
811 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
819 struct gl_multisample_attrib
{
821 GLboolean SampleAlphaToCoverage
;
822 GLboolean SampleAlphaToOne
;
823 GLboolean SampleCoverage
;
824 GLfloat SampleCoverageValue
;
825 GLboolean SampleCoverageInvert
;
832 struct gl_pixel_attrib
{
833 GLenum ReadBuffer
; /**< source buffer for glReadPixels()/glCopyPixels() */
834 GLubyte _ReadSrcMask
; /**< Not really a mask, but like _DrawDestMask
836 * May be: FRONT_LEFT_BIT, BACK_LEFT_BIT,
837 * FRONT_RIGHT_BIT or BACK_RIGHT_BIT. */
838 GLfloat RedBias
, RedScale
;
839 GLfloat GreenBias
, GreenScale
;
840 GLfloat BlueBias
, BlueScale
;
841 GLfloat AlphaBias
, AlphaScale
;
842 GLfloat DepthBias
, DepthScale
;
843 GLint IndexShift
, IndexOffset
;
844 GLboolean MapColorFlag
;
845 GLboolean MapStencilFlag
;
846 GLfloat ZoomX
, ZoomY
;
847 /* XXX move these out of gl_pixel_attrib */
848 GLint MapStoSsize
; /**< Size of each pixel map */
858 GLint MapStoS
[MAX_PIXEL_MAP_TABLE
]; /**< Pixel map tables */
859 GLint MapItoI
[MAX_PIXEL_MAP_TABLE
];
860 GLfloat MapItoR
[MAX_PIXEL_MAP_TABLE
];
861 GLfloat MapItoG
[MAX_PIXEL_MAP_TABLE
];
862 GLfloat MapItoB
[MAX_PIXEL_MAP_TABLE
];
863 GLfloat MapItoA
[MAX_PIXEL_MAP_TABLE
];
864 GLubyte MapItoR8
[MAX_PIXEL_MAP_TABLE
]; /**< converted to 8-bit color */
865 GLubyte MapItoG8
[MAX_PIXEL_MAP_TABLE
];
866 GLubyte MapItoB8
[MAX_PIXEL_MAP_TABLE
];
867 GLubyte MapItoA8
[MAX_PIXEL_MAP_TABLE
];
868 GLfloat MapRtoR
[MAX_PIXEL_MAP_TABLE
];
869 GLfloat MapGtoG
[MAX_PIXEL_MAP_TABLE
];
870 GLfloat MapBtoB
[MAX_PIXEL_MAP_TABLE
];
871 GLfloat MapAtoA
[MAX_PIXEL_MAP_TABLE
];
872 /** GL_EXT_histogram */
873 GLboolean HistogramEnabled
;
874 GLboolean MinMaxEnabled
;
875 /** GL_SGIS_pixel_texture */
876 GLboolean PixelTextureEnabled
;
877 GLenum FragmentRgbSource
;
878 GLenum FragmentAlphaSource
;
879 /** GL_SGI_color_matrix */
880 GLfloat PostColorMatrixScale
[4]; /**< RGBA */
881 GLfloat PostColorMatrixBias
[4]; /**< RGBA */
882 /** GL_SGI_color_table */
883 GLfloat ColorTableScale
[4];
884 GLfloat ColorTableBias
[4];
885 GLboolean ColorTableEnabled
;
886 GLfloat PCCTscale
[4];
888 GLboolean PostConvolutionColorTableEnabled
;
889 GLfloat PCMCTscale
[4];
890 GLfloat PCMCTbias
[4];
891 GLboolean PostColorMatrixColorTableEnabled
;
892 /** GL_SGI_texture_color_table */
893 GLfloat TextureColorTableScale
[4];
894 GLfloat TextureColorTableBias
[4];
896 GLboolean Convolution1DEnabled
;
897 GLboolean Convolution2DEnabled
;
898 GLboolean Separable2DEnabled
;
899 GLfloat ConvolutionBorderColor
[3][4];
900 GLenum ConvolutionBorderMode
[3];
901 GLfloat ConvolutionFilterScale
[3][4];
902 GLfloat ConvolutionFilterBias
[3][4];
903 GLfloat PostConvolutionScale
[4]; /**< RGBA */
904 GLfloat PostConvolutionBias
[4]; /**< RGBA */
911 struct gl_point_attrib
{
912 GLboolean SmoothFlag
; /**< True if GL_POINT_SMOOTH is enabled */
913 GLfloat Size
; /**< User-specified point size */
914 GLfloat _Size
; /**< Size clamped to Const.Min/MaxPointSize */
915 GLfloat Params
[3]; /**< GL_EXT_point_parameters */
916 GLfloat MinSize
, MaxSize
; /**< GL_EXT_point_parameters */
917 GLfloat Threshold
; /**< GL_EXT_point_parameters */
918 GLboolean _Attenuated
; /**< True if Params != [1, 0, 0] */
919 GLboolean PointSprite
; /**< GL_NV_point_sprite / GL_NV_point_sprite */
920 GLboolean CoordReplace
[MAX_TEXTURE_UNITS
]; /**< GL_NV_point_sprite / GL_NV_point_sprite */
921 GLenum SpriteRMode
; /**< GL_NV_point_sprite (only!) */
922 GLenum SpriteOrigin
; /**< GL_ARB_point_sprite */
927 * Polygon attributes.
929 struct gl_polygon_attrib
{
930 GLenum FrontFace
; /**< Either GL_CW or GL_CCW */
931 GLenum FrontMode
; /**< Either GL_POINT, GL_LINE or GL_FILL */
932 GLenum BackMode
; /**< Either GL_POINT, GL_LINE or GL_FILL */
933 GLboolean _FrontBit
; /**< 0=GL_CCW, 1=GL_CW */
934 GLboolean CullFlag
; /**< Culling on/off flag */
935 GLboolean SmoothFlag
; /**< True if GL_POLYGON_SMOOTH is enabled */
936 GLboolean StippleFlag
; /**< True if GL_POLYGON_STIPPLE is enabled */
937 GLenum CullFaceMode
; /**< Culling mode GL_FRONT or GL_BACK */
938 GLfloat OffsetFactor
; /**< Polygon offset factor, from user */
939 GLfloat OffsetUnits
; /**< Polygon offset units, from user */
940 GLboolean OffsetPoint
; /**< Offset in GL_POINT mode */
941 GLboolean OffsetLine
; /**< Offset in GL_LINE mode */
942 GLboolean OffsetFill
; /**< Offset in GL_FILL mode */
947 * Scissor attributes.
949 struct gl_scissor_attrib
{
950 GLboolean Enabled
; /**< Scissor test enabled? */
951 GLint X
, Y
; /**< Lower left corner of box */
952 GLsizei Width
, Height
; /**< Size of box */
957 * Stencil attributes.
959 struct gl_stencil_attrib
{
960 GLboolean Enabled
; /**< Enabled flag */
961 GLboolean TestTwoSide
; /**< GL_EXT_stencil_two_side */
962 GLubyte ActiveFace
; /**< GL_EXT_stencil_two_side (0 or 1) */
963 GLenum Function
[2]; /**< Stencil function */
964 GLenum FailFunc
[2]; /**< Fail function */
965 GLenum ZPassFunc
[2]; /**< Depth buffer pass function */
966 GLenum ZFailFunc
[2]; /**< Depth buffer fail function */
967 GLstencil Ref
[2]; /**< Reference value */
968 GLstencil ValueMask
[2]; /**< Value mask */
969 GLstencil WriteMask
[2]; /**< Write mask */
970 GLstencil Clear
; /**< Clear value */
974 #define NUM_TEXTURE_TARGETS 5 /* 1D, 2D, 3D, CUBE and RECT */
977 * An index for each type of texture object
980 #define TEXTURE_1D_INDEX 0
981 #define TEXTURE_2D_INDEX 1
982 #define TEXTURE_3D_INDEX 2
983 #define TEXTURE_CUBE_INDEX 3
984 #define TEXTURE_RECT_INDEX 4
988 * Bit flags for each type of texture object
989 * Used for Texture.Unit[]._ReallyEnabled flags.
992 #define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
993 #define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
994 #define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
995 #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
996 #define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
1001 * TexGenEnabled flags.
1012 * Bit flag versions of the corresponding GL_ constants.
1015 #define TEXGEN_SPHERE_MAP 0x1
1016 #define TEXGEN_OBJ_LINEAR 0x2
1017 #define TEXGEN_EYE_LINEAR 0x4
1018 #define TEXGEN_REFLECTION_MAP_NV 0x8
1019 #define TEXGEN_NORMAL_MAP_NV 0x10
1021 #define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
1022 TEXGEN_REFLECTION_MAP_NV | \
1023 TEXGEN_NORMAL_MAP_NV)
1024 #define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
1025 TEXGEN_REFLECTION_MAP_NV | \
1026 TEXGEN_NORMAL_MAP_NV | \
1031 /* A selection of state flags to make driver and module's lives easier. */
1032 #define ENABLE_TEXGEN0 0x1
1033 #define ENABLE_TEXGEN1 0x2
1034 #define ENABLE_TEXGEN2 0x4
1035 #define ENABLE_TEXGEN3 0x8
1036 #define ENABLE_TEXGEN4 0x10
1037 #define ENABLE_TEXGEN5 0x20
1038 #define ENABLE_TEXGEN6 0x40
1039 #define ENABLE_TEXGEN7 0x80
1041 #define ENABLE_TEXMAT0 0x1 /* Ie. not the identity matrix */
1042 #define ENABLE_TEXMAT1 0x2
1043 #define ENABLE_TEXMAT2 0x4
1044 #define ENABLE_TEXMAT3 0x8
1045 #define ENABLE_TEXMAT4 0x10
1046 #define ENABLE_TEXMAT5 0x20
1047 #define ENABLE_TEXMAT6 0x40
1048 #define ENABLE_TEXMAT7 0x80
1050 #define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i))
1051 #define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i))
1055 * Texel fetch function prototype. We use texel fetch functions to
1056 * extract RGBA, color indexes and depth components out of 1D, 2D and 3D
1057 * texture images. These functions help to isolate us from the gritty
1058 * details of all the various texture image encodings.
1060 * \param texImage texture image.
1061 * \param col texel column.
1062 * \param row texel row.
1063 * \param img texel image level/layer.
1064 * \param texelOut output texel (up to 4 GLchans)
1066 typedef void (*FetchTexelFuncC
)( const struct gl_texture_image
*texImage
,
1067 GLint col
, GLint row
, GLint img
,
1071 * As above, but returns floats.
1072 * Used for depth component images and for upcoming signed/float
1075 typedef void (*FetchTexelFuncF
)( const struct gl_texture_image
*texImage
,
1076 GLint col
, GLint row
, GLint img
,
1077 GLfloat
*texelOut
);
1081 * TexImage store function. This is called by the glTex[Sub]Image
1082 * functions and is responsible for converting the user-specified texture
1083 * image into a specific (hardware) image format.
1085 typedef GLboolean (*StoreTexImageFunc
)(GLcontext
*ctx
, GLuint dims
,
1086 GLenum baseInternalFormat
,
1087 const struct gl_texture_format
*dstFormat
,
1089 GLint dstXoffset
, GLint dstYoffset
, GLint dstZoffset
,
1090 GLint dstRowStride
, GLint dstImageStride
,
1091 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
1092 GLenum srcFormat
, GLenum srcType
,
1093 const GLvoid
*srcAddr
,
1094 const struct gl_pixelstore_attrib
*srcPacking
);
1099 * Texture format record
1101 struct gl_texture_format
{
1102 GLint MesaFormat
; /**< One of the MESA_FORMAT_* values */
1104 GLenum BaseFormat
; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
1105 * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
1106 * GL_INTENSITY, GL_COLOR_INDEX or
1107 * GL_DEPTH_COMPONENT.
1109 GLenum DataType
; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */
1110 GLubyte RedBits
; /**< Bits per texel component */
1111 GLubyte GreenBits
; /**< These are just rough approximations for */
1112 GLubyte BlueBits
; /**< compressed texture formats. */
1114 GLubyte LuminanceBits
;
1115 GLubyte IntensityBits
;
1119 GLuint TexelBytes
; /**< Bytes per texel, 0 if compressed format */
1121 StoreTexImageFunc StoreImage
;
1124 * \name Texel fetch function pointers
1127 FetchTexelFuncC FetchTexel1D
;
1128 FetchTexelFuncC FetchTexel2D
;
1129 FetchTexelFuncC FetchTexel3D
;
1130 FetchTexelFuncF FetchTexel1Df
;
1131 FetchTexelFuncF FetchTexel2Df
;
1132 FetchTexelFuncF FetchTexel3Df
;
1138 * Texture image record
1140 struct gl_texture_image
{
1141 GLenum Format
; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
1142 * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
1143 * GL_INTENSITY, GL_COLOR_INDEX or
1144 * GL_DEPTH_COMPONENT only.
1145 * Used for choosing TexEnv arithmetic.
1147 GLint IntFormat
; /**< Internal format as given by the user */
1148 GLuint Border
; /**< 0 or 1 */
1149 GLuint Width
; /**< = 2^WidthLog2 + 2*Border */
1150 GLuint Height
; /**< = 2^HeightLog2 + 2*Border */
1151 GLuint Depth
; /**< = 2^DepthLog2 + 2*Border */
1152 GLuint RowStride
; /**< == Width unless IsClientData and padded */
1153 GLuint Width2
; /**< = Width - 2*Border */
1154 GLuint Height2
; /**< = Height - 2*Border */
1155 GLuint Depth2
; /**< = Depth - 2*Border */
1156 GLuint WidthLog2
; /**< = log2(Width2) */
1157 GLuint HeightLog2
; /**< = log2(Height2) */
1158 GLuint DepthLog2
; /**< = log2(Depth2) */
1159 GLuint MaxLog2
; /**< = MAX(WidthLog2, HeightLog2) */
1160 GLfloat WidthScale
; /**< used for mipmap LOD computation */
1161 GLfloat HeightScale
; /**< used for mipmap LOD computation */
1162 GLfloat DepthScale
; /**< used for mipmap LOD computation */
1163 GLvoid
*Data
; /**< Image data, accessed via FetchTexel() */
1164 GLboolean IsClientData
; /**< Data owned by client? */
1165 GLboolean _IsPowerOfTwo
; /**< Are all dimensions powers of two? */
1167 const struct gl_texture_format
*TexFormat
;
1169 struct gl_texture_object
*TexObject
; /**< Pointer back to parent object */
1171 FetchTexelFuncC FetchTexelc
; /**< GLchan texel fetch function pointer */
1172 FetchTexelFuncF FetchTexelf
; /**< Float texel fetch function pointer */
1174 GLboolean IsCompressed
; /**< GL_ARB_texture_compression */
1175 GLuint CompressedSize
; /**< GL_ARB_texture_compression */
1178 * \name For device driver:
1181 void *DriverData
; /**< Arbitrary device driver data */
1187 * Indexes for cube map faces.
1190 #define FACE_POS_X 0
1191 #define FACE_NEG_X 1
1192 #define FACE_POS_Y 2
1193 #define FACE_NEG_Y 3
1194 #define FACE_POS_Z 4
1195 #define FACE_NEG_Z 5
1201 * Texture object record
1203 struct gl_texture_object
{
1204 _glthread_Mutex Mutex
; /**< for thread safety */
1205 GLint RefCount
; /**< reference count */
1206 GLboolean DeletePending
; /**< Has glDeleteTexture been called? */
1207 GLuint Name
; /**< an unsigned integer */
1208 GLenum Target
; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
1209 GLfloat Priority
; /**< in [0,1] */
1210 GLfloat BorderColor
[4]; /**< unclamped */
1211 GLchan _BorderChan
[4]; /**< clamped, as GLchan */
1212 /** \name Wrap modes
1213 * Are GL_CLAMP, REPEAT, GL_CLAMP_TO_EDGE, and GL_CLAMP_TO_BORDER_ARB. */
1219 GLenum MinFilter
; /**< minification filter */
1220 GLenum MagFilter
; /**< magnification filter */
1221 GLfloat MinLod
; /**< min lambda, OpenGL 1.2 */
1222 GLfloat MaxLod
; /**< max lambda, OpenGL 1.2 */
1223 GLfloat LodBias
; /**< OpenGL 1.4 */
1224 GLint BaseLevel
; /**< min mipmap level, OpenGL 1.2 */
1225 GLint MaxLevel
; /**< max mipmap level, OpenGL 1.2 */
1226 GLfloat MaxAnisotropy
; /**< GL_EXT_texture_filter_anisotropic */
1227 GLboolean CompareFlag
; /**< GL_SGIX_shadow */
1228 GLenum CompareOperator
; /**< GL_SGIX_shadow */
1229 GLfloat ShadowAmbient
;
1230 GLenum CompareMode
; /**< GL_ARB_shadow */
1231 GLenum CompareFunc
; /**< GL_ARB_shadow */
1232 GLenum DepthMode
; /**< GL_ARB_depth_texture */
1233 GLint _MaxLevel
; /**< actual max mipmap level (q in the spec) */
1234 GLfloat _MaxLambda
; /**< = _MaxLevel - BaseLevel (q - b in spec) */
1235 GLboolean GenerateMipmap
; /**< GL_SGIS_generate_mipmap */
1236 GLboolean _IsPowerOfTwo
; /**< Are all image dimensions powers of two? */
1238 struct gl_texture_image
*Image
[MAX_FACES
][MAX_TEXTURE_LEVELS
];
1240 /** GL_EXT_paletted_texture */
1241 struct gl_color_table Palette
;
1243 GLboolean Complete
; /**< Is texture object complete? */
1244 struct gl_texture_object
*Next
; /**< Next in linked list */
1247 * \name For device driver
1250 void *DriverData
; /**< Arbitrary device driver data */
1256 * Texture combine environment state.
1259 * If GL_NV_texture_env_combine4 is ever supported, the arrays in this
1260 * structure will need to be expanded for 4 elements.
1262 struct gl_tex_env_combine_state
{
1263 GLenum ModeRGB
; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
1264 GLenum ModeA
; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
1265 GLenum SourceRGB
[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
1266 GLenum SourceA
[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
1267 GLenum OperandRGB
[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */
1268 GLenum OperandA
[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */
1269 GLuint ScaleShiftRGB
; /**< 0, 1 or 2 */
1270 GLuint ScaleShiftA
; /**< 0, 1 or 2 */
1271 GLuint _NumArgsRGB
; /**< Number of inputs used for the combine mode. */
1272 GLuint _NumArgsA
; /**< Number of inputs used for the combine mode. */
1277 * Texture unit record
1279 struct gl_texture_unit
{
1280 GLuint Enabled
; /**< bitmask of TEXTURE_*_BIT flags */
1281 GLuint _ReallyEnabled
; /**< 0 or exactly one of TEXTURE_*_BIT flags */
1283 GLenum EnvMode
; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
1284 GLfloat EnvColor
[4];
1285 GLuint TexGenEnabled
; /**< Bitwise-OR of [STRQ]_BIT values */
1286 /** \name Tex coord generation mode
1287 * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */
1298 GLuint _GenFlags
; /**< bitwise or of GenBit[STRQ] */
1299 GLfloat ObjectPlaneS
[4];
1300 GLfloat ObjectPlaneT
[4];
1301 GLfloat ObjectPlaneR
[4];
1302 GLfloat ObjectPlaneQ
[4];
1303 GLfloat EyePlaneS
[4];
1304 GLfloat EyePlaneT
[4];
1305 GLfloat EyePlaneR
[4];
1306 GLfloat EyePlaneQ
[4];
1307 GLfloat LodBias
; /**< for biasing mipmap levels */
1310 * \name GL_EXT_texture_env_combine
1312 struct gl_tex_env_combine_state Combine
;
1315 * Derived state based on \c EnvMode and the \c BaseFormat of the
1316 * currently enabled texture.
1318 struct gl_tex_env_combine_state _EnvMode
;
1321 * Currently enabled combiner state. This will point to either
1322 * \c Combine or \c _EnvMode.
1324 struct gl_tex_env_combine_state
*_CurrentCombine
;
1326 struct gl_texture_object
*Current1D
;
1327 struct gl_texture_object
*Current2D
;
1328 struct gl_texture_object
*Current3D
;
1329 struct gl_texture_object
*CurrentCubeMap
; /**< GL_ARB_texture_cube_map */
1330 struct gl_texture_object
*CurrentRect
; /**< GL_NV_texture_rectangle */
1332 struct gl_texture_object
*_Current
; /**< Points to really enabled tex obj */
1334 struct gl_texture_object Saved1D
; /**< only used by glPush/PopAttrib */
1335 struct gl_texture_object Saved2D
;
1336 struct gl_texture_object Saved3D
;
1337 struct gl_texture_object SavedCubeMap
;
1338 struct gl_texture_object SavedRect
;
1340 /* GL_SGI_texture_color_table */
1341 struct gl_color_table ColorTable
;
1342 struct gl_color_table ProxyColorTable
;
1343 GLboolean ColorTableEnabled
;
1348 * Texture attributes
1350 struct gl_texture_attrib
{
1355 GLuint CurrentUnit
; /**< Active texture unit */
1356 GLuint _EnabledUnits
; /**< one bit set for each really-enabled unit */
1357 GLuint _EnabledCoordUnits
; /**< one bit per enabled coordinate unit */
1358 GLuint _GenFlags
; /**< for texgen */
1359 GLuint _TexGenEnabled
;
1360 GLuint _TexMatEnabled
;
1363 struct gl_texture_unit Unit
[MAX_TEXTURE_UNITS
];
1365 struct gl_texture_object
*Proxy1D
;
1366 struct gl_texture_object
*Proxy2D
;
1367 struct gl_texture_object
*Proxy3D
;
1368 struct gl_texture_object
*ProxyCubeMap
;
1369 struct gl_texture_object
*ProxyRect
;
1371 /** GL_EXT_shared_texture_palette */
1372 GLboolean SharedPalette
;
1373 struct gl_color_table Palette
;
1378 * Transformation attributes.
1380 struct gl_transform_attrib
{
1381 GLenum MatrixMode
; /**< Matrix mode */
1382 GLfloat EyeUserPlane
[MAX_CLIP_PLANES
][4]; /**< User clip planes */
1383 GLfloat _ClipUserPlane
[MAX_CLIP_PLANES
][4]; /**< derived */
1384 GLuint ClipPlanesEnabled
; /**< on/off bitmask */
1385 GLboolean Normalize
; /**< Normalize all normals? */
1386 GLboolean RescaleNormals
; /**< GL_EXT_rescale_normal */
1387 GLboolean RasterPositionUnclipped
; /**< GL_IBM_rasterpos_clip */
1389 GLboolean CullVertexFlag
; /**< True if GL_CULL_VERTEX_EXT is enabled */
1390 GLfloat CullEyePos
[4];
1391 GLfloat CullObjPos
[4];
1396 * Viewport attributes.
1398 struct gl_viewport_attrib
{
1399 GLint X
, Y
; /**< position */
1400 GLsizei Width
, Height
; /**< size */
1401 GLfloat Near
, Far
; /**< Depth buffer range */
1402 GLmatrix _WindowMap
; /**< Mapping transformation as a matrix. */
1407 * Node for the attribute stack
1409 struct gl_attrib_node
{
1412 struct gl_attrib_node
*next
;
1417 * GL_ARB_vertex/pixel_buffer_object buffer object
1419 struct gl_buffer_object
{
1424 GLvoid
*Pointer
; /**< Only valid while buffer is mapped */
1425 GLuint Size
; /**< Size of storage in bytes */
1426 GLubyte
*Data
; /**< Location of storage either in RAM or VRAM. */
1427 GLboolean OnCard
; /**< Is buffer in VRAM? (hardware drivers) */
1428 GLboolean DeletePending
; /**< Deleted by user but RefCount > 0? */
1434 * Client pixel packing/unpacking attributes
1436 struct gl_pixelstore_attrib
{
1441 GLint ImageHeight
; /**< for GL_EXT_texture3D */
1442 GLint SkipImages
; /**< for GL_EXT_texture3D */
1443 GLboolean SwapBytes
;
1445 GLboolean ClientStorage
; /**< GL_APPLE_client_storage */
1446 GLboolean Invert
; /**< GL_MESA_pack_invert */
1447 struct gl_buffer_object
*BufferObj
; /**< GL_ARB_pixel_buffer_object */
1451 #define CA_CLIENT_DATA 0x1 /**< Data not allocated by mesa */
1455 * Client vertex array attributes
1457 struct gl_client_array
{
1458 GLint Size
; /**< components per element (1,2,3,4) */
1459 GLenum Type
; /**< datatype: GL_FLOAT, GL_INT, etc */
1460 GLsizei Stride
; /**< user-specified stride */
1461 GLsizei StrideB
; /**< actual stride in bytes */
1462 const GLubyte
*Ptr
; /**< Points to array data */
1463 GLuint Enabled
; /**< one of the _NEW_ARRAY_ bits */
1464 GLboolean Normalized
; /**< GL_ARB_vertex_program */
1466 /**< GL_ARB_vertex_buffer_object */
1467 struct gl_buffer_object
*BufferObj
;
1475 * Vertex array state
1477 struct gl_array_attrib
{
1478 struct gl_client_array Vertex
; /**< client data descriptors */
1479 struct gl_client_array Normal
;
1480 struct gl_client_array Color
;
1481 struct gl_client_array SecondaryColor
;
1482 struct gl_client_array FogCoord
;
1483 struct gl_client_array Index
;
1484 struct gl_client_array TexCoord
[MAX_TEXTURE_COORD_UNITS
];
1485 struct gl_client_array EdgeFlag
;
1487 struct gl_client_array VertexAttrib
[VERT_ATTRIB_MAX
]; /**< GL_NV_vertex_program */
1489 GLint ActiveTexture
; /**< Client Active Texture */
1490 GLuint LockFirst
; /**< GL_EXT_compiled_vertex_array */
1491 GLuint LockCount
; /**< GL_EXT_compiled_vertex_array */
1493 GLuint _Enabled
; /**< _NEW_ARRAY_* - bit set if array enabled */
1494 GLuint NewState
; /**< _NEW_ARRAY_* */
1496 #if FEATURE_ARB_vertex_buffer_object
1497 struct gl_buffer_object
*NullBufferObj
;
1498 struct gl_buffer_object
*ArrayBufferObj
;
1499 struct gl_buffer_object
*ElementArrayBufferObj
;
1501 GLuint _MaxElement
; /* Min of all enabled array's maxes */
1506 * Feedback buffer state
1508 struct gl_feedback
{
1510 GLuint _Mask
; /* FB_* bits */
1518 * Selection buffer state
1520 struct gl_selection
{
1521 GLuint
*Buffer
; /**< selection buffer */
1522 GLuint BufferSize
; /**< size of the selection buffer */
1523 GLuint BufferCount
; /**< number of values in the selection buffer */
1524 GLuint Hits
; /**< number of records in the selection buffer */
1525 GLuint NameStackDepth
; /**< name stack depth */
1526 GLuint NameStack
[MAX_NAME_STACK_DEPTH
]; /**< name stack */
1527 GLboolean HitFlag
; /**< hit flag */
1528 GLfloat HitMinZ
; /**< minimum hit depth */
1529 GLfloat HitMaxZ
; /**< maximum hit depth */
1534 * 1-D Evaluator control points
1538 GLuint Order
; /**< Number of control points */
1539 GLfloat u1
, u2
, du
; /**< u1, u2, 1.0/(u2-u1) */
1540 GLfloat
*Points
; /**< Points to contiguous control points */
1545 * 2-D Evaluator control points
1549 GLuint Uorder
; /**< Number of control points in U dimension */
1550 GLuint Vorder
; /**< Number of control points in V dimension */
1553 GLfloat
*Points
; /**< Points to contiguous control points */
1558 * All evaluator control point state
1560 struct gl_evaluators
1566 struct gl_1d_map Map1Vertex3
;
1567 struct gl_1d_map Map1Vertex4
;
1568 struct gl_1d_map Map1Index
;
1569 struct gl_1d_map Map1Color4
;
1570 struct gl_1d_map Map1Normal
;
1571 struct gl_1d_map Map1Texture1
;
1572 struct gl_1d_map Map1Texture2
;
1573 struct gl_1d_map Map1Texture3
;
1574 struct gl_1d_map Map1Texture4
;
1575 struct gl_1d_map Map1Attrib
[16]; /**< GL_NV_vertex_program */
1582 struct gl_2d_map Map2Vertex3
;
1583 struct gl_2d_map Map2Vertex4
;
1584 struct gl_2d_map Map2Index
;
1585 struct gl_2d_map Map2Color4
;
1586 struct gl_2d_map Map2Normal
;
1587 struct gl_2d_map Map2Texture1
;
1588 struct gl_2d_map Map2Texture2
;
1589 struct gl_2d_map Map2Texture3
;
1590 struct gl_2d_map Map2Texture4
;
1591 struct gl_2d_map Map2Attrib
[16]; /**< GL_NV_vertex_program */
1597 * NV_fragment_program runtime state
1601 GLfloat Temporaries
[MAX_NV_FRAGMENT_PROGRAM_TEMPS
][4];
1602 GLfloat Inputs
[MAX_NV_FRAGMENT_PROGRAM_INPUTS
][4];
1603 GLfloat Outputs
[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS
][4];
1604 GLuint CondCodes
[4];
1609 * Names of the various vertex/fragment register files
1613 PROGRAM_TEMPORARY
= 10,
1616 PROGRAM_LOCAL_PARAM
,
1618 PROGRAM_NAMED_PARAM
,
1625 /** Vertex and fragment instructions */
1626 struct vp_instruction
;
1627 struct fp_instruction
;
1629 struct program_parameter_list
;
1633 * Base class for any kind of program object
1638 GLubyte
*String
; /**< Null-terminated program text */
1639 GLboolean DeletePending
; /**< User called glDeletePrograms? */
1642 GLenum Format
; /**< String encoding format */
1644 GLfloat LocalParams
[MAX_PROGRAM_LOCAL_PARAMS
][4];
1645 GLuint NumInstructions
; /* GL_ARB_vertex/fragment_program */
1646 GLuint NumTemporaries
;
1647 GLuint NumParameters
;
1648 GLuint NumAttributes
;
1649 GLuint NumAddressRegs
;
1653 /** Vertex program object */
1654 struct vertex_program
1656 struct program Base
; /* base class */
1657 struct vp_instruction
*Instructions
; /* Compiled instructions */
1658 GLboolean IsNVProgram
; /* GL_NV_vertex_program ? */
1659 GLboolean IsPositionInvariant
; /* GL_NV_vertex_program1_1 */
1660 GLuint InputsRead
; /* Bitmask of which input regs are read */
1661 GLuint OutputsWritten
; /* Bitmask of which output regs are written to */
1662 struct program_parameter_list
*Parameters
; /**< array [NumParameters] */
1666 /** Fragment program object */
1667 struct fragment_program
1669 struct program Base
; /**< base class */
1670 struct fp_instruction
*Instructions
; /**< Compiled instructions */
1671 GLuint InputsRead
; /**< Bitmask of which input regs are read */
1672 GLuint OutputsWritten
; /**< Bitmask of which output regs are written to */
1673 GLuint TexturesUsed
[MAX_TEXTURE_IMAGE_UNITS
]; /**< TEXTURE_x_INDEX bitmask */
1674 GLuint NumAluInstructions
; /**< GL_ARB_fragment_program */
1675 GLuint NumTexInstructions
;
1676 GLuint NumTexIndirections
;
1678 struct program_parameter_list
*Parameters
; /**< array [NumParameters] */
1681 char c_str
[4096]; /* experimental... */
1688 * State common to vertex and fragment programs.
1690 struct program_state
{
1691 GLint ErrorPos
; /* GL_PROGRAM_ERROR_POSITION_NV */
1692 const char *ErrorString
; /* GL_PROGRAM_ERROR_STRING_NV */
1697 * State vars for GL_ARB/GL_NV_vertex_program
1699 struct vertex_program_state
1701 GLboolean Enabled
; /**< GL_VERTEX_PROGRAM_NV */
1702 GLboolean _Enabled
; /**< Really enabled? */
1703 GLboolean PointSizeEnabled
; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */
1704 GLboolean TwoSideEnabled
; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */
1705 struct vertex_program
*Current
; /**< ptr to currently bound program */
1707 GLenum TrackMatrix
[MAX_NV_VERTEX_PROGRAM_PARAMS
/ 4];
1708 GLenum TrackMatrixTransform
[MAX_NV_VERTEX_PROGRAM_PARAMS
/ 4];
1710 GLfloat Parameters
[MAX_NV_VERTEX_PROGRAM_PARAMS
][4]; /* Env params */
1711 /* Only used during program execution (may be moved someday): */
1712 GLfloat Temporaries
[MAX_NV_VERTEX_PROGRAM_TEMPS
][4];
1713 GLfloat Inputs
[MAX_NV_VERTEX_PROGRAM_INPUTS
][4];
1714 GLuint InputsSize
[MAX_NV_VERTEX_PROGRAM_INPUTS
];
1715 GLfloat Outputs
[MAX_NV_VERTEX_PROGRAM_OUTPUTS
][4];
1716 GLint AddressReg
[4];
1718 #if FEATURE_MESA_program_debug
1719 GLprogramcallbackMESA Callback
;
1720 GLvoid
*CallbackData
;
1721 GLboolean CallbackEnabled
;
1722 GLuint CurrentPosition
;
1728 * State for GL_ARB/NV_fragment_program
1730 struct fragment_program_state
1732 GLboolean Enabled
; /* GL_VERTEX_PROGRAM_NV */
1733 GLboolean _Enabled
; /* Really enabled? */
1734 struct fragment_program
*Current
; /* ptr to currently bound program */
1735 struct fp_machine Machine
; /* machine state */
1736 GLfloat Parameters
[MAX_NV_FRAGMENT_PROGRAM_PARAMS
][4]; /* Env params */
1738 #if FEATURE_MESA_program_debug
1739 GLprogramcallbackMESA Callback
;
1740 GLvoid
*CallbackData
;
1741 GLboolean CallbackEnabled
;
1742 GLuint CurrentPosition
;
1748 * State for GL_ARB_occlusion_query
1750 struct occlusion_state
1753 GLuint CurrentQueryObject
;
1754 GLuint PassedCounter
;
1755 struct _mesa_HashTable
*QueryObjects
;
1760 * State which can be shared by multiple contexts:
1762 struct gl_shared_state
1764 _glthread_Mutex Mutex
; /**< for thread safety */
1765 GLint RefCount
; /**< Reference count */
1766 struct _mesa_HashTable
*DisplayList
; /**< Display lists hash table */
1767 struct _mesa_HashTable
*TexObjects
; /**< Texture objects hash table */
1768 struct gl_texture_object
*TexObjectList
;/**< Linked list of texture objects */
1771 * \name Default texture objects (shared by all multi-texture units)
1774 struct gl_texture_object
*Default1D
;
1775 struct gl_texture_object
*Default2D
;
1776 struct gl_texture_object
*Default3D
;
1777 struct gl_texture_object
*DefaultCubeMap
;
1778 struct gl_texture_object
*DefaultRect
;
1782 * \name GL_NV_vertex/_program
1785 struct _mesa_HashTable
*Programs
;
1786 #if FEATURE_ARB_vertex_program
1787 struct program
*DefaultVertexProgram
;
1789 #if FEATURE_ARB_fragment_program
1790 struct program
*DefaultFragmentProgram
;
1794 #if FEATURE_ARB_vertex_buffer_object
1795 struct _mesa_HashTable
*BufferObjects
;
1798 void *DriverData
; /**< Device driver shared state */
1805 * A "frame buffer" is a color buffer and its optional ancillary buffers:
1806 * depth, accum, stencil, and software-simulated alpha buffers.
1807 * In C++ terms, think of this as a base class from which device drivers
1808 * will make derived classes.
1810 struct gl_frame_buffer
1812 GLvisual Visual
; /**< The corresponding visual */
1814 GLuint Width
, Height
; /**< size of frame buffer in pixels */
1816 GLboolean UseSoftwareDepthBuffer
;
1817 GLboolean UseSoftwareAccumBuffer
;
1818 GLboolean UseSoftwareStencilBuffer
;
1819 GLboolean UseSoftwareAlphaBuffers
;
1820 GLboolean UseSoftwareAuxBuffers
;
1822 /** \name Software depth (aka Z) buffer */
1824 GLvoid
*DepthBuffer
; /**< array [Width*Height] of GLushort or GLuint*/
1827 /** \name Software stencil buffer */
1829 GLstencil
*Stencil
; /**< array [Width*Height] of GLstencil values */
1832 /** \name Software accumulation buffer */
1834 GLaccum
*Accum
; /**< array [4*Width*Height] of GLaccum values */
1837 /** \name Software alpha planes */
1839 GLchan
*FrontLeftAlpha
; /**< array [Width*Height] of GLchan */
1840 GLchan
*BackLeftAlpha
; /**< array [Width*Height] of GLchan */
1841 GLchan
*FrontRightAlpha
; /**< array [Width*Height] of GLchan */
1842 GLchan
*BackRightAlpha
; /**< array [Width*Height] of GLchan */
1845 GLchan
*AuxBuffers
[MAX_AUX_BUFFERS
];
1848 * \name Drawing bounds
1850 * Intersection of window size and scissor box
1853 GLint _Xmin
; /**< inclusive */
1854 GLint _Ymin
; /**< inclusive */
1855 GLint _Xmax
; /**< exclusive */
1856 GLint _Ymax
; /**< exclusive */
1862 * Constants which may be overridden by device driver during context creation
1863 * but are never changed after that.
1867 GLint MaxTextureLevels
; /**< Maximum number of allowed mipmap levels. */
1868 GLint Max3DTextureLevels
; /**< Maximum number of allowed mipmap levels for 3D texture targets. */
1869 GLint MaxCubeTextureLevels
; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */
1870 GLint MaxTextureRectSize
; /* GL_NV_texture_rectangle */
1871 GLuint MaxTextureCoordUnits
;
1872 GLuint MaxTextureImageUnits
;
1873 GLuint MaxTextureUnits
; /* = MAX(CoordUnits, ImageUnits) */
1874 GLfloat MaxTextureMaxAnisotropy
; /* GL_EXT_texture_filter_anisotropic */
1875 GLfloat MaxTextureLodBias
; /* GL_EXT_texture_lod_bias */
1876 GLuint MaxArrayLockSize
;
1878 GLfloat MinPointSize
, MaxPointSize
; /* aliased */
1879 GLfloat MinPointSizeAA
, MaxPointSizeAA
; /* antialiased */
1880 GLfloat PointSizeGranularity
;
1881 GLfloat MinLineWidth
, MaxLineWidth
; /* aliased */
1882 GLfloat MinLineWidthAA
, MaxLineWidthAA
; /* antialiased */
1883 GLfloat LineWidthGranularity
;
1884 GLuint MaxColorTableSize
;
1885 GLuint MaxConvolutionWidth
;
1886 GLuint MaxConvolutionHeight
;
1887 GLuint MaxClipPlanes
;
1889 GLfloat MaxShininess
; /* GL_NV_light_max_exponent */
1890 GLfloat MaxSpotExponent
; /* GL_NV_light_max_exponent */
1891 GLuint MaxViewportWidth
, MaxViewportHeight
;
1892 /* GL_ARB_vertex_program */
1893 GLuint MaxVertexProgramInstructions
;
1894 GLuint MaxVertexProgramAttribs
;
1895 GLuint MaxVertexProgramTemps
;
1896 GLuint MaxVertexProgramLocalParams
;
1897 GLuint MaxVertexProgramEnvParams
;
1898 GLuint MaxVertexProgramAddressRegs
;
1899 /* GL_ARB_fragment_program */
1900 GLuint MaxFragmentProgramInstructions
;
1901 GLuint MaxFragmentProgramAttribs
;
1902 GLuint MaxFragmentProgramTemps
;
1903 GLuint MaxFragmentProgramLocalParams
;
1904 GLuint MaxFragmentProgramEnvParams
;
1905 GLuint MaxFragmentProgramAddressRegs
;
1906 GLuint MaxFragmentProgramAluInstructions
;
1907 GLuint MaxFragmentProgramTexInstructions
;
1908 GLuint MaxFragmentProgramTexIndirections
;
1909 /* vertex or fragment program */
1910 GLuint MaxProgramMatrices
;
1911 GLuint MaxProgramMatrixStackDepth
;
1912 /* vertex array / buffer object bounds checking */
1913 GLboolean CheckArrayBounds
;
1914 /* GL_ARB_draw_buffers */
1915 GLuint MaxDrawBuffers
;
1916 /* GL_OES_read_format */
1917 GLenum ColorReadFormat
;
1918 GLenum ColorReadType
;
1923 * List of extensions.
1925 struct gl_extensions
1928 * \name Flags to quickly test if certain extensions are available.
1930 * Not every extension needs to have such a flag, but it's encouraged.
1933 GLboolean dummy
; /* don't remove this! */
1934 GLboolean ARB_depth_texture
;
1935 GLboolean ARB_draw_buffers
;
1936 GLboolean ARB_fragment_program
;
1937 GLboolean ARB_fragment_shader
;
1938 GLboolean ARB_half_float_pixel
;
1939 GLboolean ARB_imaging
;
1940 GLboolean ARB_multisample
;
1941 GLboolean ARB_multitexture
;
1942 GLboolean ARB_occlusion_query
;
1943 GLboolean ARB_point_sprite
;
1944 GLboolean ARB_shader_objects
;
1945 GLboolean ARB_shadow
;
1946 GLboolean ARB_texture_border_clamp
;
1947 GLboolean ARB_texture_compression
;
1948 GLboolean ARB_texture_cube_map
;
1949 GLboolean ARB_texture_env_combine
;
1950 GLboolean ARB_texture_env_crossbar
;
1951 GLboolean ARB_texture_env_dot3
;
1952 GLboolean ARB_texture_float
;
1953 GLboolean ARB_texture_mirrored_repeat
;
1954 GLboolean ARB_texture_non_power_of_two
;
1955 GLboolean ARB_transpose_matrix
;
1956 GLboolean ARB_vertex_buffer_object
;
1957 GLboolean ARB_vertex_program
;
1958 GLboolean ARB_vertex_shader
;
1959 GLboolean ARB_window_pos
;
1962 GLboolean EXT_blend_color
;
1963 GLboolean EXT_blend_equation_separate
;
1964 GLboolean EXT_blend_func_separate
;
1965 GLboolean EXT_blend_logic_op
;
1966 GLboolean EXT_blend_minmax
;
1967 GLboolean EXT_blend_subtract
;
1968 GLboolean EXT_clip_volume_hint
;
1969 GLboolean EXT_cull_vertex
;
1970 GLboolean EXT_convolution
;
1971 GLboolean EXT_compiled_vertex_array
;
1972 GLboolean EXT_copy_texture
;
1973 GLboolean EXT_depth_bounds_test
;
1974 GLboolean EXT_draw_range_elements
;
1975 GLboolean EXT_fog_coord
;
1976 GLboolean EXT_histogram
;
1977 GLboolean EXT_multi_draw_arrays
;
1978 GLboolean EXT_paletted_texture
;
1979 GLboolean EXT_packed_pixels
;
1980 GLboolean EXT_pixel_buffer_object
;
1981 GLboolean EXT_point_parameters
;
1982 GLboolean EXT_polygon_offset
;
1983 GLboolean EXT_rescale_normal
;
1984 GLboolean EXT_shadow_funcs
;
1985 GLboolean EXT_secondary_color
;
1986 GLboolean EXT_separate_specular_color
;
1987 GLboolean EXT_shared_texture_palette
;
1988 GLboolean EXT_stencil_wrap
;
1989 GLboolean EXT_stencil_two_side
;
1990 GLboolean EXT_subtexture
;
1991 GLboolean EXT_texture
;
1992 GLboolean EXT_texture_object
;
1993 GLboolean EXT_texture3D
;
1994 GLboolean EXT_texture_compression_s3tc
;
1995 GLboolean EXT_texture_env_add
;
1996 GLboolean EXT_texture_env_combine
;
1997 GLboolean EXT_texture_env_dot3
;
1998 GLboolean EXT_texture_filter_anisotropic
;
1999 GLboolean EXT_texture_lod_bias
;
2000 GLboolean EXT_texture_mirror_clamp
;
2001 GLboolean EXT_vertex_array
;
2002 GLboolean EXT_vertex_array_set
;
2003 /* vendor extensions */
2004 GLboolean APPLE_client_storage
;
2005 GLboolean APPLE_packed_pixels
;
2006 GLboolean ATI_texture_mirror_once
;
2007 GLboolean ATI_texture_env_combine3
;
2008 GLboolean HP_occlusion_test
;
2009 GLboolean IBM_rasterpos_clip
;
2010 GLboolean IBM_multimode_draw_arrays
;
2011 GLboolean MESA_pack_invert
;
2012 GLboolean MESA_packed_depth_stencil
;
2013 GLboolean MESA_program_debug
;
2014 GLboolean MESA_resize_buffers
;
2015 GLboolean MESA_ycbcr_texture
;
2016 GLboolean NV_blend_square
;
2017 GLboolean NV_fragment_program
;
2018 GLboolean NV_light_max_exponent
;
2019 GLboolean NV_point_sprite
;
2020 GLboolean NV_texgen_reflection
;
2021 GLboolean NV_texture_rectangle
;
2022 GLboolean NV_vertex_program
;
2023 GLboolean NV_vertex_program1_1
;
2024 GLboolean OES_read_format
;
2025 GLboolean SGI_color_matrix
;
2026 GLboolean SGI_color_table
;
2027 GLboolean SGI_texture_color_table
;
2028 GLboolean SGIS_generate_mipmap
;
2029 GLboolean SGIS_pixel_texture
;
2030 GLboolean SGIS_texture_edge_clamp
;
2031 GLboolean SGIS_texture_lod
;
2032 GLboolean SGIX_depth_texture
;
2033 GLboolean SGIX_pixel_texture
;
2034 GLboolean SGIX_shadow
;
2035 GLboolean SGIX_shadow_ambient
; /* or GL_ARB_shadow_ambient */
2036 GLboolean TDFX_texture_compression_FXT1
;
2039 /* The extension string */
2040 const GLubyte
*String
;
2045 * A stack of matrices (projection, modelview, color, texture, etc).
2049 GLmatrix
*Top
; /**< points into Stack */
2050 GLmatrix
*Stack
; /**< array [MaxDepth] of GLmatrix */
2051 GLuint Depth
; /**< 0 <= Depth < MaxDepth */
2052 GLuint MaxDepth
; /**< size of Stack[] array */
2053 GLuint DirtyFlag
; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */
2058 * \name Bits for image transfer operations
2060 * \sa __GLcontextRec::ImageTransferState.
2063 #define IMAGE_SCALE_BIAS_BIT 0x1
2064 #define IMAGE_SHIFT_OFFSET_BIT 0x2
2065 #define IMAGE_MAP_COLOR_BIT 0x4
2066 #define IMAGE_COLOR_TABLE_BIT 0x8
2067 #define IMAGE_CONVOLUTION_BIT 0x10
2068 #define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20
2069 #define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40
2070 #define IMAGE_COLOR_MATRIX_BIT 0x80
2071 #define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100
2072 #define IMAGE_HISTOGRAM_BIT 0x200
2073 #define IMAGE_MIN_MAX_BIT 0x400
2074 #define IMAGE_CLAMP_BIT 0x800 /* extra */
2077 /** Transfer ops up to convolution */
2078 #define IMAGE_PRE_CONVOLUTION_BITS (IMAGE_SCALE_BIAS_BIT | \
2079 IMAGE_SHIFT_OFFSET_BIT | \
2080 IMAGE_MAP_COLOR_BIT | \
2081 IMAGE_COLOR_TABLE_BIT)
2083 /** Transfer ops after convolution */
2084 #define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \
2085 IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \
2086 IMAGE_COLOR_MATRIX_BIT | \
2087 IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT |\
2088 IMAGE_HISTOGRAM_BIT | \
2094 * \name Bits to indicate what state has changed.
2099 #define _NEW_MODELVIEW 0x1 /**< __GLcontextRec::ModelView */
2100 #define _NEW_PROJECTION 0x2 /**< __GLcontextRec::Projection */
2101 #define _NEW_TEXTURE_MATRIX 0x4 /**< __GLcontextRec::TextureMatrix */
2102 #define _NEW_COLOR_MATRIX 0x8 /**< __GLcontextRec::ColorMatrix */
2103 #define _NEW_ACCUM 0x10 /**< __GLcontextRec::Accum */
2104 #define _NEW_COLOR 0x20 /**< __GLcontextRec::Color */
2105 #define _NEW_DEPTH 0x40 /**< __GLcontextRec::Depth */
2106 #define _NEW_EVAL 0x80 /**< __GLcontextRec::Eval, __GLcontextRec::EvalMap */
2107 #define _NEW_FOG 0x100 /**< __GLcontextRec::Fog */
2108 #define _NEW_HINT 0x200 /**< __GLcontextRec::Hint */
2109 #define _NEW_LIGHT 0x400 /**< __GLcontextRec::Light */
2110 #define _NEW_LINE 0x800 /**< __GLcontextRec::Line */
2111 #define _NEW_PIXEL 0x1000 /**< __GLcontextRec::Pixel */
2112 #define _NEW_POINT 0x2000 /**< __GLcontextRec::Point */
2113 #define _NEW_POLYGON 0x4000 /**< __GLcontextRec::Polygon */
2114 #define _NEW_POLYGONSTIPPLE 0x8000 /**< __GLcontextRec::PolygonStipple */
2115 #define _NEW_SCISSOR 0x10000 /**< __GLcontextRec::Scissor */
2116 #define _NEW_STENCIL 0x20000 /**< __GLcontextRec::Stencil */
2117 #define _NEW_TEXTURE 0x40000 /**< __GLcontextRec::Texture */
2118 #define _NEW_TRANSFORM 0x80000 /**< __GLcontextRec::Transform */
2119 #define _NEW_VIEWPORT 0x100000 /**< __GLcontextRec::Viewport */
2120 #define _NEW_PACKUNPACK 0x200000 /**< __GLcontextRec::Pack, __GLcontextRec::Unpack */
2121 #define _NEW_ARRAY 0x400000 /**< __GLcontextRec::Array */
2122 #define _NEW_RENDERMODE 0x800000 /**< __GLcontextRec::RenderMode, __GLcontextRec::Feedback, __GLcontextRec::Select */
2123 #define _NEW_BUFFERS 0x1000000 /**< __GLcontextRec::Visual, __GLcontextRec::DrawBuffer, */
2124 #define _NEW_MULTISAMPLE 0x2000000 /**< __GLcontextRec::Multisample */
2125 #define _NEW_TRACK_MATRIX 0x4000000 /**< __GLcontextRec::VertexProgram */
2126 #define _NEW_PROGRAM 0x8000000 /**< __GLcontextRec::VertexProgram */
2132 * \name Bits to track array state changes
2134 * Also used to summarize array enabled.
2137 #define _NEW_ARRAY_VERTEX VERT_BIT_POS
2138 #define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
2139 #define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
2140 #define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
2141 #define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
2142 #define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
2143 #define _NEW_ARRAY_INDEX VERT_BIT_SIX
2144 #define _NEW_ARRAY_EDGEFLAG VERT_BIT_SEVEN
2145 #define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
2146 #define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
2147 #define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
2148 #define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
2149 #define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
2150 #define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
2151 #define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
2152 #define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
2153 #define _NEW_ARRAY_ATTRIB_0 0x10000 /* start at bit 16 */
2154 #define _NEW_ARRAY_ALL 0xffffffff
2157 #define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
2158 #define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i))
2163 * \name A bunch of flags that we think might be useful to drivers.
2165 * Set in the __GLcontextRec::_TriangleCaps bitfield.
2168 #define DD_FLATSHADE 0x1
2169 #define DD_SEPARATE_SPECULAR 0x2
2170 #define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
2171 #define DD_TRI_LIGHT_TWOSIDE 0x8
2172 #define DD_TRI_UNFILLED 0x10
2173 #define DD_TRI_SMOOTH 0x20
2174 #define DD_TRI_STIPPLE 0x40
2175 #define DD_TRI_OFFSET 0x80
2176 #define DD_LINE_SMOOTH 0x100
2177 #define DD_LINE_STIPPLE 0x200
2178 #define DD_LINE_WIDTH 0x400
2179 #define DD_POINT_SMOOTH 0x800
2180 #define DD_POINT_SIZE 0x1000
2181 #define DD_POINT_ATTEN 0x2000
2186 * \name Define the state changes under which each of these bits might change
2189 #define _DD_NEW_FLATSHADE _NEW_LIGHT
2190 #define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
2191 #define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
2192 #define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
2193 #define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
2194 #define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
2195 #define _DD_NEW_TRI_STIPPLE _NEW_POLYGON
2196 #define _DD_NEW_TRI_OFFSET _NEW_POLYGON
2197 #define _DD_NEW_LINE_SMOOTH _NEW_LINE
2198 #define _DD_NEW_LINE_STIPPLE _NEW_LINE
2199 #define _DD_NEW_LINE_WIDTH _NEW_LINE
2200 #define _DD_NEW_POINT_SMOOTH _NEW_POINT
2201 #define _DD_NEW_POINT_SIZE _NEW_POINT
2202 #define _DD_NEW_POINT_ATTEN _NEW_POINT
2206 #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
2211 #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \
2214 #define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX)
2220 * Forward declaration of display list data types:
2223 typedef union node Node
;
2226 /* This has to be included here. */
2230 #define NUM_VERTEX_FORMAT_ENTRIES (sizeof(GLvertexformat) / sizeof(void *))
2233 * Core Mesa's support for tnl modules:
2235 struct gl_tnl_module
{
2237 * Vertex format to be lazily swapped into current dispatch.
2239 const GLvertexformat
*Current
;
2242 * \name Record of functions swapped out.
2243 * On restore, only need to swap these functions back in.
2246 void *Swapped
[NUM_VERTEX_FORMAT_ENTRIES
][2];
2251 struct mesa_list_state
{
2252 GLuint CallDepth
; /**< Current recursion calling depth */
2253 Node
*CurrentListPtr
; /**< Head of list being compiled */
2254 GLuint CurrentListNum
; /**< Number of the list being compiled */
2255 Node
*CurrentBlock
; /**< Pointer to current block of nodes */
2256 GLuint CurrentPos
; /**< Index into current block of nodes */
2257 GLvertexformat ListVtxfmt
;
2259 GLubyte ActiveAttribSize
[VERT_ATTRIB_MAX
];
2260 GLfloat CurrentAttrib
[VERT_ATTRIB_MAX
][4];
2262 GLubyte ActiveMaterialSize
[MAT_ATTRIB_MAX
];
2263 GLfloat CurrentMaterial
[MAT_ATTRIB_MAX
][4];
2265 GLubyte ActiveIndex
;
2266 GLfloat CurrentIndex
;
2268 GLubyte ActiveEdgeFlag
;
2269 GLboolean CurrentEdgeFlag
;
2276 * This is the central context data structure for Mesa. Almost all
2277 * OpenGL state is contained in this structure.
2278 * Think of this as a base class from which device drivers will derive
2281 struct __GLcontextRec
{
2283 * \name OS related interfaces.
2285 * These \b must be the first members of this structure, because they are
2286 * exposed to the outside world (i.e. GLX extension).
2289 __GLimports imports
;
2290 __GLexports exports
;
2293 /** State possibly shared with other contexts in the address space */
2294 struct gl_shared_state
*Shared
;
2296 /** \name API function pointer tables */
2298 struct _glapi_table
*Save
; /**< Display list save functions */
2299 struct _glapi_table
*Exec
; /**< Execute functions */
2300 struct _glapi_table
*CurrentDispatch
; /**< == Save or Exec !! */
2304 GLframebuffer
*DrawBuffer
; /**< buffer for writing */
2305 GLframebuffer
*ReadBuffer
; /**< buffer for reading */
2308 * Device driver function pointer table
2310 struct dd_function_table Driver
;
2312 void *DriverCtx
; /**< Points to device driver context/state */
2313 void *DriverMgrCtx
; /**< Points to device driver manager (optional)*/
2315 /** Core/Driver constants */
2316 struct gl_constants Const
;
2318 /** \name The various 4x4 matrix stacks */
2320 struct matrix_stack ModelviewMatrixStack
;
2321 struct matrix_stack ProjectionMatrixStack
;
2322 struct matrix_stack ColorMatrixStack
;
2323 struct matrix_stack TextureMatrixStack
[MAX_TEXTURE_COORD_UNITS
];
2324 struct matrix_stack ProgramMatrixStack
[MAX_PROGRAM_MATRICES
];
2325 struct matrix_stack
*CurrentStack
; /**< Points to one of the above stacks */
2328 /** Combined modelview and projection matrix */
2329 GLmatrix _ModelProjectMatrix
;
2331 /** \name Display lists */
2332 struct mesa_list_state ListState
;
2334 GLboolean ExecuteFlag
; /**< Execute GL commands? */
2335 GLboolean CompileFlag
; /**< Compile GL commands into display list? */
2338 struct gl_extensions Extensions
;
2340 /** \name Renderer attribute stack */
2342 GLuint AttribStackDepth
;
2343 struct gl_attrib_node
*AttribStack
[MAX_ATTRIB_STACK_DEPTH
];
2346 /** \name Renderer attribute groups
2348 * We define a struct for each attribute group to make pushing and popping
2349 * attributes easy. Also it's a good organization.
2352 struct gl_accum_attrib Accum
; /**< Accumulation buffer attributes */
2353 struct gl_colorbuffer_attrib Color
; /**< Color buffers attributes */
2354 struct gl_current_attrib Current
; /**< Current attributes */
2355 struct gl_depthbuffer_attrib Depth
; /**< Depth buffer attributes */
2356 struct gl_eval_attrib Eval
; /**< Eval attributes */
2357 struct gl_fog_attrib Fog
; /**< Fog attributes */
2358 struct gl_hint_attrib Hint
; /**< Hint attributes */
2359 struct gl_light_attrib Light
; /**< Light attributes */
2360 struct gl_line_attrib Line
; /**< Line attributes */
2361 struct gl_list_attrib List
; /**< List attributes */
2362 struct gl_multisample_attrib Multisample
;
2363 struct gl_pixel_attrib Pixel
; /**< Pixel attributes */
2364 struct gl_point_attrib Point
; /**< Point attributes */
2365 struct gl_polygon_attrib Polygon
; /**< Polygon attributes */
2366 GLuint PolygonStipple
[32]; /**< Polygon stipple */
2367 struct gl_scissor_attrib Scissor
; /**< Scissor attributes */
2368 struct gl_stencil_attrib Stencil
; /**< Stencil buffer attributes */
2369 struct gl_texture_attrib Texture
; /**< Texture attributes */
2370 struct gl_transform_attrib Transform
; /**< Transformation attributes */
2371 struct gl_viewport_attrib Viewport
; /**< Viewport attributes */
2374 /** \name Other attribute groups */
2376 struct gl_histogram_attrib Histogram
;
2377 struct gl_minmax_attrib MinMax
;
2378 struct gl_convolution_attrib Convolution1D
;
2379 struct gl_convolution_attrib Convolution2D
;
2380 struct gl_convolution_attrib Separable2D
;
2383 /** \name Client attribute stack */
2385 GLuint ClientAttribStackDepth
;
2386 struct gl_attrib_node
*ClientAttribStack
[MAX_CLIENT_ATTRIB_STACK_DEPTH
];
2389 /** \name Client attribute groups */
2391 struct gl_array_attrib Array
; /**< Vertex arrays */
2392 struct gl_pixelstore_attrib Pack
; /**< Pixel packing */
2393 struct gl_pixelstore_attrib Unpack
; /**< Pixel unpacking */
2394 struct gl_pixelstore_attrib DefaultPacking
; /**< Default params */
2396 struct gl_evaluators EvalMap
; /**< All evaluators */
2397 struct gl_feedback Feedback
; /**< Feedback */
2398 struct gl_selection Select
; /**< Selection */
2400 struct gl_color_table ColorTable
; /**< Pre-convolution */
2401 struct gl_color_table ProxyColorTable
; /**< Pre-convolution */
2402 struct gl_color_table PostConvolutionColorTable
;
2403 struct gl_color_table ProxyPostConvolutionColorTable
;
2404 struct gl_color_table PostColorMatrixColorTable
;
2405 struct gl_color_table ProxyPostColorMatrixColorTable
;
2407 struct program_state Program
; /**< for vertex or fragment progs */
2408 struct vertex_program_state VertexProgram
; /**< GL_NV_vertex_program */
2409 struct fragment_program_state FragmentProgram
; /**< GL_NV_fragment_program */
2411 struct occlusion_state Occlusion
; /**< GL_ARB_occlusion_query */
2413 GLenum ErrorValue
; /**< Last error code */
2414 GLenum RenderMode
; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
2415 GLuint NewState
; /**< bitwise-or of _NEW_* flags */
2418 /** \name Derived */
2420 GLuint _TriangleCaps
; /**< bitwise-or of DD_* flags */
2421 GLuint _ImageTransferState
;/**< bitwise-or of IMAGE_*_BIT flags */
2422 GLfloat _EyeZDir
[3];
2423 GLfloat _ModelViewInvScale
;
2424 GLuint _NeedEyeCoords
;
2425 GLuint _ForceEyeCoords
;
2426 GLboolean _RotateMode
;
2427 GLenum _CurrentProgram
; /* currently executing program */
2429 struct gl_shine_tab
*_ShineTable
[2]; /**< Active shine tables */
2430 struct gl_shine_tab
*_ShineTabList
; /**< MRU list of inactive shine tables */
2433 struct gl_list_extensions ListExt
; /**< driver dlist extensions */
2436 GLboolean OcclusionResult
; /**< for GL_HP_occlusion_test */
2437 GLboolean OcclusionResultSaved
; /**< for GL_HP_occlusion_test */
2438 GLuint _Facing
; /**< This is a hack for 2-sided stencil test.
2440 * We don't have a better way to communicate this value from
2441 * swrast_setup to swrast. */
2444 /** \name Z buffer stuff */
2446 GLuint DepthMax
; /**< Max depth buffer value */
2447 GLfloat DepthMaxF
; /**< Float max depth buffer value */
2448 GLfloat MRD
; /**< minimum resolvable difference in Z values */
2451 /** \name Color clamping (tentative part of GL_ARB_color_clamp_control) */
2453 GLboolean ClampFragmentColors
;
2454 GLboolean ClampVertexColors
;
2457 /** \name For debugging/development only */
2459 GLboolean FirstTimeCurrent
;
2462 /** Dither disable via MESA_NO_DITHER env var */
2465 /** software compression/decompression supported or not */
2466 GLboolean Mesa_DXTn
;
2468 /** Core tnl module support */
2469 struct gl_tnl_module TnlModule
;
2472 * \name Hooks for module contexts.
2474 * These will eventually live in the driver or elsewhere.
2477 void *swrast_context
;
2478 void *swsetup_context
;
2479 void *swtnl_context
;
2481 void *acache_context
;
2487 /** The string names for GL_POINT, GL_LINE_LOOP, etc */
2488 extern const char *_mesa_prim_name
[GL_POLYGON
+4];
2492 extern int MESA_VERBOSE
;
2493 extern int MESA_DEBUG_FLAGS
;
2494 # define MESA_FUNCTION __FUNCTION__
2496 # define MESA_VERBOSE 0
2497 # define MESA_DEBUG_FLAGS 0
2498 # define MESA_FUNCTION "a function"
2506 VERBOSE_VARRAY
= 0x0001,
2507 VERBOSE_TEXTURE
= 0x0002,
2508 VERBOSE_IMMEDIATE
= 0x0004,
2509 VERBOSE_PIPELINE
= 0x0008,
2510 VERBOSE_DRIVER
= 0x0010,
2511 VERBOSE_STATE
= 0x0020,
2512 VERBOSE_API
= 0x0040,
2513 VERBOSE_DISPLAY_LIST
= 0x0100,
2514 VERBOSE_LIGHTING
= 0x0200,
2515 VERBOSE_PRIMS
= 0x0400,
2516 VERBOSE_VERTS
= 0x0800
2521 DEBUG_ALWAYS_FLUSH
= 0x1
2526 #define Elements(x) sizeof(x)/sizeof(*(x))
2529 #endif /* TYPES_H */