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-2007 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 <GL/internal/glcore.h> /* __GLcontextModes (GLvisual) */
40 #include "config.h" /* Hardwired parameters */
41 #include "glapi/glapitable.h"
42 #include "glapi/glthread.h"
43 #include "math/m_matrix.h" /* GLmatrix */
48 * Special, internal token
50 #define GL_SHADER_PROGRAM_MESA 0x9999
54 * Color channel data type.
57 typedef GLubyte GLchan
;
59 #define CHAN_MAXF 255.0F
60 #define CHAN_TYPE GL_UNSIGNED_BYTE
62 typedef GLushort GLchan
;
63 #define CHAN_MAX 65535
64 #define CHAN_MAXF 65535.0F
65 #define CHAN_TYPE GL_UNSIGNED_SHORT
67 typedef GLfloat GLchan
;
69 #define CHAN_MAXF 1.0F
70 #define CHAN_TYPE GL_FLOAT
72 #error "illegal number of color channel bits"
77 * Stencil buffer data type.
80 typedef GLubyte GLstencil
;
81 #elif STENCIL_BITS==16
82 typedef GLushort GLstencil
;
84 # error "illegal number of stencil bits"
89 * Fixed point data type.
93 * Fixed point arithmetic macros
95 #ifndef FIXED_FRAC_BITS
96 #define FIXED_FRAC_BITS 11
99 #define FIXED_SHIFT FIXED_FRAC_BITS
100 #define FIXED_ONE (1 << FIXED_SHIFT)
101 #define FIXED_HALF (1 << (FIXED_SHIFT-1))
102 #define FIXED_FRAC_MASK (FIXED_ONE - 1)
103 #define FIXED_INT_MASK (~FIXED_FRAC_MASK)
104 #define FIXED_EPSILON 1
105 #define FIXED_SCALE ((float) FIXED_ONE)
106 #define FIXED_DBL_SCALE ((double) FIXED_ONE)
107 #define FloatToFixed(X) (IROUND((X) * FIXED_SCALE))
108 #define FixedToDouble(X) ((X) * (1.0 / FIXED_DBL_SCALE))
109 #define IntToFixed(I) ((I) << FIXED_SHIFT)
110 #define FixedToInt(X) ((X) >> FIXED_SHIFT)
111 #define FixedToUns(X) (((unsigned int)(X)) >> FIXED_SHIFT)
112 #define FixedCeil(X) (((X) + FIXED_ONE - FIXED_EPSILON) & FIXED_INT_MASK)
113 #define FixedFloor(X) ((X) & FIXED_INT_MASK)
114 #define FixedToFloat(X) ((X) * (1.0F / FIXED_SCALE))
115 #define PosFloatToFixed(X) FloatToFixed(X)
116 #define SignedFloatToFixed(X) FloatToFixed(X)
121 * \name Some forward type declarations
124 struct _mesa_HashTable
;
125 struct gl_pixelstore_attrib
;
126 struct gl_texture_format
;
127 struct gl_texture_image
;
128 struct gl_texture_object
;
131 typedef struct __GLcontextRec GLcontext
;
132 typedef struct __GLcontextModesRec GLvisual
;
133 typedef struct gl_framebuffer GLframebuffer
;
139 * Indexes for vertex program attributes.
140 * GL_NV_vertex_program aliases generic attributes over the conventional
141 * attributes. In GL_ARB_vertex_program shader the aliasing is optional.
142 * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
143 * generic attributes are distinct/separate).
148 VERT_ATTRIB_WEIGHT
= 1,
149 VERT_ATTRIB_NORMAL
= 2,
150 VERT_ATTRIB_COLOR0
= 3,
151 VERT_ATTRIB_COLOR1
= 4,
153 VERT_ATTRIB_COLOR_INDEX
= 6,
154 VERT_ATTRIB_EDGEFLAG
= 7,
155 VERT_ATTRIB_TEX0
= 8,
156 VERT_ATTRIB_TEX1
= 9,
157 VERT_ATTRIB_TEX2
= 10,
158 VERT_ATTRIB_TEX3
= 11,
159 VERT_ATTRIB_TEX4
= 12,
160 VERT_ATTRIB_TEX5
= 13,
161 VERT_ATTRIB_TEX6
= 14,
162 VERT_ATTRIB_TEX7
= 15,
163 VERT_ATTRIB_GENERIC0
= 16,
164 VERT_ATTRIB_GENERIC1
= 17,
165 VERT_ATTRIB_GENERIC2
= 18,
166 VERT_ATTRIB_GENERIC3
= 19,
167 VERT_ATTRIB_GENERIC4
= 20,
168 VERT_ATTRIB_GENERIC5
= 21,
169 VERT_ATTRIB_GENERIC6
= 22,
170 VERT_ATTRIB_GENERIC7
= 23,
171 VERT_ATTRIB_GENERIC8
= 24,
172 VERT_ATTRIB_GENERIC9
= 25,
173 VERT_ATTRIB_GENERIC10
= 26,
174 VERT_ATTRIB_GENERIC11
= 27,
175 VERT_ATTRIB_GENERIC12
= 28,
176 VERT_ATTRIB_GENERIC13
= 29,
177 VERT_ATTRIB_GENERIC14
= 30,
178 VERT_ATTRIB_GENERIC15
= 31,
183 * Bitflags for vertex attributes.
184 * These are used in bitfields in many places.
187 #define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
188 #define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
189 #define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
190 #define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
191 #define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
192 #define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
193 #define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX)
194 #define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG)
195 #define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
196 #define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
197 #define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
198 #define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
199 #define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
200 #define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
201 #define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
202 #define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
203 #define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0)
204 #define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1)
205 #define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2)
206 #define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3)
207 #define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4)
208 #define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5)
209 #define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6)
210 #define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7)
211 #define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8)
212 #define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9)
213 #define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10)
214 #define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11)
215 #define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12)
216 #define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13)
217 #define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14)
218 #define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15)
220 #define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
221 #define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g)))
226 * Indexes for vertex program result attributes
229 #define VERT_RESULT_HPOS 0
230 #define VERT_RESULT_COL0 1
231 #define VERT_RESULT_COL1 2
232 #define VERT_RESULT_FOGC 3
233 #define VERT_RESULT_TEX0 4
234 #define VERT_RESULT_TEX1 5
235 #define VERT_RESULT_TEX2 6
236 #define VERT_RESULT_TEX3 7
237 #define VERT_RESULT_TEX4 8
238 #define VERT_RESULT_TEX5 9
239 #define VERT_RESULT_TEX6 10
240 #define VERT_RESULT_TEX7 11
241 #define VERT_RESULT_PSIZ 12
242 #define VERT_RESULT_BFC0 13
243 #define VERT_RESULT_BFC1 14
244 #define VERT_RESULT_EDGE 15
245 #define VERT_RESULT_VAR0 16 /**< shader varying */
246 #define VERT_RESULT_MAX (VERT_RESULT_VAR0 + MAX_VARYING)
251 * Indexes for fragment program input attributes.
255 FRAG_ATTRIB_WPOS
= 0,
256 FRAG_ATTRIB_COL0
= 1,
257 FRAG_ATTRIB_COL1
= 2,
258 FRAG_ATTRIB_FOGC
= 3,
259 FRAG_ATTRIB_TEX0
= 4,
260 FRAG_ATTRIB_TEX1
= 5,
261 FRAG_ATTRIB_TEX2
= 6,
262 FRAG_ATTRIB_TEX3
= 7,
263 FRAG_ATTRIB_TEX4
= 8,
264 FRAG_ATTRIB_TEX5
= 9,
265 FRAG_ATTRIB_TEX6
= 10,
266 FRAG_ATTRIB_TEX7
= 11,
267 FRAG_ATTRIB_VAR0
= 12, /**< shader varying */
268 FRAG_ATTRIB_MAX
= (FRAG_ATTRIB_VAR0
+ MAX_VARYING
)
272 * Bitflags for fragment program input attributes.
275 #define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
276 #define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
277 #define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
278 #define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
279 #define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
280 #define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
281 #define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
282 #define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
283 #define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
284 #define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
285 #define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
286 #define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
287 #define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0)
289 #define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U))
290 #define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V))
292 #define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
304 * Fragment program results
308 FRAG_RESULT_COLR
= 0,
309 FRAG_RESULT_COLH
= 1,
310 FRAG_RESULT_DEPR
= 2,
311 FRAG_RESULT_DATA0
= 3,
312 FRAG_RESULT_MAX
= (FRAG_RESULT_DATA0
+ MAX_DRAW_BUFFERS
)
317 * Indexes for all renderbuffers
320 BUFFER_FRONT_LEFT
= 0, /* the four standard color buffers */
321 BUFFER_BACK_LEFT
= 1,
322 BUFFER_FRONT_RIGHT
= 2,
323 BUFFER_BACK_RIGHT
= 3,
324 BUFFER_AUX0
= 4, /* optional aux buffer */
331 BUFFER_COLOR0
= 11, /* generic renderbuffers */
343 * Bit flags for all renderbuffers
345 #define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT)
346 #define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT)
347 #define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT)
348 #define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT)
349 #define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0)
350 #define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1)
351 #define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2)
352 #define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3)
353 #define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH)
354 #define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL)
355 #define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM)
356 #define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0)
357 #define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1)
358 #define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2)
359 #define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3)
360 #define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4)
361 #define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5)
362 #define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6)
363 #define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7)
366 * Mask of all the color buffer bits (but not accum).
368 #define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \
369 BUFFER_BIT_BACK_LEFT | \
370 BUFFER_BIT_FRONT_RIGHT | \
371 BUFFER_BIT_BACK_RIGHT | \
376 BUFFER_BIT_COLOR0 | \
377 BUFFER_BIT_COLOR1 | \
378 BUFFER_BIT_COLOR2 | \
379 BUFFER_BIT_COLOR3 | \
380 BUFFER_BIT_COLOR4 | \
381 BUFFER_BIT_COLOR5 | \
382 BUFFER_BIT_COLOR6 | \
386 /** The pixel transfer path has three color tables: */
388 #define COLORTABLE_PRECONVOLUTION 0
389 #define COLORTABLE_POSTCONVOLUTION 1
390 #define COLORTABLE_POSTCOLORMATRIX 2
391 #define COLORTABLE_MAX 3
396 * Data structure for color tables
398 struct gl_color_table
400 GLenum InternalFormat
; /**< The user-specified format */
401 GLenum _BaseFormat
; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */
402 GLuint Size
; /**< number of entries in table */
403 GLfloat
*TableF
; /**< Color table, floating point values */
404 GLubyte
*TableUB
; /**< Color table, ubyte values */
409 GLubyte LuminanceSize
;
410 GLubyte IntensitySize
;
415 * \name Bit flags used for updating material values.
418 #define MAT_ATTRIB_FRONT_AMBIENT 0
419 #define MAT_ATTRIB_BACK_AMBIENT 1
420 #define MAT_ATTRIB_FRONT_DIFFUSE 2
421 #define MAT_ATTRIB_BACK_DIFFUSE 3
422 #define MAT_ATTRIB_FRONT_SPECULAR 4
423 #define MAT_ATTRIB_BACK_SPECULAR 5
424 #define MAT_ATTRIB_FRONT_EMISSION 6
425 #define MAT_ATTRIB_BACK_EMISSION 7
426 #define MAT_ATTRIB_FRONT_SHININESS 8
427 #define MAT_ATTRIB_BACK_SHININESS 9
428 #define MAT_ATTRIB_FRONT_INDEXES 10
429 #define MAT_ATTRIB_BACK_INDEXES 11
430 #define MAT_ATTRIB_MAX 12
432 #define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f))
433 #define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f))
434 #define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f))
435 #define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f))
436 #define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f))
437 #define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f))
439 #define MAT_INDEX_AMBIENT 0
440 #define MAT_INDEX_DIFFUSE 1
441 #define MAT_INDEX_SPECULAR 2
443 #define MAT_BIT_FRONT_AMBIENT (1<<MAT_ATTRIB_FRONT_AMBIENT)
444 #define MAT_BIT_BACK_AMBIENT (1<<MAT_ATTRIB_BACK_AMBIENT)
445 #define MAT_BIT_FRONT_DIFFUSE (1<<MAT_ATTRIB_FRONT_DIFFUSE)
446 #define MAT_BIT_BACK_DIFFUSE (1<<MAT_ATTRIB_BACK_DIFFUSE)
447 #define MAT_BIT_FRONT_SPECULAR (1<<MAT_ATTRIB_FRONT_SPECULAR)
448 #define MAT_BIT_BACK_SPECULAR (1<<MAT_ATTRIB_BACK_SPECULAR)
449 #define MAT_BIT_FRONT_EMISSION (1<<MAT_ATTRIB_FRONT_EMISSION)
450 #define MAT_BIT_BACK_EMISSION (1<<MAT_ATTRIB_BACK_EMISSION)
451 #define MAT_BIT_FRONT_SHININESS (1<<MAT_ATTRIB_FRONT_SHININESS)
452 #define MAT_BIT_BACK_SHININESS (1<<MAT_ATTRIB_BACK_SHININESS)
453 #define MAT_BIT_FRONT_INDEXES (1<<MAT_ATTRIB_FRONT_INDEXES)
454 #define MAT_BIT_BACK_INDEXES (1<<MAT_ATTRIB_BACK_INDEXES)
457 #define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \
458 MAT_BIT_FRONT_AMBIENT | \
459 MAT_BIT_FRONT_DIFFUSE | \
460 MAT_BIT_FRONT_SPECULAR | \
461 MAT_BIT_FRONT_SHININESS | \
462 MAT_BIT_FRONT_INDEXES)
464 #define BACK_MATERIAL_BITS (MAT_BIT_BACK_EMISSION | \
465 MAT_BIT_BACK_AMBIENT | \
466 MAT_BIT_BACK_DIFFUSE | \
467 MAT_BIT_BACK_SPECULAR | \
468 MAT_BIT_BACK_SHININESS | \
469 MAT_BIT_BACK_INDEXES)
471 #define ALL_MATERIAL_BITS (FRONT_MATERIAL_BITS | BACK_MATERIAL_BITS)
475 #define EXP_TABLE_SIZE 512 /**< Specular exponent lookup table sizes */
476 #define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes */
479 * Material shininess lookup table.
483 struct gl_shine_tab
*next
, *prev
;
484 GLfloat tab
[SHINE_TABLE_SIZE
+1];
491 * Light source state.
495 struct gl_light
*next
; /**< double linked list with sentinel */
496 struct gl_light
*prev
;
498 GLfloat Ambient
[4]; /**< ambient color */
499 GLfloat Diffuse
[4]; /**< diffuse color */
500 GLfloat Specular
[4]; /**< specular color */
501 GLfloat EyePosition
[4]; /**< position in eye coordinates */
502 GLfloat EyeDirection
[4]; /**< spotlight dir in eye coordinates */
503 GLfloat SpotExponent
;
504 GLfloat SpotCutoff
; /**< in degrees */
505 GLfloat _CosCutoffNeg
; /**< = cos(SpotCutoff) */
506 GLfloat _CosCutoff
; /**< = MAX(0, cos(SpotCutoff)) */
507 GLfloat ConstantAttenuation
;
508 GLfloat LinearAttenuation
;
509 GLfloat QuadraticAttenuation
;
510 GLboolean Enabled
; /**< On/off flag */
513 * \name Derived fields
516 GLbitfield _Flags
; /**< State */
518 GLfloat _Position
[4]; /**< position in eye/obj coordinates */
519 GLfloat _VP_inf_norm
[3]; /**< Norm direction to infinite light */
520 GLfloat _h_inf_norm
[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */
521 GLfloat _NormDirection
[4]; /**< normalized spotlight direction */
522 GLfloat _VP_inf_spot_attenuation
;
524 GLfloat _SpotExpTable
[EXP_TABLE_SIZE
][2]; /**< to replace a pow() call */
525 GLfloat _MatAmbient
[2][3]; /**< material ambient * light ambient */
526 GLfloat _MatDiffuse
[2][3]; /**< material diffuse * light diffuse */
527 GLfloat _MatSpecular
[2][3]; /**< material spec * light specular */
528 GLfloat _dli
; /**< CI diffuse light intensity */
529 GLfloat _sli
; /**< CI specular light intensity */
539 GLfloat Ambient
[4]; /**< ambient color */
540 GLboolean LocalViewer
; /**< Local (or infinite) view point? */
541 GLboolean TwoSide
; /**< Two (or one) sided lighting? */
542 GLenum ColorControl
; /**< either GL_SINGLE_COLOR
543 * or GL_SEPARATE_SPECULAR_COLOR */
552 GLfloat Attrib
[MAT_ATTRIB_MAX
][4];
557 * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
559 struct gl_accum_attrib
561 GLfloat ClearColor
[4]; /**< Accumulation buffer clear color */
566 * Color buffer attribute group (GL_COLOR_BUFFER_BIT).
568 struct gl_colorbuffer_attrib
570 GLuint ClearIndex
; /**< Index to use for glClear */
571 GLclampf ClearColor
[4]; /**< Color to use for glClear */
573 GLuint IndexMask
; /**< Color index write mask */
574 GLubyte ColorMask
[4]; /**< Each flag is 0xff or 0x0 */
576 GLenum DrawBuffer
[MAX_DRAW_BUFFERS
]; /**< Which buffer to draw into */
579 * \name alpha testing
582 GLboolean AlphaEnabled
; /**< Alpha test enabled flag */
583 GLenum AlphaFunc
; /**< Alpha test function */
584 GLclampf AlphaRef
; /**< Alpha reference value */
591 GLboolean BlendEnabled
; /**< Blending enabled flag */
592 GLenum BlendSrcRGB
; /**< Blending source operator */
593 GLenum BlendDstRGB
; /**< Blending destination operator */
594 GLenum BlendSrcA
; /**< GL_INGR_blend_func_separate */
595 GLenum BlendDstA
; /**< GL_INGR_blend_func_separate */
596 GLenum BlendEquationRGB
; /**< Blending equation */
597 GLenum BlendEquationA
; /**< GL_EXT_blend_equation_separate */
598 GLfloat BlendColor
[4]; /**< Blending color */
605 GLenum LogicOp
; /**< Logic operator */
606 GLboolean IndexLogicOpEnabled
; /**< Color index logic op enabled flag */
607 GLboolean ColorLogicOpEnabled
; /**< RGBA logic op enabled flag */
608 GLboolean _LogicOpEnabled
; /**< RGBA logic op + EXT_blend_logic_op enabled flag */
611 GLboolean DitherFlag
; /**< Dither enable flag */
613 GLenum ClampFragmentColor
; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
614 GLenum ClampReadColor
; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */
619 * Current attribute group (GL_CURRENT_BIT).
621 struct gl_current_attrib
624 * \name Current vertex attributes.
625 * \note Values are valid only after FLUSH_VERTICES has been called.
626 * \note Index and Edgeflag current values are stored as floats in the
627 * SIX and SEVEN attribute slots.
630 GLfloat Attrib
[VERT_ATTRIB_MAX
][4]; /**< Position, color, texcoords, etc */
634 * \name Current raster position attributes (always valid).
635 * \note This set of attributes is very similar to the SWvertex struct.
638 GLfloat RasterPos
[4];
639 GLfloat RasterDistance
;
640 GLfloat RasterColor
[4];
641 GLfloat RasterSecondaryColor
[4];
643 GLfloat RasterTexCoords
[MAX_TEXTURE_COORD_UNITS
][4];
644 GLboolean RasterPosValid
;
650 * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT).
652 struct gl_depthbuffer_attrib
654 GLenum Func
; /**< Function for depth buffer compare */
655 GLclampd Clear
; /**< Value to clear depth buffer to */
656 GLboolean Test
; /**< Depth buffering enabled flag */
657 GLboolean Mask
; /**< Depth buffer writable? */
658 GLboolean BoundsTest
; /**< GL_EXT_depth_bounds_test */
659 GLfloat BoundsMin
, BoundsMax
;/**< GL_EXT_depth_bounds_test */
664 * glEnable()/glDisable() attribute group (GL_ENABLE_BIT).
666 struct gl_enable_attrib
669 GLboolean AutoNormal
;
671 GLbitfield ClipPlanes
;
672 GLboolean ColorMaterial
;
673 GLboolean ColorTable
[COLORTABLE_MAX
];
674 GLboolean Convolution1D
;
675 GLboolean Convolution2D
;
676 GLboolean Separable2D
;
682 GLboolean Light
[MAX_LIGHTS
];
684 GLboolean LineSmooth
;
685 GLboolean LineStipple
;
686 GLboolean IndexLogicOp
;
687 GLboolean ColorLogicOp
;
688 GLboolean Map1Color4
;
690 GLboolean Map1Normal
;
691 GLboolean Map1TextureCoord1
;
692 GLboolean Map1TextureCoord2
;
693 GLboolean Map1TextureCoord3
;
694 GLboolean Map1TextureCoord4
;
695 GLboolean Map1Vertex3
;
696 GLboolean Map1Vertex4
;
697 GLboolean Map1Attrib
[16]; /* GL_NV_vertex_program */
698 GLboolean Map2Color4
;
700 GLboolean Map2Normal
;
701 GLboolean Map2TextureCoord1
;
702 GLboolean Map2TextureCoord2
;
703 GLboolean Map2TextureCoord3
;
704 GLboolean Map2TextureCoord4
;
705 GLboolean Map2Vertex3
;
706 GLboolean Map2Vertex4
;
707 GLboolean Map2Attrib
[16]; /* GL_NV_vertex_program */
710 GLboolean PixelTexture
;
711 GLboolean PointSmooth
;
712 GLboolean PolygonOffsetPoint
;
713 GLboolean PolygonOffsetLine
;
714 GLboolean PolygonOffsetFill
;
715 GLboolean PolygonSmooth
;
716 GLboolean PolygonStipple
;
717 GLboolean RescaleNormals
;
720 GLboolean StencilTwoSide
; /* GL_EXT_stencil_two_side */
721 GLboolean MultisampleEnabled
; /* GL_ARB_multisample */
722 GLboolean SampleAlphaToCoverage
; /* GL_ARB_multisample */
723 GLboolean SampleAlphaToOne
; /* GL_ARB_multisample */
724 GLboolean SampleCoverage
; /* GL_ARB_multisample */
725 GLboolean SampleCoverageInvert
; /* GL_ARB_multisample */
726 GLboolean RasterPositionUnclipped
; /* GL_IBM_rasterpos_clip */
727 GLuint Texture
[MAX_TEXTURE_IMAGE_UNITS
];
728 GLuint TexGen
[MAX_TEXTURE_COORD_UNITS
];
729 /* SGI_texture_color_table */
730 GLboolean TextureColorTable
[MAX_TEXTURE_IMAGE_UNITS
];
731 /* GL_ARB_vertex_program / GL_NV_vertex_program */
732 GLboolean VertexProgram
;
733 GLboolean VertexProgramPointSize
;
734 GLboolean VertexProgramTwoSide
;
735 /* GL_ARB_point_sprite / GL_NV_point_sprite */
736 GLboolean PointSprite
;
737 GLboolean FragmentShaderATI
;
742 * Evaluator attribute group (GL_EVAL_BIT).
744 struct gl_eval_attrib
750 GLboolean Map1Color4
;
752 GLboolean Map1Normal
;
753 GLboolean Map1TextureCoord1
;
754 GLboolean Map1TextureCoord2
;
755 GLboolean Map1TextureCoord3
;
756 GLboolean Map1TextureCoord4
;
757 GLboolean Map1Vertex3
;
758 GLboolean Map1Vertex4
;
759 GLboolean Map1Attrib
[16]; /* GL_NV_vertex_program */
760 GLboolean Map2Color4
;
762 GLboolean Map2Normal
;
763 GLboolean Map2TextureCoord1
;
764 GLboolean Map2TextureCoord2
;
765 GLboolean Map2TextureCoord3
;
766 GLboolean Map2TextureCoord4
;
767 GLboolean Map2Vertex3
;
768 GLboolean Map2Vertex4
;
769 GLboolean Map2Attrib
[16]; /* GL_NV_vertex_program */
770 GLboolean AutoNormal
;
774 * \name Map Grid endpoints and divisions and calculated du values
778 GLfloat MapGrid1u1
, MapGrid1u2
, MapGrid1du
;
779 GLint MapGrid2un
, MapGrid2vn
;
780 GLfloat MapGrid2u1
, MapGrid2u2
, MapGrid2du
;
781 GLfloat MapGrid2v1
, MapGrid2v2
, MapGrid2dv
;
787 * Fog attribute group (GL_FOG_BIT).
791 GLboolean Enabled
; /**< Fog enabled flag */
792 GLfloat Color
[4]; /**< Fog color */
793 GLfloat Density
; /**< Density >= 0.0 */
794 GLfloat Start
; /**< Start distance in eye coords */
795 GLfloat End
; /**< End distance in eye coords */
796 GLfloat Index
; /**< Fog index */
797 GLenum Mode
; /**< Fog mode */
798 GLboolean ColorSumEnabled
;
799 GLenum FogCoordinateSource
; /**< GL_EXT_fog_coord */
800 GLfloat _Scale
; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */
805 * Hint attribute group (GL_HINT_BIT).
807 * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE.
809 struct gl_hint_attrib
811 GLenum PerspectiveCorrection
;
814 GLenum PolygonSmooth
;
816 GLenum ClipVolumeClipping
; /**< GL_EXT_clip_volume_hint */
817 GLenum TextureCompression
; /**< GL_ARB_texture_compression */
818 GLenum GenerateMipmap
; /**< GL_SGIS_generate_mipmap */
819 GLenum FragmentShaderDerivative
; /**< GL_ARB_fragment_shader */
824 * Histogram attributes.
826 struct gl_histogram_attrib
828 GLuint Width
; /**< number of table entries */
829 GLint Format
; /**< GL_ALPHA, GL_RGB, etc */
830 GLuint Count
[HISTOGRAM_TABLE_SIZE
][4]; /**< the histogram */
831 GLboolean Sink
; /**< terminate image transfer? */
832 GLubyte RedSize
; /**< Bits per counter */
836 GLubyte LuminanceSize
;
841 * Color Min/max state.
843 struct gl_minmax_attrib
847 GLfloat Min
[4], Max
[4]; /**< RGBA */
852 * Image convolution state.
854 struct gl_convolution_attrib
857 GLenum InternalFormat
;
860 GLfloat Filter
[MAX_CONVOLUTION_WIDTH
* MAX_CONVOLUTION_HEIGHT
* 4];
868 #define LIGHT_SPOT 0x1
869 #define LIGHT_LOCAL_VIEWER 0x2
870 #define LIGHT_POSITIONAL 0x4
871 #define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
876 * Lighting attribute group (GL_LIGHT_BIT).
878 struct gl_light_attrib
880 struct gl_light Light
[MAX_LIGHTS
]; /**< Array of light sources */
881 struct gl_lightmodel Model
; /**< Lighting model */
884 * Must flush FLUSH_VERTICES before referencing:
887 struct gl_material Material
; /**< Includes front & back values */
890 GLboolean Enabled
; /**< Lighting enabled flag */
891 GLenum ShadeModel
; /**< GL_FLAT or GL_SMOOTH */
892 GLenum ColorMaterialFace
; /**< GL_FRONT, BACK or FRONT_AND_BACK */
893 GLenum ColorMaterialMode
; /**< GL_AMBIENT, GL_DIFFUSE, etc */
894 GLbitfield ColorMaterialBitmask
; /**< bitmask formed from Face and Mode */
895 GLboolean ColorMaterialEnabled
;
896 GLenum ClampVertexColor
;
898 struct gl_light EnabledList
; /**< List sentinel */
901 * Derived state for optimizations:
904 GLboolean _NeedEyeCoords
;
905 GLboolean _NeedVertices
; /**< Use fast shader? */
906 GLbitfield _Flags
; /**< LIGHT_* flags, see above */
907 GLfloat _BaseColor
[2][3];
913 * Line attribute group (GL_LINE_BIT).
915 struct gl_line_attrib
917 GLboolean SmoothFlag
; /**< GL_LINE_SMOOTH enabled? */
918 GLboolean StippleFlag
; /**< GL_LINE_STIPPLE enabled? */
919 GLushort StipplePattern
; /**< Stipple pattern */
920 GLint StippleFactor
; /**< Stipple repeat factor */
921 GLfloat Width
; /**< Line width */
926 * Display list attribute group (GL_LIST_BIT).
928 struct gl_list_attrib
935 * Used by device drivers to hook new commands into display lists.
937 struct gl_list_instruction
940 void (*Execute
)( GLcontext
*ctx
, void *data
);
941 void (*Destroy
)( GLcontext
*ctx
, void *data
);
942 void (*Print
)( GLcontext
*ctx
, void *data
);
945 #define MAX_DLIST_EXT_OPCODES 16
948 * Used by device drivers to hook new commands into display lists.
950 struct gl_list_extensions
952 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
958 * Multisample attribute group (GL_MULTISAMPLE_BIT).
960 struct gl_multisample_attrib
963 GLboolean SampleAlphaToCoverage
;
964 GLboolean SampleAlphaToOne
;
965 GLboolean SampleCoverage
;
966 GLfloat SampleCoverageValue
;
967 GLboolean SampleCoverageInvert
;
972 * A pixelmap (see glPixelMap)
977 GLfloat Map
[MAX_PIXEL_MAP_TABLE
];
978 GLubyte Map8
[MAX_PIXEL_MAP_TABLE
]; /**< converted to 8-bit color */
983 * Collection of all pixelmaps
987 struct gl_pixelmap RtoR
; /**< i.e. GL_PIXEL_MAP_R_TO_R */
988 struct gl_pixelmap GtoG
;
989 struct gl_pixelmap BtoB
;
990 struct gl_pixelmap AtoA
;
991 struct gl_pixelmap ItoR
;
992 struct gl_pixelmap ItoG
;
993 struct gl_pixelmap ItoB
;
994 struct gl_pixelmap ItoA
;
995 struct gl_pixelmap ItoI
;
996 struct gl_pixelmap StoS
;
1001 * Pixel attribute group (GL_PIXEL_MODE_BIT).
1003 struct gl_pixel_attrib
1005 GLenum ReadBuffer
; /**< source buffer for glRead/CopyPixels() */
1007 /*--- Begin Pixel Transfer State ---*/
1008 /* Fields are in the order in which they're applied... */
1010 /* Scale & Bias (index shift, offset) */
1011 GLfloat RedBias
, RedScale
;
1012 GLfloat GreenBias
, GreenScale
;
1013 GLfloat BlueBias
, BlueScale
;
1014 GLfloat AlphaBias
, AlphaScale
;
1015 GLfloat DepthBias
, DepthScale
;
1016 GLint IndexShift
, IndexOffset
;
1019 /* Note: actual pixel maps are not part of this attrib group */
1020 GLboolean MapColorFlag
;
1021 GLboolean MapStencilFlag
;
1023 /* There are multiple color table stages: */
1024 GLboolean ColorTableEnabled
[COLORTABLE_MAX
];
1025 GLfloat ColorTableScale
[COLORTABLE_MAX
][4]; /**< RGBA */
1026 GLfloat ColorTableBias
[COLORTABLE_MAX
][4]; /**< RGBA */
1028 /* Convolution (GL_EXT_convolution) */
1029 GLboolean Convolution1DEnabled
;
1030 GLboolean Convolution2DEnabled
;
1031 GLboolean Separable2DEnabled
;
1032 GLfloat ConvolutionBorderColor
[3][4];
1033 GLenum ConvolutionBorderMode
[3];
1034 GLfloat ConvolutionFilterScale
[3][4]; /**< RGBA */
1035 GLfloat ConvolutionFilterBias
[3][4]; /**< RGBA */
1036 GLfloat PostConvolutionScale
[4]; /**< RGBA */
1037 GLfloat PostConvolutionBias
[4]; /**< RGBA */
1039 /* Color matrix (GL_SGI_color_matrix) */
1040 /* Note: the color matrix is not part of this attrib group */
1041 GLfloat PostColorMatrixScale
[4]; /**< RGBA */
1042 GLfloat PostColorMatrixBias
[4]; /**< RGBA */
1044 /* Histogram & minmax (GL_EXT_histogram) */
1045 /* Note: histogram and minmax data are not part of this attrib group */
1046 GLboolean HistogramEnabled
;
1047 GLboolean MinMaxEnabled
;
1049 /*--- End Pixel Transfer State ---*/
1052 GLfloat ZoomX
, ZoomY
;
1054 /** GL_SGI_texture_color_table */
1055 GLfloat TextureColorTableScale
[4];
1056 GLfloat TextureColorTableBias
[4];
1061 * Point attribute group (GL_POINT_BIT).
1063 struct gl_point_attrib
1065 GLboolean SmoothFlag
; /**< True if GL_POINT_SMOOTH is enabled */
1066 GLfloat Size
; /**< User-specified point size */
1067 GLfloat Params
[3]; /**< GL_EXT_point_parameters */
1068 GLfloat MinSize
, MaxSize
; /**< GL_EXT_point_parameters */
1069 GLfloat Threshold
; /**< GL_EXT_point_parameters */
1070 GLboolean _Attenuated
; /**< True if Params != [1, 0, 0] */
1071 GLboolean PointSprite
; /**< GL_NV/ARB_point_sprite */
1072 GLboolean CoordReplace
[MAX_TEXTURE_COORD_UNITS
]; /**< GL_ARB_point_sprite */
1073 GLenum SpriteRMode
; /**< GL_NV_point_sprite (only!) */
1074 GLenum SpriteOrigin
; /**< GL_ARB_point_sprite */
1079 * Polygon attribute group (GL_POLYGON_BIT).
1081 struct gl_polygon_attrib
1083 GLenum FrontFace
; /**< Either GL_CW or GL_CCW */
1084 GLenum FrontMode
; /**< Either GL_POINT, GL_LINE or GL_FILL */
1085 GLenum BackMode
; /**< Either GL_POINT, GL_LINE or GL_FILL */
1086 GLboolean _FrontBit
; /**< 0=GL_CCW, 1=GL_CW */
1087 GLboolean CullFlag
; /**< Culling on/off flag */
1088 GLboolean SmoothFlag
; /**< True if GL_POLYGON_SMOOTH is enabled */
1089 GLboolean StippleFlag
; /**< True if GL_POLYGON_STIPPLE is enabled */
1090 GLenum CullFaceMode
; /**< Culling mode GL_FRONT or GL_BACK */
1091 GLfloat OffsetFactor
; /**< Polygon offset factor, from user */
1092 GLfloat OffsetUnits
; /**< Polygon offset units, from user */
1093 GLboolean OffsetPoint
; /**< Offset in GL_POINT mode */
1094 GLboolean OffsetLine
; /**< Offset in GL_LINE mode */
1095 GLboolean OffsetFill
; /**< Offset in GL_FILL mode */
1100 * Scissor attributes (GL_SCISSOR_BIT).
1102 struct gl_scissor_attrib
1104 GLboolean Enabled
; /**< Scissor test enabled? */
1105 GLint X
, Y
; /**< Lower left corner of box */
1106 GLsizei Width
, Height
; /**< Size of box */
1111 * Stencil attribute group (GL_STENCIL_BUFFER_BIT).
1113 struct gl_stencil_attrib
1115 GLboolean Enabled
; /**< Enabled flag */
1116 GLboolean TestTwoSide
; /**< GL_EXT_stencil_two_side */
1117 GLubyte ActiveFace
; /**< GL_EXT_stencil_two_side (0 or 1) */
1118 GLboolean _TestTwoSide
;
1119 GLenum Function
[2]; /**< Stencil function */
1120 GLenum FailFunc
[2]; /**< Fail function */
1121 GLenum ZPassFunc
[2]; /**< Depth buffer pass function */
1122 GLenum ZFailFunc
[2]; /**< Depth buffer fail function */
1123 GLint Ref
[2]; /**< Reference value */
1124 GLuint ValueMask
[2]; /**< Value mask */
1125 GLuint WriteMask
[2]; /**< Write mask */
1126 GLuint Clear
; /**< Clear value */
1130 #define NUM_TEXTURE_TARGETS 7 /* 1D, 2D, 3D, CUBE, RECT, 1D_STACK, and 2D_STACK */
1133 * An index for each type of texture object
1136 #define TEXTURE_1D_INDEX 0
1137 #define TEXTURE_2D_INDEX 1
1138 #define TEXTURE_3D_INDEX 2
1139 #define TEXTURE_CUBE_INDEX 3
1140 #define TEXTURE_RECT_INDEX 4
1141 #define TEXTURE_1D_ARRAY_INDEX 5
1142 #define TEXTURE_2D_ARRAY_INDEX 6
1146 * Bit flags for each type of texture object
1147 * Used for Texture.Unit[]._ReallyEnabled flags.
1150 #define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX)
1151 #define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX)
1152 #define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX)
1153 #define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX)
1154 #define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX)
1155 #define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX)
1156 #define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX)
1161 * TexGenEnabled flags.
1172 * Bit flag versions of the corresponding GL_ constants.
1175 #define TEXGEN_SPHERE_MAP 0x1
1176 #define TEXGEN_OBJ_LINEAR 0x2
1177 #define TEXGEN_EYE_LINEAR 0x4
1178 #define TEXGEN_REFLECTION_MAP_NV 0x8
1179 #define TEXGEN_NORMAL_MAP_NV 0x10
1181 #define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
1182 TEXGEN_REFLECTION_MAP_NV | \
1183 TEXGEN_NORMAL_MAP_NV)
1184 #define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
1185 TEXGEN_REFLECTION_MAP_NV | \
1186 TEXGEN_NORMAL_MAP_NV | \
1191 /* A selection of state flags to make driver and module's lives easier. */
1192 #define ENABLE_TEXGEN0 0x1
1193 #define ENABLE_TEXGEN1 0x2
1194 #define ENABLE_TEXGEN2 0x4
1195 #define ENABLE_TEXGEN3 0x8
1196 #define ENABLE_TEXGEN4 0x10
1197 #define ENABLE_TEXGEN5 0x20
1198 #define ENABLE_TEXGEN6 0x40
1199 #define ENABLE_TEXGEN7 0x80
1201 #define ENABLE_TEXMAT0 0x1 /* Ie. not the identity matrix */
1202 #define ENABLE_TEXMAT1 0x2
1203 #define ENABLE_TEXMAT2 0x4
1204 #define ENABLE_TEXMAT3 0x8
1205 #define ENABLE_TEXMAT4 0x10
1206 #define ENABLE_TEXMAT5 0x20
1207 #define ENABLE_TEXMAT6 0x40
1208 #define ENABLE_TEXMAT7 0x80
1210 #define ENABLE_TEXGEN(i) (ENABLE_TEXGEN0 << (i))
1211 #define ENABLE_TEXMAT(i) (ENABLE_TEXMAT0 << (i))
1215 * Texel fetch function prototype. We use texel fetch functions to
1216 * extract RGBA, color indexes and depth components out of 1D, 2D and 3D
1217 * texture images. These functions help to isolate us from the gritty
1218 * details of all the various texture image encodings.
1220 * \param texImage texture image.
1221 * \param col texel column.
1222 * \param row texel row.
1223 * \param img texel image level/layer.
1224 * \param texelOut output texel (up to 4 GLchans)
1226 typedef void (*FetchTexelFuncC
)( const struct gl_texture_image
*texImage
,
1227 GLint col
, GLint row
, GLint img
,
1231 * As above, but returns floats.
1232 * Used for depth component images and for upcoming signed/float
1235 typedef void (*FetchTexelFuncF
)( const struct gl_texture_image
*texImage
,
1236 GLint col
, GLint row
, GLint img
,
1237 GLfloat
*texelOut
);
1240 typedef void (*StoreTexelFunc
)(struct gl_texture_image
*texImage
,
1241 GLint col
, GLint row
, GLint img
,
1246 * This macro defines the (many) parameters to the texstore functions.
1247 * \param dims either 1 or 2 or 3
1248 * \param baseInternalFormat user-specified base internal format
1249 * \param dstFormat destination Mesa texture format
1250 * \param dstAddr destination image address
1251 * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels
1252 * \param dstRowStride destination image row stride, in bytes
1253 * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels
1254 * \param srcWidth/Height/Depth source image size, in pixels
1255 * \param srcFormat incoming image format
1256 * \param srcType incoming image data type
1257 * \param srcAddr source image address
1258 * \param srcPacking source image packing parameters
1260 #define TEXSTORE_PARAMS \
1261 GLcontext *ctx, GLuint dims, \
1262 GLenum baseInternalFormat, \
1263 const struct gl_texture_format *dstFormat, \
1265 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
1266 GLint dstRowStride, const GLuint *dstImageOffsets, \
1267 GLint srcWidth, GLint srcHeight, GLint srcDepth, \
1268 GLenum srcFormat, GLenum srcType, \
1269 const GLvoid *srcAddr, \
1270 const struct gl_pixelstore_attrib *srcPacking
1275 * Texture image storage function.
1277 typedef GLboolean (*StoreTexImageFunc
)(TEXSTORE_PARAMS
);
1281 * Texture format record
1283 struct gl_texture_format
1285 GLint MesaFormat
; /**< One of the MESA_FORMAT_* values */
1287 GLenum BaseFormat
; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
1288 * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
1289 * GL_INTENSITY, GL_COLOR_INDEX or
1290 * GL_DEPTH_COMPONENT.
1292 GLenum DataType
; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */
1295 * Bits per texel component. These are just rough approximations
1296 * for compressed texture formats.
1303 GLubyte LuminanceBits
;
1304 GLubyte IntensityBits
;
1307 GLubyte StencilBits
; /**< GL_EXT_packed_depth_stencil */
1310 GLuint TexelBytes
; /**< Bytes per texel, 0 if compressed format */
1312 StoreTexImageFunc StoreImage
;
1315 * \name Texel fetch function pointers
1318 FetchTexelFuncC FetchTexel1D
;
1319 FetchTexelFuncC FetchTexel2D
;
1320 FetchTexelFuncC FetchTexel3D
;
1321 FetchTexelFuncF FetchTexel1Df
;
1322 FetchTexelFuncF FetchTexel2Df
;
1323 FetchTexelFuncF FetchTexel3Df
;
1326 StoreTexelFunc StoreTexel
;
1331 * Texture image state. Describes the dimensions of a texture image,
1332 * the texel format and pointers to Texel Fetch functions.
1334 struct gl_texture_image
1336 GLenum _BaseFormat
; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
1337 * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
1338 * GL_INTENSITY, GL_COLOR_INDEX,
1339 * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT
1340 * only. Used for choosing TexEnv arithmetic.
1342 GLint InternalFormat
; /**< Internal format as given by the user */
1343 GLuint Border
; /**< 0 or 1 */
1344 GLuint Width
; /**< = 2^WidthLog2 + 2*Border */
1345 GLuint Height
; /**< = 2^HeightLog2 + 2*Border */
1346 GLuint Depth
; /**< = 2^DepthLog2 + 2*Border */
1347 GLuint Width2
; /**< = Width - 2*Border */
1348 GLuint Height2
; /**< = Height - 2*Border */
1349 GLuint Depth2
; /**< = Depth - 2*Border */
1350 GLuint WidthLog2
; /**< = log2(Width2) */
1351 GLuint HeightLog2
; /**< = log2(Height2) */
1352 GLuint DepthLog2
; /**< = log2(Depth2) */
1353 GLuint MaxLog2
; /**< = MAX(WidthLog2, HeightLog2) */
1354 GLfloat WidthScale
; /**< used for mipmap LOD computation */
1355 GLfloat HeightScale
; /**< used for mipmap LOD computation */
1356 GLfloat DepthScale
; /**< used for mipmap LOD computation */
1357 GLboolean IsClientData
; /**< Data owned by client? */
1358 GLboolean _IsPowerOfTwo
; /**< Are all dimensions powers of two? */
1360 const struct gl_texture_format
*TexFormat
;
1362 struct gl_texture_object
*TexObject
; /**< Pointer back to parent object */
1364 FetchTexelFuncC FetchTexelc
; /**< GLchan texel fetch function pointer */
1365 FetchTexelFuncF FetchTexelf
; /**< Float texel fetch function pointer */
1367 GLboolean IsCompressed
; /**< GL_ARB_texture_compression */
1368 GLuint CompressedSize
; /**< GL_ARB_texture_compression */
1370 GLuint RowStride
; /**< == Width unless IsClientData and padded */
1371 GLuint
*ImageOffsets
; /**< if 3D texture: array [Depth] of offsets to
1372 each 2D slice in 'Data', in texels */
1373 GLvoid
*Data
; /**< Image data, accessed via FetchTexel() */
1376 * \name For device driver:
1379 void *DriverData
; /**< Arbitrary device driver data */
1385 * Indexes for cube map faces.
1388 #define FACE_POS_X 0
1389 #define FACE_NEG_X 1
1390 #define FACE_POS_Y 2
1391 #define FACE_NEG_Y 3
1392 #define FACE_POS_Z 4
1393 #define FACE_NEG_Z 5
1399 * Texture object state. Contains the array of mipmap images, border color,
1400 * wrap modes, filter modes, shadow/texcompare state, and the per-texture
1403 struct gl_texture_object
1405 GLint RefCount
; /**< reference count */
1406 GLuint Name
; /**< the user-visible texture object ID */
1407 GLenum Target
; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */
1408 GLfloat Priority
; /**< in [0,1] */
1409 GLfloat BorderColor
[4]; /**< unclamped */
1410 GLchan _BorderChan
[4]; /**< clamped, as GLchan */
1411 GLenum WrapS
; /**< S-axis texture image wrap mode */
1412 GLenum WrapT
; /**< T-axis texture image wrap mode */
1413 GLenum WrapR
; /**< R-axis texture image wrap mode */
1414 GLenum MinFilter
; /**< minification filter */
1415 GLenum MagFilter
; /**< magnification filter */
1416 GLfloat MinLod
; /**< min lambda, OpenGL 1.2 */
1417 GLfloat MaxLod
; /**< max lambda, OpenGL 1.2 */
1418 GLfloat LodBias
; /**< OpenGL 1.4 */
1419 GLint BaseLevel
; /**< min mipmap level, OpenGL 1.2 */
1420 GLint MaxLevel
; /**< max mipmap level, OpenGL 1.2 */
1421 GLfloat MaxAnisotropy
; /**< GL_EXT_texture_filter_anisotropic */
1422 GLboolean CompareFlag
; /**< GL_SGIX_shadow */
1423 GLenum CompareOperator
; /**< GL_SGIX_shadow */
1424 GLfloat ShadowAmbient
; /**< GL_ARB_shadow_ambient */
1425 GLenum CompareMode
; /**< GL_ARB_shadow */
1426 GLenum CompareFunc
; /**< GL_ARB_shadow */
1427 GLenum _Function
; /**< Comparison function derived from
1428 * \c CompareOperator, \c CompareMode, and
1431 GLenum DepthMode
; /**< GL_ARB_depth_texture */
1432 GLint _MaxLevel
; /**< actual max mipmap level (q in the spec) */
1433 GLfloat _MaxLambda
; /**< = _MaxLevel - BaseLevel (q - b in spec) */
1434 GLboolean GenerateMipmap
; /**< GL_SGIS_generate_mipmap */
1435 GLboolean _Complete
; /**< Is texture object complete? */
1437 /** Actual texture images, indexed by [cube face] and [mipmap level] */
1438 struct gl_texture_image
*Image
[MAX_FACES
][MAX_TEXTURE_LEVELS
];
1440 /** GL_EXT_paletted_texture */
1441 struct gl_color_table Palette
;
1445 * \name For device driver.
1446 * Note: instead of attaching driver data to this pointer, it's preferable
1447 * to instead use this struct as a base class for your own texture object
1448 * class. Driver->NewTextureObject() can be used to implement the
1451 void *DriverData
; /**< Arbitrary device driver data */
1456 * Texture combine environment state.
1459 * If GL_NV_texture_env_combine4 is ever supported, the arrays in this
1460 * structure will need to be expanded for 4 elements.
1462 struct gl_tex_env_combine_state
1464 GLenum ModeRGB
; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
1465 GLenum ModeA
; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */
1466 GLenum SourceRGB
[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
1467 GLenum SourceA
[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */
1468 GLenum OperandRGB
[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */
1469 GLenum OperandA
[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */
1470 GLuint ScaleShiftRGB
; /**< 0, 1 or 2 */
1471 GLuint ScaleShiftA
; /**< 0, 1 or 2 */
1472 GLuint _NumArgsRGB
; /**< Number of inputs used for the combine mode. */
1473 GLuint _NumArgsA
; /**< Number of inputs used for the combine mode. */
1478 * Texture unit state. Contains enable flags, texture environment/function/
1479 * combiners, texgen state, pointers to current texture objects and
1480 * post-filter color tables.
1482 struct gl_texture_unit
1484 GLbitfield Enabled
; /**< bitmask of TEXTURE_*_BIT flags */
1485 GLbitfield _ReallyEnabled
; /**< 0 or exactly one of TEXTURE_*_BIT flags */
1487 GLenum EnvMode
; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */
1488 GLfloat EnvColor
[4];
1489 GLbitfield TexGenEnabled
; /**< Bitwise-OR of [STRQ]_BIT values */
1490 /** \name Tex coord generation mode
1491 * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */
1498 GLbitfield _GenBitS
;
1499 GLbitfield _GenBitT
;
1500 GLbitfield _GenBitR
;
1501 GLbitfield _GenBitQ
;
1502 GLbitfield _GenFlags
; /**< bitwise or of _GenBit[STRQ] */
1503 GLfloat ObjectPlaneS
[4];
1504 GLfloat ObjectPlaneT
[4];
1505 GLfloat ObjectPlaneR
[4];
1506 GLfloat ObjectPlaneQ
[4];
1507 GLfloat EyePlaneS
[4];
1508 GLfloat EyePlaneT
[4];
1509 GLfloat EyePlaneR
[4];
1510 GLfloat EyePlaneQ
[4];
1511 GLfloat LodBias
; /**< for biasing mipmap levels */
1514 * \name GL_EXT_texture_env_combine
1516 struct gl_tex_env_combine_state Combine
;
1519 * Derived state based on \c EnvMode and the \c BaseFormat of the
1520 * currently enabled texture.
1522 struct gl_tex_env_combine_state _EnvMode
;
1525 * Currently enabled combiner state. This will point to either
1526 * \c Combine or \c _EnvMode.
1528 struct gl_tex_env_combine_state
*_CurrentCombine
;
1530 struct gl_texture_object
*Current1D
;
1531 struct gl_texture_object
*Current2D
;
1532 struct gl_texture_object
*Current3D
;
1533 struct gl_texture_object
*CurrentCubeMap
; /**< GL_ARB_texture_cube_map */
1534 struct gl_texture_object
*CurrentRect
; /**< GL_NV_texture_rectangle */
1535 struct gl_texture_object
*Current1DArray
; /**< GL_MESA_texture_array */
1536 struct gl_texture_object
*Current2DArray
; /**< GL_MESA_texture_array */
1538 struct gl_texture_object
*_Current
; /**< Points to really enabled tex obj */
1540 /** These are used for glPush/PopAttrib */
1542 struct gl_texture_object Saved1D
;
1543 struct gl_texture_object Saved2D
;
1544 struct gl_texture_object Saved3D
;
1545 struct gl_texture_object SavedCubeMap
;
1546 struct gl_texture_object SavedRect
;
1547 struct gl_texture_object Saved1DArray
;
1548 struct gl_texture_object Saved2DArray
;
1551 /** GL_SGI_texture_color_table */
1553 struct gl_color_table ColorTable
;
1554 struct gl_color_table ProxyColorTable
;
1555 GLboolean ColorTableEnabled
;
1559 struct texenvprog_cache_item
{
1562 struct gl_fragment_program
*data
;
1563 struct texenvprog_cache_item
*next
;
1566 struct texenvprog_cache
{
1567 struct texenvprog_cache_item
**items
;
1568 GLuint size
, n_items
;
1572 * Texture attribute group (GL_TEXTURE_BIT).
1574 struct gl_texture_attrib
1580 GLuint CurrentUnit
; /**< Active texture unit */
1581 GLbitfield _EnabledUnits
; /**< one bit set for each really-enabled unit */
1582 GLbitfield _EnabledCoordUnits
; /**< one bit per enabled coordinate unit */
1583 GLbitfield _GenFlags
; /**< for texgen */
1584 GLbitfield _TexGenEnabled
;
1585 GLbitfield _TexMatEnabled
;
1588 struct gl_texture_unit Unit
[MAX_TEXTURE_UNITS
];
1590 struct gl_texture_object
*Proxy1D
;
1591 struct gl_texture_object
*Proxy2D
;
1592 struct gl_texture_object
*Proxy3D
;
1593 struct gl_texture_object
*ProxyCubeMap
;
1594 struct gl_texture_object
*ProxyRect
;
1595 struct gl_texture_object
*Proxy1DArray
;
1596 struct gl_texture_object
*Proxy2DArray
;
1598 /** GL_EXT_shared_texture_palette */
1599 GLboolean SharedPalette
;
1600 struct gl_color_table Palette
;
1602 /** Cached texenv fragment programs */
1603 struct texenvprog_cache env_fp_cache
;
1608 * Transformation attribute group (GL_TRANSFORM_BIT).
1610 struct gl_transform_attrib
1612 GLenum MatrixMode
; /**< Matrix mode */
1613 GLfloat EyeUserPlane
[MAX_CLIP_PLANES
][4]; /**< User clip planes */
1614 GLfloat _ClipUserPlane
[MAX_CLIP_PLANES
][4]; /**< derived */
1615 GLbitfield ClipPlanesEnabled
; /**< on/off bitmask */
1616 GLboolean Normalize
; /**< Normalize all normals? */
1617 GLboolean RescaleNormals
; /**< GL_EXT_rescale_normal */
1618 GLboolean RasterPositionUnclipped
; /**< GL_IBM_rasterpos_clip */
1620 GLboolean CullVertexFlag
; /**< True if GL_CULL_VERTEX_EXT is enabled */
1621 GLfloat CullEyePos
[4];
1622 GLfloat CullObjPos
[4];
1627 * Viewport attribute group (GL_VIEWPORT_BIT).
1629 struct gl_viewport_attrib
1631 GLint X
, Y
; /**< position */
1632 GLsizei Width
, Height
; /**< size */
1633 GLfloat Near
, Far
; /**< Depth buffer range */
1634 GLmatrix _WindowMap
; /**< Mapping transformation as a matrix. */
1639 * Node for the attribute stack.
1641 struct gl_attrib_node
1645 struct gl_attrib_node
*next
;
1650 * GL_ARB_vertex/pixel_buffer_object buffer object
1652 struct gl_buffer_object
1658 GLvoid
*Pointer
; /**< Only valid while buffer is mapped */
1659 GLsizeiptrARB Size
; /**< Size of storage in bytes */
1660 GLubyte
*Data
; /**< Location of storage either in RAM or VRAM. */
1661 GLboolean OnCard
; /**< Is buffer in VRAM? (hardware drivers) */
1667 * Client pixel packing/unpacking attributes
1669 struct gl_pixelstore_attrib
1675 GLint ImageHeight
; /**< for GL_EXT_texture3D */
1676 GLint SkipImages
; /**< for GL_EXT_texture3D */
1677 GLboolean SwapBytes
;
1679 GLboolean ClientStorage
; /**< GL_APPLE_client_storage */
1680 GLboolean Invert
; /**< GL_MESA_pack_invert */
1681 struct gl_buffer_object
*BufferObj
; /**< GL_ARB_pixel_buffer_object */
1687 * Client vertex array attributes
1689 struct gl_client_array
1691 GLint Size
; /**< components per element (1,2,3,4) */
1692 GLenum Type
; /**< datatype: GL_FLOAT, GL_INT, etc */
1693 GLsizei Stride
; /**< user-specified stride */
1694 GLsizei StrideB
; /**< actual stride in bytes */
1695 const GLubyte
*Ptr
; /**< Points to array data */
1696 GLboolean Enabled
; /**< Enabled flag is a boolean */
1697 GLboolean Normalized
; /**< GL_ARB_vertex_program */
1699 /**< GL_ARB_vertex_buffer_object */
1700 struct gl_buffer_object
*BufferObj
;
1706 * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object
1707 * extension, but a nice encapsulation in any case.
1709 struct gl_array_object
1711 /** Name of the array object as received from glGenVertexArrayAPPLE. */
1714 /** Conventional vertex arrays */
1716 struct gl_client_array Vertex
;
1717 struct gl_client_array Normal
;
1718 struct gl_client_array Color
;
1719 struct gl_client_array SecondaryColor
;
1720 struct gl_client_array FogCoord
;
1721 struct gl_client_array Index
;
1722 struct gl_client_array EdgeFlag
;
1723 struct gl_client_array TexCoord
[MAX_TEXTURE_COORD_UNITS
];
1726 /** Generic arrays for vertex programs/shaders */
1727 struct gl_client_array VertexAttrib
[VERT_ATTRIB_MAX
];
1729 /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */
1730 GLbitfield _Enabled
;
1735 * Vertex array state
1737 struct gl_array_attrib
1739 struct gl_array_object
*ArrayObj
;
1740 struct gl_array_object
*DefaultArrayObj
;
1742 GLint ActiveTexture
; /**< Client Active Texture */
1743 GLuint LockFirst
; /**< GL_EXT_compiled_vertex_array */
1744 GLuint LockCount
; /**< GL_EXT_compiled_vertex_array */
1746 GLbitfield NewState
; /**< mask of _NEW_ARRAY_* values */
1748 #if FEATURE_ARB_vertex_buffer_object
1749 struct gl_buffer_object
*NullBufferObj
;
1750 struct gl_buffer_object
*ArrayBufferObj
;
1751 struct gl_buffer_object
*ElementArrayBufferObj
;
1753 GLuint _MaxElement
; /* Min of all enabled array's maxes */
1758 * Feedback buffer state
1763 GLbitfield _Mask
; /* FB_* bits */
1771 * Selection buffer state
1775 GLuint
*Buffer
; /**< selection buffer */
1776 GLuint BufferSize
; /**< size of the selection buffer */
1777 GLuint BufferCount
; /**< number of values in the selection buffer */
1778 GLuint Hits
; /**< number of records in the selection buffer */
1779 GLuint NameStackDepth
; /**< name stack depth */
1780 GLuint NameStack
[MAX_NAME_STACK_DEPTH
]; /**< name stack */
1781 GLboolean HitFlag
; /**< hit flag */
1782 GLfloat HitMinZ
; /**< minimum hit depth */
1783 GLfloat HitMaxZ
; /**< maximum hit depth */
1788 * 1-D Evaluator control points
1792 GLuint Order
; /**< Number of control points */
1793 GLfloat u1
, u2
, du
; /**< u1, u2, 1.0/(u2-u1) */
1794 GLfloat
*Points
; /**< Points to contiguous control points */
1799 * 2-D Evaluator control points
1803 GLuint Uorder
; /**< Number of control points in U dimension */
1804 GLuint Vorder
; /**< Number of control points in V dimension */
1807 GLfloat
*Points
; /**< Points to contiguous control points */
1812 * All evaluator control point state
1814 struct gl_evaluators
1820 struct gl_1d_map Map1Vertex3
;
1821 struct gl_1d_map Map1Vertex4
;
1822 struct gl_1d_map Map1Index
;
1823 struct gl_1d_map Map1Color4
;
1824 struct gl_1d_map Map1Normal
;
1825 struct gl_1d_map Map1Texture1
;
1826 struct gl_1d_map Map1Texture2
;
1827 struct gl_1d_map Map1Texture3
;
1828 struct gl_1d_map Map1Texture4
;
1829 struct gl_1d_map Map1Attrib
[16]; /**< GL_NV_vertex_program */
1836 struct gl_2d_map Map2Vertex3
;
1837 struct gl_2d_map Map2Vertex4
;
1838 struct gl_2d_map Map2Index
;
1839 struct gl_2d_map Map2Color4
;
1840 struct gl_2d_map Map2Normal
;
1841 struct gl_2d_map Map2Texture1
;
1842 struct gl_2d_map Map2Texture2
;
1843 struct gl_2d_map Map2Texture3
;
1844 struct gl_2d_map Map2Texture4
;
1845 struct gl_2d_map Map2Attrib
[16]; /**< GL_NV_vertex_program */
1851 * Names of the various vertex/fragment program register files, etc.
1853 * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
1854 * All values should fit in a 4-bit field.
1856 * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM,
1857 * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to
1858 * be "uniform" variables since they can only be set outside glBegin/End.
1859 * They're also all stored in the same Parameters array.
1863 PROGRAM_TEMPORARY
= 0, /**< machine->Temporary[] */
1864 PROGRAM_LOCAL_PARAM
= 1, /**< gl_program->LocalParams[] */
1865 PROGRAM_ENV_PARAM
= 2, /**< gl_program->Parameters[] */
1866 PROGRAM_STATE_VAR
= 3, /**< gl_program->Parameters[] */
1867 PROGRAM_INPUT
= 4, /**< machine->Inputs[] */
1868 PROGRAM_OUTPUT
= 5, /**< machine->Outputs[] */
1869 PROGRAM_NAMED_PARAM
= 6, /**< gl_program->Parameters[] */
1870 PROGRAM_CONSTANT
= 7, /**< gl_program->Parameters[] */
1871 PROGRAM_UNIFORM
= 8, /**< gl_program->Parameters[] */
1872 PROGRAM_VARYING
= 9, /**< machine->Inputs[]/Outputs[] */
1873 PROGRAM_WRITE_ONLY
= 10, /**< A dummy, write-only register */
1874 PROGRAM_ADDRESS
= 11, /**< machine->AddressReg */
1875 PROGRAM_SAMPLER
= 12, /**< for shader samplers, compile-time only */
1876 PROGRAM_UNDEFINED
= 13, /**< Invalid value */
1881 /** Vertex and fragment instructions */
1882 struct prog_instruction
;
1883 struct gl_program_parameter_list
;
1887 * Base class for any kind of program object
1892 GLubyte
*String
; /**< Null-terminated program text */
1894 GLenum Target
; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */
1895 GLenum Format
; /**< String encoding format */
1898 struct prog_instruction
*Instructions
;
1900 GLbitfield InputsRead
; /**< Bitmask of which input regs are read */
1901 GLbitfield OutputsWritten
; /**< Bitmask of which output regs are written to */
1902 GLbitfield TexturesUsed
[MAX_TEXTURE_IMAGE_UNITS
]; /**< TEXTURE_x_BIT bitmask */
1903 GLbitfield SamplersUsed
; /**< Bitfield of which samplers are used */
1904 GLbitfield ShadowSamplers
; /**< Texture units used for shadow sampling. */
1906 /** Named parameters, constants, etc. from program text */
1907 struct gl_program_parameter_list
*Parameters
;
1908 /** Numbered local parameters */
1909 GLfloat LocalParams
[MAX_PROGRAM_LOCAL_PARAMS
][4];
1911 /** Vertex/fragment shader varying vars */
1912 struct gl_program_parameter_list
*Varying
;
1913 /** Vertex program user-defined attributes */
1914 struct gl_program_parameter_list
*Attributes
;
1916 /** Map from sampler unit to texture unit (set by glUniform1i()) */
1917 GLubyte SamplerUnits
[MAX_SAMPLERS
];
1918 /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */
1919 GLubyte SamplerTargets
[MAX_SAMPLERS
];
1921 /** Logical counts */
1923 GLuint NumInstructions
;
1924 GLuint NumTemporaries
;
1925 GLuint NumParameters
;
1926 GLuint NumAttributes
;
1927 GLuint NumAddressRegs
;
1928 GLuint NumAluInstructions
;
1929 GLuint NumTexInstructions
;
1930 GLuint NumTexIndirections
;
1932 /** Native, actual h/w counts */
1934 GLuint NumNativeInstructions
;
1935 GLuint NumNativeTemporaries
;
1936 GLuint NumNativeParameters
;
1937 GLuint NumNativeAttributes
;
1938 GLuint NumNativeAddressRegs
;
1939 GLuint NumNativeAluInstructions
;
1940 GLuint NumNativeTexInstructions
;
1941 GLuint NumNativeTexIndirections
;
1946 /** Vertex program object */
1947 struct gl_vertex_program
1949 struct gl_program Base
; /**< base class */
1950 GLboolean IsNVProgram
; /**< is this a GL_NV_vertex_program program? */
1951 GLboolean IsPositionInvariant
;
1952 void *TnlData
; /**< should probably use Base.DriverData */
1956 /** Fragment program object */
1957 struct gl_fragment_program
1959 struct gl_program Base
; /**< base class */
1966 * State common to vertex and fragment programs.
1968 struct gl_program_state
1970 GLint ErrorPos
; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */
1971 const char *ErrorString
; /* GL_PROGRAM_ERROR_STRING_ARB/NV */
1976 * Context state for vertex programs.
1978 struct gl_vertex_program_state
1980 GLboolean Enabled
; /**< GL_VERTEX_PROGRAM_ARB/NV */
1981 GLboolean _Enabled
; /**< Enabled and valid program? */
1982 GLboolean PointSizeEnabled
; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
1983 GLboolean TwoSideEnabled
; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
1984 struct gl_vertex_program
*Current
; /**< user-bound vertex program */
1986 /** Currently enabled and valid program (including internal programs
1987 * and compiled shader programs).
1989 struct gl_vertex_program
*_Current
;
1991 GLfloat Parameters
[MAX_PROGRAM_ENV_PARAMS
][4]; /**< Env params */
1993 /* For GL_NV_vertex_program only: */
1994 GLenum TrackMatrix
[MAX_PROGRAM_ENV_PARAMS
/ 4];
1995 GLenum TrackMatrixTransform
[MAX_PROGRAM_ENV_PARAMS
/ 4];
1997 /** Should fixed-function T&L be implemented with a vertex prog? */
1998 GLboolean _MaintainTnlProgram
;
2000 /** Program to emulate fixed-function T&L (see above) */
2001 struct gl_vertex_program
*_TnlProgram
;
2003 #if FEATURE_MESA_program_debug
2004 GLprogramcallbackMESA Callback
;
2005 GLvoid
*CallbackData
;
2006 GLboolean CallbackEnabled
;
2007 GLuint CurrentPosition
;
2013 * Context state for fragment programs.
2015 struct gl_fragment_program_state
2017 GLboolean Enabled
; /**< User-set fragment program enable flag */
2018 GLboolean _Enabled
; /**< Fragment program enabled and valid? */
2020 struct gl_fragment_program
*Current
; /**< User-bound fragment program */
2022 /** Currently enabled and valid program (including internal programs
2023 * and compiled shader programs).
2025 struct gl_fragment_program
*_Current
;
2027 GLfloat Parameters
[MAX_PROGRAM_ENV_PARAMS
][4]; /**< Env params */
2029 /** Should fixed-function texturing be implemented with a fragment prog? */
2030 GLboolean _MaintainTexEnvProgram
;
2031 GLboolean _UseTexEnvProgram
;
2033 /** Program to emulate fixed-function texture env/combine (see above) */
2034 struct gl_fragment_program
*_TexEnvProgram
;
2036 #if FEATURE_MESA_program_debug
2037 GLprogramcallbackMESA Callback
;
2038 GLvoid
*CallbackData
;
2039 GLboolean CallbackEnabled
;
2040 GLuint CurrentPosition
;
2046 * ATI_fragment_shader runtime state
2048 #define ATI_FS_INPUT_PRIMARY 0
2049 #define ATI_FS_INPUT_SECONDARY 1
2051 struct atifs_instruction
;
2052 struct atifs_setupinst
;
2055 * ATI fragment shader
2057 struct ati_fragment_shader
2061 struct atifs_instruction
*Instructions
[2];
2062 struct atifs_setupinst
*SetupInst
[2];
2063 GLfloat Constants
[8][4];
2064 GLbitfield LocalConstDef
; /** Indicates which constants have been set */
2065 GLubyte numArithInstr
[2];
2066 GLubyte regsAssigned
[2];
2067 GLubyte NumPasses
; /** 1 or 2 */
2069 GLubyte last_optype
;
2070 GLboolean interpinp1
;
2076 * Context state for GL_ATI_fragment_shader
2078 struct gl_ati_fragment_shader_state
2081 GLboolean _Enabled
; /** enabled and valid shader? */
2082 GLboolean Compiling
;
2083 GLfloat GlobalConstants
[8][4];
2084 struct ati_fragment_shader
*Current
;
2089 * Occlusion/timer query object.
2091 struct gl_query_object
2093 GLenum Target
; /**< The query target, when active */
2094 GLuint Id
; /**< hash table ID/name */
2095 GLuint64EXT Result
; /**< the counter */
2096 GLboolean Active
; /**< inside Begin/EndQuery */
2097 GLboolean Ready
; /**< result is ready? */
2102 * Context state for query objects.
2104 struct gl_query_state
2106 struct _mesa_HashTable
*QueryObjects
;
2107 struct gl_query_object
*CurrentOcclusionObject
; /* GL_ARB_occlusion_query */
2108 struct gl_query_object
*CurrentTimerObject
; /* GL_EXT_timer_query */
2114 * A GLSL shader object.
2118 GLenum Type
; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER (first field!) */
2119 GLuint Name
; /**< AKA the handle */
2120 GLint RefCount
; /**< Reference count */
2121 GLboolean DeletePending
;
2123 const GLchar
*Source
; /**< Source code string */
2124 GLboolean CompileStatus
;
2125 GLuint NumPrograms
; /**< size of Programs[] array */
2126 struct gl_program
**Programs
; /**< Post-compile assembly code */
2132 * A GLSL program object. Basically a linked collection of "shaders".
2134 struct gl_shader_program
2136 GLenum Type
; /**< Always GL_SHADER_PROGRAM (internal token) */
2137 GLuint Name
; /**< aka handle or ID */
2138 GLint RefCount
; /**< Reference count */
2139 GLboolean DeletePending
;
2141 GLuint NumShaders
; /**< number of attached shaders */
2142 struct gl_shader
**Shaders
; /**< List of attached the shaders */
2144 /* post-link info: */
2145 struct gl_vertex_program
*VertexProgram
; /**< Linked vertex program */
2146 struct gl_fragment_program
*FragmentProgram
; /**< Linked fragment prog */
2147 struct gl_program_parameter_list
*Uniforms
; /**< Plus constants, etc */
2148 struct gl_program_parameter_list
*Varying
;
2149 struct gl_program_parameter_list
*Attributes
; /**< Vertex attributes */
2150 GLboolean LinkStatus
; /**< GL_LINK_STATUS */
2151 GLboolean Validated
;
2157 * Context state for GLSL vertex/fragment shaders.
2159 struct gl_shader_state
2161 struct gl_shader_program
*CurrentProgram
; /**< The user-bound program */
2162 /** Driver-selectable options: */
2163 GLboolean EmitHighLevelInstructions
; /**< IF/ELSE/ENDIF vs. BRA, etc. */
2164 GLboolean EmitCondCodes
; /**< Use condition codes? */
2165 GLboolean EmitComments
; /**< Annotated instructions */
2171 * State which can be shared by multiple contexts:
2173 struct gl_shared_state
2175 _glthread_Mutex Mutex
; /**< for thread safety */
2176 GLint RefCount
; /**< Reference count */
2177 struct _mesa_HashTable
*DisplayList
; /**< Display lists hash table */
2178 struct _mesa_HashTable
*TexObjects
; /**< Texture objects hash table */
2181 * \name Default texture objects (shared by all multi-texture units)
2184 struct gl_texture_object
*Default1D
;
2185 struct gl_texture_object
*Default2D
;
2186 struct gl_texture_object
*Default3D
;
2187 struct gl_texture_object
*DefaultCubeMap
;
2188 struct gl_texture_object
*DefaultRect
;
2189 struct gl_texture_object
*Default1DArray
;
2190 struct gl_texture_object
*Default2DArray
;
2194 * \name Thread safety and statechange notification for texture
2197 * \todo Improve the granularity of locking.
2200 _glthread_Mutex TexMutex
; /**< texobj thread safety */
2201 GLuint TextureStateStamp
; /**< state notification for shared tex */
2206 * \name Vertex/fragment programs
2209 struct _mesa_HashTable
*Programs
; /**< All vertex/fragment programs */
2210 #if FEATURE_ARB_vertex_program
2211 struct gl_program
*DefaultVertexProgram
;
2213 #if FEATURE_ARB_fragment_program
2214 struct gl_program
*DefaultFragmentProgram
;
2218 #if FEATURE_ATI_fragment_shader
2219 struct _mesa_HashTable
*ATIShaders
;
2220 struct ati_fragment_shader
*DefaultFragmentShader
;
2223 #if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
2224 struct _mesa_HashTable
*BufferObjects
;
2227 #if FEATURE_ARB_shader_objects
2228 /** Table of both gl_shader and gl_shader_program objects */
2229 struct _mesa_HashTable
*ShaderObjects
;
2232 #if FEATURE_EXT_framebuffer_object
2233 struct _mesa_HashTable
*RenderBuffers
;
2234 struct _mesa_HashTable
*FrameBuffers
;
2237 /** Objects associated with the GL_APPLE_vertex_array_object extension. */
2238 struct _mesa_HashTable
*ArrayObjects
;
2240 void *DriverData
; /**< Device driver shared state */
2247 * A renderbuffer stores colors or depth values or stencil values.
2248 * A framebuffer object will have a collection of these.
2249 * Data are read/written to the buffer with a handful of Get/Put functions.
2251 * Instances of this object are allocated with the Driver's NewRenderbuffer
2252 * hook. Drivers will likely wrap this class inside a driver-specific
2253 * class to simulate inheritance.
2255 struct gl_renderbuffer
2257 #define RB_MAGIC 0xaabbccdd
2258 int Magic
; /** XXX TEMPORARY DEBUG INFO */
2259 _glthread_Mutex Mutex
; /**< for thread safety */
2260 GLuint ClassID
; /**< Useful for drivers */
2263 GLuint Width
, Height
;
2264 GLenum InternalFormat
; /**< The user-specified format */
2265 GLenum _ActualFormat
; /**< The driver-chosen format */
2266 GLenum _BaseFormat
; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
2267 GL_STENCIL_INDEX. */
2268 GLenum DataType
; /**< Type of values passed to the Get/Put functions */
2269 GLubyte RedBits
; /**< Bits of red per pixel */
2275 GLubyte StencilBits
;
2276 GLvoid
*Data
; /**< This may not be used by some kinds of RBs */
2278 /* Used to wrap one renderbuffer around another: */
2279 struct gl_renderbuffer
*Wrapped
;
2281 /* Delete this renderbuffer */
2282 void (*Delete
)(struct gl_renderbuffer
*rb
);
2284 /* Allocate new storage for this renderbuffer */
2285 GLboolean (*AllocStorage
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
,
2286 GLenum internalFormat
,
2287 GLuint width
, GLuint height
);
2289 /* Lock/Unlock are called before/after calling the Get/Put functions.
2290 * Not sure this is the right place for these yet.
2291 void (*Lock)(GLcontext *ctx, struct gl_renderbuffer *rb);
2292 void (*Unlock)(GLcontext *ctx, struct gl_renderbuffer *rb);
2295 /* Return a pointer to the element/pixel at (x,y).
2296 * Should return NULL if the buffer memory can't be directly addressed.
2298 void *(*GetPointer
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
,
2301 /* Get/Read a row of values.
2302 * The values will be of format _BaseFormat and type DataType.
2304 void (*GetRow
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2305 GLint x
, GLint y
, void *values
);
2307 /* Get/Read values at arbitrary locations.
2308 * The values will be of format _BaseFormat and type DataType.
2310 void (*GetValues
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2311 const GLint x
[], const GLint y
[], void *values
);
2313 /* Put/Write a row of values.
2314 * The values will be of format _BaseFormat and type DataType.
2316 void (*PutRow
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2317 GLint x
, GLint y
, const void *values
, const GLubyte
*mask
);
2319 /* Put/Write a row of RGB values. This is a special-case routine that's
2320 * only used for RGBA renderbuffers when the source data is GL_RGB. That's
2321 * a common case for glDrawPixels and some triangle routines.
2322 * The values will be of format GL_RGB and type DataType.
2324 void (*PutRowRGB
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2325 GLint x
, GLint y
, const void *values
, const GLubyte
*mask
);
2328 /* Put/Write a row of identical values.
2329 * The values will be of format _BaseFormat and type DataType.
2331 void (*PutMonoRow
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2332 GLint x
, GLint y
, const void *value
, const GLubyte
*mask
);
2334 /* Put/Write values at arbitrary locations.
2335 * The values will be of format _BaseFormat and type DataType.
2337 void (*PutValues
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
, GLuint count
,
2338 const GLint x
[], const GLint y
[], const void *values
,
2339 const GLubyte
*mask
);
2340 /* Put/Write identical values at arbitrary locations.
2341 * The values will be of format _BaseFormat and type DataType.
2343 void (*PutMonoValues
)(GLcontext
*ctx
, struct gl_renderbuffer
*rb
,
2344 GLuint count
, const GLint x
[], const GLint y
[],
2345 const void *value
, const GLubyte
*mask
);
2350 * A renderbuffer attachment point points to either a texture object
2351 * (and specifies a mipmap level, cube face or 3D texture slice) or
2352 * points to a renderbuffer.
2354 struct gl_renderbuffer_attachment
2356 GLenum Type
; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */
2360 * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the
2361 * application supplied renderbuffer object.
2363 struct gl_renderbuffer
*Renderbuffer
;
2366 * If \c Type is \c GL_TEXTURE, this stores a pointer to the application
2367 * supplied texture object.
2369 struct gl_texture_object
*Texture
;
2370 GLuint TextureLevel
; /**< Attached mipmap level. */
2371 GLuint CubeMapFace
; /**< 0 .. 5, for cube map textures. */
2372 GLuint Zoffset
; /**< Slice for 3D textures, or layer for both 1D
2373 * and 2D array textures */
2378 * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc).
2379 * In C++ terms, think of this as a base class from which device drivers
2380 * will make derived classes.
2382 struct gl_framebuffer
2384 _glthread_Mutex Mutex
; /**< for thread safety */
2385 GLuint Name
; /* if zero, this is a window system framebuffer */
2387 GLboolean DeletePending
;
2389 GLvisual Visual
; /**< The framebuffer's visual.
2390 Immutable if this is a window system buffer.
2391 Computed from attachments if user-made FBO. */
2393 GLboolean Initialized
;
2395 GLuint Width
, Height
; /**< size of frame buffer in pixels */
2397 /** \name Drawing bounds (Intersection of buffer size and scissor box) */
2399 GLint _Xmin
, _Xmax
; /**< inclusive */
2400 GLint _Ymin
, _Ymax
; /**< exclusive */
2403 /** \name Derived Z buffer stuff */
2405 GLuint _DepthMax
; /**< Max depth buffer value */
2406 GLfloat _DepthMaxF
; /**< Float max depth buffer value */
2407 GLfloat _MRD
; /**< minimum resolvable difference in Z values */
2410 GLenum _Status
; /* One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */
2412 /* Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */
2413 struct gl_renderbuffer_attachment Attachment
[BUFFER_COUNT
];
2415 /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER
2416 * attribute group and GL_PIXEL attribute group, respectively.
2418 GLenum ColorDrawBuffer
[MAX_DRAW_BUFFERS
];
2419 GLenum ColorReadBuffer
;
2421 /* These are computed from ColorDrawBuffer and ColorReadBuffer */
2422 GLbitfield _ColorDrawBufferMask
[MAX_DRAW_BUFFERS
]; /* Mask of BUFFER_BIT_* flags */
2423 GLint _ColorReadBufferIndex
; /* -1 = None */
2425 /* These are computed from _ColorDrawBufferMask and _ColorReadBufferIndex */
2426 GLuint _NumColorDrawBuffers
[MAX_DRAW_BUFFERS
];
2427 struct gl_renderbuffer
*_ColorDrawBuffers
[MAX_DRAW_BUFFERS
][4];
2428 struct gl_renderbuffer
*_ColorReadBuffer
;
2430 /** The Actual depth/stencil buffers to use. May be wrappers around the
2431 * depth/stencil buffers attached above. */
2432 struct gl_renderbuffer
*_DepthBuffer
;
2433 struct gl_renderbuffer
*_StencilBuffer
;
2435 /** Delete this framebuffer */
2436 void (*Delete
)(struct gl_framebuffer
*fb
);
2441 * Limits for vertex and fragment programs.
2443 struct gl_program_constants
2445 /* logical limits */
2446 GLuint MaxInstructions
;
2447 GLuint MaxAluInstructions
; /* fragment programs only, for now */
2448 GLuint MaxTexInstructions
; /* fragment programs only, for now */
2449 GLuint MaxTexIndirections
; /* fragment programs only, for now */
2452 GLuint MaxAddressRegs
; /* vertex program only, for now */
2453 GLuint MaxParameters
;
2454 GLuint MaxLocalParams
;
2455 GLuint MaxEnvParams
;
2456 /* native/hardware limits */
2457 GLuint MaxNativeInstructions
;
2458 GLuint MaxNativeAluInstructions
; /* fragment programs only, for now */
2459 GLuint MaxNativeTexInstructions
; /* fragment programs only, for now */
2460 GLuint MaxNativeTexIndirections
; /* fragment programs only, for now */
2461 GLuint MaxNativeAttribs
;
2462 GLuint MaxNativeTemps
;
2463 GLuint MaxNativeAddressRegs
; /* vertex program only, for now */
2464 GLuint MaxNativeParameters
;
2466 GLuint MaxUniformComponents
;
2471 * Constants which may be overridden by device driver during context creation
2472 * but are never changed after that.
2476 GLint MaxTextureLevels
; /**< Maximum number of allowed mipmap levels. */
2477 GLint Max3DTextureLevels
; /**< Maximum number of allowed mipmap levels for 3D texture targets. */
2478 GLint MaxCubeTextureLevels
; /**< Maximum number of allowed mipmap levels for GL_ARB_texture_cube_map */
2479 GLint MaxArrayTextureLayers
; /**< Maximum number of layers in an array texture. */
2480 GLint MaxTextureRectSize
; /* GL_NV_texture_rectangle */
2481 GLuint MaxTextureCoordUnits
;
2482 GLuint MaxTextureImageUnits
;
2483 GLuint MaxTextureUnits
; /* = MIN(CoordUnits, ImageUnits) */
2484 GLfloat MaxTextureMaxAnisotropy
; /* GL_EXT_texture_filter_anisotropic */
2485 GLfloat MaxTextureLodBias
; /* GL_EXT_texture_lod_bias */
2486 GLuint MaxArrayLockSize
;
2488 GLfloat MinPointSize
, MaxPointSize
; /* aliased */
2489 GLfloat MinPointSizeAA
, MaxPointSizeAA
; /* antialiased */
2490 GLfloat PointSizeGranularity
;
2491 GLfloat MinLineWidth
, MaxLineWidth
; /* aliased */
2492 GLfloat MinLineWidthAA
, MaxLineWidthAA
; /* antialiased */
2493 GLfloat LineWidthGranularity
;
2494 GLuint MaxColorTableSize
;
2495 GLuint MaxConvolutionWidth
;
2496 GLuint MaxConvolutionHeight
;
2497 GLuint MaxClipPlanes
;
2499 GLfloat MaxShininess
; /* GL_NV_light_max_exponent */
2500 GLfloat MaxSpotExponent
; /* GL_NV_light_max_exponent */
2501 GLuint MaxViewportWidth
, MaxViewportHeight
;
2502 struct gl_program_constants VertexProgram
; /* GL_ARB_vertex_program */
2503 struct gl_program_constants FragmentProgram
; /* GL_ARB_fragment_program */
2504 /* shared by vertex and fragment program: */
2505 GLuint MaxProgramMatrices
;
2506 GLuint MaxProgramMatrixStackDepth
;
2507 /* vertex array / buffer object bounds checking */
2508 GLboolean CheckArrayBounds
;
2509 /* GL_ARB_draw_buffers */
2510 GLuint MaxDrawBuffers
;
2511 /* GL_OES_read_format */
2512 GLenum ColorReadFormat
;
2513 GLenum ColorReadType
;
2514 /* GL_EXT_framebuffer_object */
2515 GLuint MaxColorAttachments
;
2516 GLuint MaxRenderbufferSize
;
2517 /* GL_ARB_vertex_shader */
2518 GLuint MaxVertexTextureImageUnits
;
2524 * Enable flag for each OpenGL extension. Different device drivers will
2525 * enable different extensions at runtime.
2527 struct gl_extensions
2530 * \name Flags to quickly test if certain extensions are available.
2532 * Not every extension needs to have such a flag, but it's encouraged.
2535 GLboolean dummy
; /* don't remove this! */
2536 GLboolean ARB_depth_texture
;
2537 GLboolean ARB_draw_buffers
;
2538 GLboolean ARB_fragment_program
;
2539 GLboolean ARB_fragment_program_shadow
;
2540 GLboolean ARB_fragment_shader
;
2541 GLboolean ARB_half_float_pixel
;
2542 GLboolean ARB_imaging
;
2543 GLboolean ARB_multisample
;
2544 GLboolean ARB_multitexture
;
2545 GLboolean ARB_occlusion_query
;
2546 GLboolean ARB_point_sprite
;
2547 GLboolean ARB_shader_objects
;
2548 GLboolean ARB_shading_language_100
;
2549 GLboolean ARB_shading_language_120
;
2550 GLboolean ARB_shadow
;
2551 GLboolean ARB_texture_border_clamp
;
2552 GLboolean ARB_texture_compression
;
2553 GLboolean ARB_texture_cube_map
;
2554 GLboolean ARB_texture_env_combine
;
2555 GLboolean ARB_texture_env_crossbar
;
2556 GLboolean ARB_texture_env_dot3
;
2557 GLboolean ARB_texture_float
;
2558 GLboolean ARB_texture_mirrored_repeat
;
2559 GLboolean ARB_texture_non_power_of_two
;
2560 GLboolean ARB_transpose_matrix
;
2561 GLboolean ARB_vertex_buffer_object
;
2562 GLboolean ARB_vertex_program
;
2563 GLboolean ARB_vertex_shader
;
2564 GLboolean ARB_window_pos
;
2567 GLboolean EXT_blend_color
;
2568 GLboolean EXT_blend_equation_separate
;
2569 GLboolean EXT_blend_func_separate
;
2570 GLboolean EXT_blend_logic_op
;
2571 GLboolean EXT_blend_minmax
;
2572 GLboolean EXT_blend_subtract
;
2573 GLboolean EXT_clip_volume_hint
;
2574 GLboolean EXT_cull_vertex
;
2575 GLboolean EXT_convolution
;
2576 GLboolean EXT_compiled_vertex_array
;
2577 GLboolean EXT_copy_texture
;
2578 GLboolean EXT_depth_bounds_test
;
2579 GLboolean EXT_draw_range_elements
;
2580 GLboolean EXT_framebuffer_object
;
2581 GLboolean EXT_fog_coord
;
2582 GLboolean EXT_framebuffer_blit
;
2583 GLboolean EXT_gpu_program_parameters
;
2584 GLboolean EXT_histogram
;
2585 GLboolean EXT_multi_draw_arrays
;
2586 GLboolean EXT_paletted_texture
;
2587 GLboolean EXT_packed_depth_stencil
;
2588 GLboolean EXT_packed_pixels
;
2589 GLboolean EXT_pixel_buffer_object
;
2590 GLboolean EXT_point_parameters
;
2591 GLboolean EXT_polygon_offset
;
2592 GLboolean EXT_rescale_normal
;
2593 GLboolean EXT_shadow_funcs
;
2594 GLboolean EXT_secondary_color
;
2595 GLboolean EXT_separate_specular_color
;
2596 GLboolean EXT_shared_texture_palette
;
2597 GLboolean EXT_stencil_wrap
;
2598 GLboolean EXT_stencil_two_side
;
2599 GLboolean EXT_subtexture
;
2600 GLboolean EXT_texture
;
2601 GLboolean EXT_texture_object
;
2602 GLboolean EXT_texture3D
;
2603 GLboolean EXT_texture_compression_s3tc
;
2604 GLboolean EXT_texture_env_add
;
2605 GLboolean EXT_texture_env_combine
;
2606 GLboolean EXT_texture_env_dot3
;
2607 GLboolean EXT_texture_filter_anisotropic
;
2608 GLboolean EXT_texture_lod_bias
;
2609 GLboolean EXT_texture_mirror_clamp
;
2610 GLboolean EXT_texture_sRGB
;
2611 GLboolean EXT_timer_query
;
2612 GLboolean EXT_vertex_array
;
2613 GLboolean EXT_vertex_array_set
;
2614 /* vendor extensions */
2615 GLboolean APPLE_client_storage
;
2616 GLboolean APPLE_packed_pixels
;
2617 GLboolean APPLE_vertex_array_object
;
2618 GLboolean ATI_texture_mirror_once
;
2619 GLboolean ATI_texture_env_combine3
;
2620 GLboolean ATI_fragment_shader
;
2621 GLboolean ATI_separate_stencil
;
2622 GLboolean IBM_rasterpos_clip
;
2623 GLboolean IBM_multimode_draw_arrays
;
2624 GLboolean MESA_pack_invert
;
2625 GLboolean MESA_packed_depth_stencil
;
2626 GLboolean MESA_program_debug
;
2627 GLboolean MESA_resize_buffers
;
2628 GLboolean MESA_ycbcr_texture
;
2629 GLboolean MESA_texture_array
;
2630 GLboolean NV_blend_square
;
2631 GLboolean NV_fragment_program
;
2632 GLboolean NV_light_max_exponent
;
2633 GLboolean NV_point_sprite
;
2634 GLboolean NV_texgen_reflection
;
2635 GLboolean NV_texture_rectangle
;
2636 GLboolean NV_vertex_program
;
2637 GLboolean NV_vertex_program1_1
;
2638 GLboolean OES_read_format
;
2639 GLboolean SGI_color_matrix
;
2640 GLboolean SGI_color_table
;
2641 GLboolean SGI_texture_color_table
;
2642 GLboolean SGIS_generate_mipmap
;
2643 GLboolean SGIS_texture_edge_clamp
;
2644 GLboolean SGIS_texture_lod
;
2645 GLboolean SGIX_depth_texture
;
2646 GLboolean SGIX_shadow
;
2647 GLboolean SGIX_shadow_ambient
; /* or GL_ARB_shadow_ambient */
2648 GLboolean TDFX_texture_compression_FXT1
;
2651 /* The extension string */
2652 const GLubyte
*String
;
2657 * A stack of matrices (projection, modelview, color, texture, etc).
2659 struct gl_matrix_stack
2661 GLmatrix
*Top
; /**< points into Stack */
2662 GLmatrix
*Stack
; /**< array [MaxDepth] of GLmatrix */
2663 GLuint Depth
; /**< 0 <= Depth < MaxDepth */
2664 GLuint MaxDepth
; /**< size of Stack[] array */
2665 GLuint DirtyFlag
; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */
2670 * \name Bits for image transfer operations
2672 * \sa __GLcontextRec::ImageTransferState.
2675 #define IMAGE_SCALE_BIAS_BIT 0x1
2676 #define IMAGE_SHIFT_OFFSET_BIT 0x2
2677 #define IMAGE_MAP_COLOR_BIT 0x4
2678 #define IMAGE_COLOR_TABLE_BIT 0x8
2679 #define IMAGE_CONVOLUTION_BIT 0x10
2680 #define IMAGE_POST_CONVOLUTION_SCALE_BIAS 0x20
2681 #define IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT 0x40
2682 #define IMAGE_COLOR_MATRIX_BIT 0x80
2683 #define IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT 0x100
2684 #define IMAGE_HISTOGRAM_BIT 0x200
2685 #define IMAGE_MIN_MAX_BIT 0x400
2686 #define IMAGE_CLAMP_BIT 0x800 /* extra */
2689 /** Pixel Transfer ops up to convolution */
2690 #define IMAGE_PRE_CONVOLUTION_BITS (IMAGE_SCALE_BIAS_BIT | \
2691 IMAGE_SHIFT_OFFSET_BIT | \
2692 IMAGE_MAP_COLOR_BIT | \
2693 IMAGE_COLOR_TABLE_BIT)
2695 /** Pixel transfer ops after convolution */
2696 #define IMAGE_POST_CONVOLUTION_BITS (IMAGE_POST_CONVOLUTION_SCALE_BIAS | \
2697 IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT | \
2698 IMAGE_COLOR_MATRIX_BIT | \
2699 IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT |\
2700 IMAGE_HISTOGRAM_BIT | \
2706 * \name Bits to indicate what state has changed.
2711 #define _NEW_MODELVIEW 0x1 /**< __GLcontextRec::ModelView */
2712 #define _NEW_PROJECTION 0x2 /**< __GLcontextRec::Projection */
2713 #define _NEW_TEXTURE_MATRIX 0x4 /**< __GLcontextRec::TextureMatrix */
2714 #define _NEW_COLOR_MATRIX 0x8 /**< __GLcontextRec::ColorMatrix */
2715 #define _NEW_ACCUM 0x10 /**< __GLcontextRec::Accum */
2716 #define _NEW_COLOR 0x20 /**< __GLcontextRec::Color */
2717 #define _NEW_DEPTH 0x40 /**< __GLcontextRec::Depth */
2718 #define _NEW_EVAL 0x80 /**< __GLcontextRec::Eval, __GLcontextRec::EvalMap */
2719 #define _NEW_FOG 0x100 /**< __GLcontextRec::Fog */
2720 #define _NEW_HINT 0x200 /**< __GLcontextRec::Hint */
2721 #define _NEW_LIGHT 0x400 /**< __GLcontextRec::Light */
2722 #define _NEW_LINE 0x800 /**< __GLcontextRec::Line */
2723 #define _NEW_PIXEL 0x1000 /**< __GLcontextRec::Pixel */
2724 #define _NEW_POINT 0x2000 /**< __GLcontextRec::Point */
2725 #define _NEW_POLYGON 0x4000 /**< __GLcontextRec::Polygon */
2726 #define _NEW_POLYGONSTIPPLE 0x8000 /**< __GLcontextRec::PolygonStipple */
2727 #define _NEW_SCISSOR 0x10000 /**< __GLcontextRec::Scissor */
2728 #define _NEW_STENCIL 0x20000 /**< __GLcontextRec::Stencil */
2729 #define _NEW_TEXTURE 0x40000 /**< __GLcontextRec::Texture */
2730 #define _NEW_TRANSFORM 0x80000 /**< __GLcontextRec::Transform */
2731 #define _NEW_VIEWPORT 0x100000 /**< __GLcontextRec::Viewport */
2732 #define _NEW_PACKUNPACK 0x200000 /**< __GLcontextRec::Pack, __GLcontextRec::Unpack */
2733 #define _NEW_ARRAY 0x400000 /**< __GLcontextRec::Array */
2734 #define _NEW_RENDERMODE 0x800000 /**< __GLcontextRec::RenderMode, __GLcontextRec::Feedback, __GLcontextRec::Select */
2735 #define _NEW_BUFFERS 0x1000000 /**< __GLcontextRec::Visual, __GLcontextRec::DrawBuffer, */
2736 #define _NEW_MULTISAMPLE 0x2000000 /**< __GLcontextRec::Multisample */
2737 #define _NEW_TRACK_MATRIX 0x4000000 /**< __GLcontextRec::VertexProgram */
2738 #define _NEW_PROGRAM 0x8000000 /**< __GLcontextRec::VertexProgram */
2744 * \name Bits to track array state changes
2746 * Also used to summarize array enabled.
2749 #define _NEW_ARRAY_VERTEX VERT_BIT_POS
2750 #define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
2751 #define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
2752 #define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
2753 #define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
2754 #define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
2755 #define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX
2756 #define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG
2757 #define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
2758 #define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
2759 #define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
2760 #define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
2761 #define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
2762 #define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
2763 #define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
2764 #define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
2765 #define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */
2766 #define _NEW_ARRAY_ALL 0xffffffff
2769 #define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
2770 #define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i))
2775 * \name A bunch of flags that we think might be useful to drivers.
2777 * Set in the __GLcontextRec::_TriangleCaps bitfield.
2780 #define DD_FLATSHADE 0x1
2781 #define DD_SEPARATE_SPECULAR 0x2
2782 #define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
2783 #define DD_TRI_LIGHT_TWOSIDE 0x8
2784 #define DD_TRI_UNFILLED 0x10
2785 #define DD_TRI_SMOOTH 0x20
2786 #define DD_TRI_STIPPLE 0x40
2787 #define DD_TRI_OFFSET 0x80
2788 #define DD_LINE_SMOOTH 0x100
2789 #define DD_LINE_STIPPLE 0x200
2790 #define DD_LINE_WIDTH 0x400
2791 #define DD_POINT_SMOOTH 0x800
2792 #define DD_POINT_SIZE 0x1000
2793 #define DD_POINT_ATTEN 0x2000
2794 #define DD_TRI_TWOSTENCIL 0x4000
2799 * \name Define the state changes under which each of these bits might change
2802 #define _DD_NEW_FLATSHADE _NEW_LIGHT
2803 #define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
2804 #define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
2805 #define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
2806 #define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
2807 #define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
2808 #define _DD_NEW_TRI_STIPPLE _NEW_POLYGON
2809 #define _DD_NEW_TRI_OFFSET _NEW_POLYGON
2810 #define _DD_NEW_LINE_SMOOTH _NEW_LINE
2811 #define _DD_NEW_LINE_STIPPLE _NEW_LINE
2812 #define _DD_NEW_LINE_WIDTH _NEW_LINE
2813 #define _DD_NEW_POINT_SMOOTH _NEW_POINT
2814 #define _DD_NEW_POINT_SIZE _NEW_POINT
2815 #define _DD_NEW_POINT_ATTEN _NEW_POINT
2819 #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
2825 #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \
2828 #define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX)
2834 * Forward declaration of display list data types:
2837 typedef union node Node
;
2840 /* This has to be included here. */
2844 #define NUM_VERTEX_FORMAT_ENTRIES (sizeof(GLvertexformat) / sizeof(void *))
2847 * Core Mesa's support for tnl modules:
2849 struct gl_tnl_module
2852 * Vertex format to be lazily swapped into current dispatch.
2854 const GLvertexformat
*Current
;
2857 * \name Record of functions swapped out.
2858 * On restore, only need to swap these functions back in.
2862 _glapi_proc
* location
;
2863 _glapi_proc function
;
2864 } Swapped
[NUM_VERTEX_FORMAT_ENTRIES
];
2869 /* Strictly this is a tnl/ private concept, but it doesn't seem
2870 * worthwhile adding a tnl private structure just to hold this one bit
2873 #define MESA_DLIST_DANGLING_REFS 0x1
2875 /* Provide a location where information about a display list can be
2876 * collected. Could be extended with driverPrivate structures,
2877 * etc. in the future.
2879 struct mesa_display_list
2888 * State used during display list compilation and execution.
2890 struct gl_dlist_state
2892 struct mesa_display_list
*CallStack
[MAX_LIST_NESTING
];
2893 GLuint CallDepth
; /**< Current recursion calling depth */
2895 struct mesa_display_list
*CurrentList
;
2896 Node
*CurrentListPtr
; /**< Head of list being compiled */
2897 GLuint CurrentListNum
; /**< Number of the list being compiled */
2898 Node
*CurrentBlock
; /**< Pointer to current block of nodes */
2899 GLuint CurrentPos
; /**< Index into current block of nodes */
2901 GLvertexformat ListVtxfmt
;
2903 GLubyte ActiveAttribSize
[VERT_ATTRIB_MAX
];
2904 GLfloat CurrentAttrib
[VERT_ATTRIB_MAX
][4];
2906 GLubyte ActiveMaterialSize
[MAT_ATTRIB_MAX
];
2907 GLfloat CurrentMaterial
[MAT_ATTRIB_MAX
][4];
2909 GLubyte ActiveIndex
;
2910 GLfloat CurrentIndex
;
2912 GLubyte ActiveEdgeFlag
;
2913 GLboolean CurrentEdgeFlag
;
2918 * Mesa rendering context.
2920 * This is the central context data structure for Mesa. Almost all
2921 * OpenGL state is contained in this structure.
2922 * Think of this as a base class from which device drivers will derive
2925 * The GLcontext typedef names this structure.
2927 struct __GLcontextRec
2929 /** State possibly shared with other contexts in the address space */
2930 struct gl_shared_state
*Shared
;
2932 /** \name API function pointer tables */
2934 struct _glapi_table
*Save
; /**< Display list save functions */
2935 struct _glapi_table
*Exec
; /**< Execute functions */
2936 struct _glapi_table
*CurrentDispatch
; /**< == Save or Exec !! */
2940 GLframebuffer
*DrawBuffer
; /**< buffer for writing */
2941 GLframebuffer
*ReadBuffer
; /**< buffer for reading */
2942 GLframebuffer
*WinSysDrawBuffer
; /**< set with MakeCurrent */
2943 GLframebuffer
*WinSysReadBuffer
; /**< set with MakeCurrent */
2946 * Device driver function pointer table
2948 struct dd_function_table Driver
;
2950 void *DriverCtx
; /**< Points to device driver context/state */
2952 /** Core/Driver constants */
2953 struct gl_constants Const
;
2955 /** \name The various 4x4 matrix stacks */
2957 struct gl_matrix_stack ModelviewMatrixStack
;
2958 struct gl_matrix_stack ProjectionMatrixStack
;
2959 struct gl_matrix_stack ColorMatrixStack
;
2960 struct gl_matrix_stack TextureMatrixStack
[MAX_TEXTURE_COORD_UNITS
];
2961 struct gl_matrix_stack ProgramMatrixStack
[MAX_PROGRAM_MATRICES
];
2962 struct gl_matrix_stack
*CurrentStack
; /**< Points to one of the above stacks */
2965 /** Combined modelview and projection matrix */
2966 GLmatrix _ModelProjectMatrix
;
2968 /** \name Display lists */
2969 struct gl_dlist_state ListState
;
2971 GLboolean ExecuteFlag
; /**< Execute GL commands? */
2972 GLboolean CompileFlag
; /**< Compile GL commands into display list? */
2974 /** Extension information */
2975 struct gl_extensions Extensions
;
2977 /** \name State attribute stack (for glPush/PopAttrib) */
2979 GLuint AttribStackDepth
;
2980 struct gl_attrib_node
*AttribStack
[MAX_ATTRIB_STACK_DEPTH
];
2983 /** \name Renderer attribute groups
2985 * We define a struct for each attribute group to make pushing and popping
2986 * attributes easy. Also it's a good organization.
2989 struct gl_accum_attrib Accum
; /**< Accum buffer attributes */
2990 struct gl_colorbuffer_attrib Color
; /**< Color buffer attributes */
2991 struct gl_current_attrib Current
; /**< Current attributes */
2992 struct gl_depthbuffer_attrib Depth
; /**< Depth buffer attributes */
2993 struct gl_eval_attrib Eval
; /**< Eval attributes */
2994 struct gl_fog_attrib Fog
; /**< Fog attributes */
2995 struct gl_hint_attrib Hint
; /**< Hint attributes */
2996 struct gl_light_attrib Light
; /**< Light attributes */
2997 struct gl_line_attrib Line
; /**< Line attributes */
2998 struct gl_list_attrib List
; /**< List attributes */
2999 struct gl_multisample_attrib Multisample
;
3000 struct gl_pixel_attrib Pixel
; /**< Pixel attributes */
3001 struct gl_point_attrib Point
; /**< Point attributes */
3002 struct gl_polygon_attrib Polygon
; /**< Polygon attributes */
3003 GLuint PolygonStipple
[32]; /**< Polygon stipple */
3004 struct gl_scissor_attrib Scissor
; /**< Scissor attributes */
3005 struct gl_stencil_attrib Stencil
; /**< Stencil buffer attributes */
3006 struct gl_texture_attrib Texture
; /**< Texture attributes */
3007 struct gl_transform_attrib Transform
; /**< Transformation attributes */
3008 struct gl_viewport_attrib Viewport
; /**< Viewport attributes */
3011 /** \name Client attribute stack */
3013 GLuint ClientAttribStackDepth
;
3014 struct gl_attrib_node
*ClientAttribStack
[MAX_CLIENT_ATTRIB_STACK_DEPTH
];
3017 /** \name Client attribute groups */
3019 struct gl_array_attrib Array
; /**< Vertex arrays */
3020 struct gl_pixelstore_attrib Pack
; /**< Pixel packing */
3021 struct gl_pixelstore_attrib Unpack
; /**< Pixel unpacking */
3022 struct gl_pixelstore_attrib DefaultPacking
; /**< Default params */
3025 /** \name Other assorted state (not pushed/popped on attribute stack) */
3027 struct gl_pixelmaps PixelMaps
;
3028 struct gl_histogram_attrib Histogram
;
3029 struct gl_minmax_attrib MinMax
;
3030 struct gl_convolution_attrib Convolution1D
;
3031 struct gl_convolution_attrib Convolution2D
;
3032 struct gl_convolution_attrib Separable2D
;
3034 struct gl_evaluators EvalMap
; /**< All evaluators */
3035 struct gl_feedback Feedback
; /**< Feedback */
3036 struct gl_selection Select
; /**< Selection */
3038 struct gl_color_table ColorTable
[COLORTABLE_MAX
];
3039 struct gl_color_table ProxyColorTable
[COLORTABLE_MAX
];
3041 struct gl_color_table PostConvolutionColorTable
;
3042 struct gl_color_table ProxyPostConvolutionColorTable
;
3043 struct gl_color_table PostColorMatrixColorTable
;
3044 struct gl_color_table ProxyPostColorMatrixColorTable
;
3047 struct gl_program_state Program
; /**< for vertex or fragment progs */
3048 struct gl_vertex_program_state VertexProgram
; /**< GL_ARB/NV_vertex_program */
3049 struct gl_fragment_program_state FragmentProgram
; /**< GL_ARB/NV_vertex_program */
3050 struct gl_ati_fragment_shader_state ATIFragmentShader
; /**< GL_ATI_fragment_shader */
3052 struct gl_query_state Query
; /**< GL_ARB_occlusion_query */
3054 struct gl_shader_state Shader
; /**< GLSL shader object state */
3057 #if FEATURE_EXT_framebuffer_object
3058 struct gl_renderbuffer
*CurrentRenderbuffer
;
3061 GLenum ErrorValue
; /**< Last error code */
3062 GLenum RenderMode
; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
3063 GLbitfield NewState
; /**< bitwise-or of _NEW_* flags */
3065 /** \name Derived state */
3067 GLbitfield _TriangleCaps
; /**< bitwise-or of DD_* flags */
3068 GLbitfield _ImageTransferState
;/**< bitwise-or of IMAGE_*_BIT flags */
3069 GLfloat _EyeZDir
[3];
3070 GLfloat _ModelViewInvScale
;
3071 GLboolean _NeedEyeCoords
;
3072 GLboolean _ForceEyeCoords
;
3073 GLenum _CurrentProgram
; /* currently executing program */
3075 GLuint TextureStateTimestamp
; /* detect changes to shared state */
3077 struct gl_shine_tab
*_ShineTable
[2]; /**< Active shine tables */
3078 struct gl_shine_tab
*_ShineTabList
; /**< MRU list of inactive shine tables */
3081 struct gl_list_extensions ListExt
; /**< driver dlist extensions */
3084 GLuint _Facing
; /**< This is a hack for 2-sided stencil test.
3086 * We don't have a better way to communicate this value from
3087 * swrast_setup to swrast. */
3089 /** \name For debugging/development only */
3091 GLboolean FirstTimeCurrent
;
3094 /** Dither disable via MESA_NO_DITHER env var */
3097 /** software compression/decompression supported or not */
3098 GLboolean Mesa_DXTn
;
3100 /** Core tnl module support */
3101 struct gl_tnl_module TnlModule
;
3104 * \name Hooks for module contexts.
3106 * These will eventually live in the driver or elsewhere.
3109 void *swrast_context
;
3110 void *swsetup_context
;
3111 void *swtnl_context
;
3113 struct st_context
*st
;
3119 /** The string names for GL_POINT, GL_LINE_LOOP, etc */
3120 extern const char *_mesa_prim_name
[GL_POLYGON
+4];
3124 extern int MESA_VERBOSE
;
3125 extern int MESA_DEBUG_FLAGS
;
3126 # define MESA_FUNCTION __FUNCTION__
3128 # define MESA_VERBOSE 0
3129 # define MESA_DEBUG_FLAGS 0
3130 # define MESA_FUNCTION "a function"
3139 VERBOSE_VARRAY
= 0x0001,
3140 VERBOSE_TEXTURE
= 0x0002,
3141 VERBOSE_IMMEDIATE
= 0x0004,
3142 VERBOSE_PIPELINE
= 0x0008,
3143 VERBOSE_DRIVER
= 0x0010,
3144 VERBOSE_STATE
= 0x0020,
3145 VERBOSE_API
= 0x0040,
3146 VERBOSE_DISPLAY_LIST
= 0x0100,
3147 VERBOSE_LIGHTING
= 0x0200,
3148 VERBOSE_PRIMS
= 0x0400,
3149 VERBOSE_VERTS
= 0x0800,
3150 VERBOSE_DISASSEM
= 0x1000
3156 DEBUG_ALWAYS_FLUSH
= 0x1
3161 #define Elements(x) sizeof(x)/sizeof(*(x))
3164 #endif /* TYPES_H */