-/* $Id: mtypes.h,v 1.43 2001/05/29 15:23:49 brianp Exp $ */
+/* $Id: mtypes.h,v 1.66 2002/03/13 04:33:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/**
+ * \file mtypes.h
+ * \brief Main Mesa data structures.
+ */
#ifndef TYPES_H
#define TYPES_H
#define CHAN_MAXF 1.0F
#define CHAN_TYPE GL_FLOAT
#else
-#error illegal number of color channel bits
+#error "illegal number of color channel bits"
#endif
-/*
+/**
* Accumulation buffer data type:
*/
#if ACCUM_BITS==8
typedef GLbyte GLaccum;
#elif ACCUM_BITS==16
typedef GLshort GLaccum;
+#elif ACCUM_BITS==32
+ typedef GLfloat GLaccum;
#else
# error "illegal number of accumulation bits"
#endif
-/*
+/**
* Stencil buffer data type:
*/
#if STENCIL_BITS==8
#endif
-/*
+/**
* Depth buffer data type:
*/
typedef GLuint GLdepth; /* Must be 32-bits! */
-/*
+/**
* Fixed point data type:
*/
typedef int GLfixed;
-/*
+/**
* Some forward type declarations
*/
struct _mesa_HashTable;
-/* Maximum number of temporary vertices required for clipping. (Used
+/* These define the aliases between numbered vertex attributes and
+ * conventional OpenGL vertex attributes. We use these values in
+ * quite a few places. New in Mesa 4.1.
+ */
+#define VERT_ATTRIB_POS 0
+#define VERT_ATTRIB_WEIGHT 1
+#define VERT_ATTRIB_NORMAL 2
+#define VERT_ATTRIB_COLOR0 3
+#define VERT_ATTRIB_COLOR1 4
+#define VERT_ATTRIB_FOG 5
+#define VERT_ATTRIB_SIX 6
+#define VERT_ATTRIB_SEVEN 7
+#define VERT_ATTRIB_TEX0 8
+#define VERT_ATTRIB_TEX1 9
+#define VERT_ATTRIB_TEX2 10
+#define VERT_ATTRIB_TEX3 11
+#define VERT_ATTRIB_TEX4 12
+#define VERT_ATTRIB_TEX5 13
+#define VERT_ATTRIB_TEX6 14
+#define VERT_ATTRIB_TEX7 15
+#define VERT_ATTRIB_MAX 16
+
+/* These are used in bitfields in many places */
+#define VERT_BIT_POS (1 << VERT_ATTRIB_POS)
+#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT)
+#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL)
+#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0)
+#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1)
+#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG)
+#define VERT_BIT_SIX (1 << VERT_ATTRIB_SIX)
+#define VERT_BIT_SEVEN (1 << VERT_ATTRIB_SEVEN)
+#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0)
+#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1)
+#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2)
+#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3)
+#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4)
+#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5)
+#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6)
+#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7)
+
+#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u)))
+
+
+
+/**
+ * Maximum number of temporary vertices required for clipping. (Used
* in array_cache and tnl modules).
*/
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
struct gl_light {
- struct gl_light *next; /* double linked list with sentinel */
+ struct gl_light *next; /* double linked list with sentinel */
struct gl_light *prev;
GLfloat Ambient[4]; /* ambient color */
GLenum DrawBuffer; /* Which buffer to draw into */
GLenum DriverDrawBuffer; /* Current device driver dest buffer */
- GLboolean MultiDrawBuffer; /* Drawing to mutliple buffers? */
+ GLboolean MultiDrawBuffer; /* Drawing to multiple buffers? */
GLubyte DrawDestMask; /* bitwise-OR of bitflags above */
/* alpha testing */
struct gl_current_attrib {
/* These values valid only when FLUSH_VERTICES has been called.
*/
- GLfloat Normal[3]; /* Current vertex normal */
- GLfloat Color[4]; /* Current RGBA color */
- GLfloat SecondaryColor[4]; /* Current secondary color */
- GLfloat FogCoord; /* Current Fog coord */
+ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /* Current vertex attributes */
+ /* indexed by VERT_ATTRIB_* */
GLuint Index; /* Current color index */
GLboolean EdgeFlag; /* Current edge flag */
- GLfloat Texcoord[MAX_TEXTURE_UNITS][4]; /* Current texture coords */
- /* These values are always valid.
+ /* These values are always valid. BTW, note how similar this set of
+ * attributes is to the SWvertex datatype in the software rasterizer...
*/
GLfloat RasterPos[4]; /* Current raster position */
GLfloat RasterDistance; /* Current raster distance */
GLfloat RasterColor[4]; /* Current raster color */
- GLuint RasterIndex; /* Current raster index */
- GLfloat *RasterTexCoord; /* Current raster texcoord*/
+ GLfloat RasterSecondaryColor[4]; /* Current rast 2ndary color */
+ GLuint RasterIndex; /* Current raster index */
+ GLfloat *RasterTexCoord; /* Current raster texcoord */
GLfloat RasterMultiTexCoord[MAX_TEXTURE_UNITS][4];
- GLboolean RasterPosValid; /* Raster po valid flag */
+ GLboolean RasterPosValid; /* Raster pos valid flag */
};
GLboolean Map1TextureCoord4;
GLboolean Map1Vertex3;
GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
GLboolean Map2Color4;
GLboolean Map2Index;
GLboolean Map2Normal;
GLboolean Map2TextureCoord4;
GLboolean Map2Vertex3;
GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
GLboolean MinMax;
GLboolean Normalize;
GLboolean PixelTexture;
GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
GLboolean SampleCoverage; /* GL_ARB_multisample */
GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
+ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
GLuint Texture[MAX_TEXTURE_UNITS];
GLuint TexGen[MAX_TEXTURE_UNITS];
+ /* GL_NV_vertex_program */
+ GLboolean VertexProgram;
+ GLboolean VertexProgramPointSize;
+ GLboolean VertexProgramTwoSide;
};
GLboolean Map1TextureCoord4;
GLboolean Map1Vertex3;
GLboolean Map1Vertex4;
+ GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */
GLboolean Map2Color4;
GLboolean Map2Index;
GLboolean Map2Normal;
GLboolean Map2TextureCoord4;
GLboolean Map2Vertex3;
GLboolean Map2Vertex4;
+ GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */
GLboolean AutoNormal;
/* Map Grid endpoints and divisions and calculated du values */
GLint MapGrid1un;
GLfloat Index; /* Fog index */
GLenum Mode; /* Fog mode */
GLboolean ColorSumEnabled;
- GLenum FogCoordinateSource;
+ GLenum FogCoordinateSource; /* GL_EXT_fog_coord */
};
};
+#define LIGHT_SPOT 0x1
+#define LIGHT_LOCAL_VIEWER 0x2
+#define LIGHT_POSITIONAL 0x4
+#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
+
struct gl_light_attrib {
struct gl_light Light[MAX_LIGHTS]; /* Array of lights */
struct gl_lightmodel Model; /* Lighting model */
/* Derived for optimizations: */
GLboolean _NeedVertices; /* Use fast shader? */
- GLuint _Flags; /* LIGHT_* flags, see below */
+ GLuint _Flags; /* LIGHT_* flags, see above */
GLfloat _BaseColor[2][3];
- GLfloat _BaseAlpha[2];
};
-#define LIGHT_SPOT 0x1
-#define LIGHT_LOCAL_VIEWER 0x2
-#define LIGHT_POSITIONAL 0x4
-
-#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
-
struct gl_line_attrib {
GLboolean SmoothFlag; /* GL_LINE_SMOOTH enabled? */
GLboolean StippleFlag; /* GL_LINE_STIPPLE enabled? */
GLuint ListBase;
};
+
struct gl_list_opcode {
GLuint size;
void (*execute)( GLcontext *ctx, void *data );
GLboolean MapColorFlag;
GLboolean MapStencilFlag;
GLfloat ZoomX, ZoomY;
+ /* XXX move these out of gl_pixel_attrib */
GLint MapStoSsize; /* Size of each pixel map */
GLint MapItoIsize;
GLint MapItoRsize;
GLuint Name; /* an unsigned integer */
GLuint Dimensions; /* 1 or 2 or 3 or 6 (cube map) */
GLfloat Priority; /* in [0,1] */
- GLchan BorderColor[4];
+ GLfloat BorderValues[4]; /* unclamped */
+ GLchan BorderColor[4]; /* clamped, as GLchan */
GLenum WrapS; /* Wrap modes are: GL_CLAMP, REPEAT */
GLenum WrapT; /* GL_CLAMP_TO_EDGE, and */
GLenum WrapR; /* GL_CLAMP_TO_BORDER_ARB */
GLfloat MaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
GLboolean CompareFlag; /* GL_SGIX_shadow */
GLenum CompareOperator; /* GL_SGIX_shadow */
- GLchan ShadowAmbient; /* GL_SGIX_shadow_ambient */
+ GLchan ShadowAmbient; /* GL_SGIX/ARB_shadow_ambient */
+ GLenum CompareMode; /* GL_ARB_shadow */
+ GLenum CompareFunc; /* GL_ARB_shadow */
+ GLenum DepthMode; /* GL_ARB_depth_texture */
GLint _MaxLevel; /* actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /* = _MaxLevel - BaseLevel (q - b in spec) */
GLboolean GenerateMipmap; /* GL_SGIS_generate_mipmap */
struct gl_texture_attrib {
/* multitexture */
GLuint CurrentUnit; /* Active texture unit */
- GLuint CurrentTransformUnit; /* Client active texture xform unit */
GLuint _ReallyEnabled; /* enables for all texture units: */
/* = (Unit[0]._ReallyEnabled << 0) | */
GLubyte _AnyClip; /* How many ClipEnabled? */
GLboolean Normalize; /* Normalize all normals? */
GLboolean RescaleNormals; /* GL_EXT_rescale_normal */
+ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
};
GLsizei StrideB; /* actual stride in bytes */
void *Ptr;
GLuint Flags;
- GLboolean Enabled;
+ GLuint Enabled; /* one of the _NEW_ARRAY_ bits */
};
struct gl_client_array TexCoord[MAX_TEXTURE_UNITS];
struct gl_client_array EdgeFlag;
+ struct gl_client_array VertexAttrib[16]; /* GL_NV_vertex_program */
+
GLint TexCoordInterleaveFactor;
GLint ActiveTexture; /* Client Active Texture */
GLuint LockFirst;
struct gl_1d_map Map1Texture2;
struct gl_1d_map Map1Texture3;
struct gl_1d_map Map1Texture4;
+ struct gl_1d_map Map1Attrib[16]; /* GL_NV_vertex_program */
/* 2-D maps */
struct gl_2d_map Map2Vertex3;
struct gl_2d_map Map2Texture2;
struct gl_2d_map Map2Texture3;
struct gl_2d_map Map2Texture4;
+ struct gl_2d_map Map2Attrib[16]; /* GL_NV_vertex_program */
+};
+
+
+/*
+ * Vertex program tokens and datatypes
+ */
+
+#define VP_MAX_INSTRUCTIONS 128
+
+#define VP_NUM_INPUT_REGS VERT_ATTRIB_MAX
+#define VP_NUM_OUTPUT_REGS 15
+#define VP_NUM_TEMP_REGS 12
+#define VP_NUM_PROG_REGS 96
+
+#define VP_NUM_TOTAL_REGISTERS (VP_NUM_INPUT_REGS + VP_NUM_OUTPUT_REGS + VP_NUM_TEMP_REGS + VP_NUM_PROG_REGS)
+
+/* Location of register sets within the whole register file */
+#define VP_INPUT_REG_START 0
+#define VP_INPUT_REG_END (VP_INPUT_REG_START + VP_NUM_INPUT_REGS - 1)
+#define VP_OUTPUT_REG_START (VP_INPUT_REG_END + 1)
+#define VP_OUTPUT_REG_END (VP_OUTPUT_REG_START + VP_NUM_OUTPUT_REGS - 1)
+#define VP_TEMP_REG_START (VP_OUTPUT_REG_END + 1)
+#define VP_TEMP_REG_END (VP_TEMP_REG_START + VP_NUM_TEMP_REGS - 1)
+#define VP_PROG_REG_START (VP_TEMP_REG_END + 1)
+#define VP_PROG_REG_END (VP_PROG_REG_START + VP_NUM_PROG_REGS - 1)
+
+
+/* Machine state (i.e. the register file) */
+struct vp_machine
+{
+ GLfloat Registers[VP_NUM_TOTAL_REGISTERS][4];
+ GLint AddressReg; /* might someday be a 4-vector */
+};
+
+
+/* Vertex program opcodes */
+enum vp_opcode
+{
+ MOV,
+ LIT,
+ RCP,
+ RSQ,
+ EXP,
+ LOG,
+ MUL,
+ ADD,
+ DP3,
+ DP4,
+ DST,
+ MIN,
+ MAX,
+ SLT,
+ SGE,
+ MAD,
+ ARL,
+ DPH,
+ RCC,
+ SUB,
+ ABS,
+ END
+};
+
+
+/* Instruction source register */
+struct vp_src_register
+{
+ GLint Register; /* or the offset from the address register */
+ GLuint Swizzle[4];
+ GLboolean Negate;
+ GLboolean RelAddr;
+};
+
+
+/* Instruction destination register */
+struct vp_dst_register
+{
+ GLint Register;
+ GLboolean WriteMask[4];
+};
+
+
+/* Vertex program instruction */
+struct vp_instruction
+{
+ enum vp_opcode Opcode;
+ struct vp_src_register SrcReg[3];
+ struct vp_dst_register DstReg;
+};
+
+
+/* The actual vertex program, stored in the hash table */
+struct vp_program
+{
+ GLubyte *String; /* Original user code */
+ struct vp_instruction *Instructions; /* Compiled instructions */
+ GLenum Target; /* GL_VERTEX_PROGRAM_NV or GL_VERTEX_STATE_PROGRAM_NV */
+ GLint ErrorPos; /* Position in string where error was detected */
+ GLint RefCount; /* Since programs can be shared among contexts */
+ GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */
+ GLboolean Resident;
+ GLuint InputsRead; /* Bitmask of which input regs are read */
+ GLuint OutputsWritten; /* Bitmask of which output regs are written to */
+};
+
+
+/*
+ * State vars for GL_NV_vertex_program
+ */
+struct vertex_program_state
+{
+ GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
+ GLboolean PointSizeEnabled; /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */
+ GLboolean TwoSideEnabled; /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */
+ GLuint CurrentID; /* currently bound program's ID */
+ struct vp_program *Current; /* ptr to currently bound program */
+ struct vp_machine Machine; /* machine state */
+
+ GLenum TrackMatrix[VP_NUM_PROG_REGS / 4];
+ GLenum TrackMatrixTransform[VP_NUM_PROG_REGS / 4];
};
+
/*
* State which can be shared by multiple contexts:
*/
struct gl_texture_object *Default3D;
struct gl_texture_object *DefaultCubeMap;
+ /* GL_NV_vertex_program */
+ struct _mesa_HashTable *VertexPrograms;
+
void *DriverData; /* Device driver shared state */
};
* but are never changed after that.
*/
struct gl_constants {
- GLint MaxTextureSize;
- GLint MaxCubeTextureSize;
GLint MaxTextureLevels;
+ GLint Max3DTextureLevels;
+ GLint MaxCubeTextureLevels;
GLuint MaxTextureUnits;
GLfloat MaxTextureMaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
+ GLfloat MaxTextureLodBias; /* GL_EXT_texture_lod_bias */
GLuint MaxArrayLockSize;
GLint SubPixelBits;
GLfloat MinPointSize, MaxPointSize; /* aliased */
/* Flags to quickly test if certain extensions are available.
* Not every extension needs to have such a flag, but it's encouraged.
*/
+ GLboolean ARB_depth_texture;
GLboolean ARB_imaging;
GLboolean ARB_multisample;
GLboolean ARB_multitexture;
+ GLboolean ARB_shadow;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
GLboolean ARB_texture_cube_map;
GLboolean ARB_texture_env_combine;
GLboolean ARB_texture_env_dot3;
+ GLboolean ARB_texture_mirrored_repeat;
+ GLboolean ARB_window_pos;
GLboolean EXT_blend_color;
GLboolean EXT_blend_func_separate;
GLboolean EXT_blend_logic_op;
GLboolean EXT_texture_lod_bias;
GLboolean EXT_vertex_array_set;
GLboolean HP_occlusion_test;
+ GLboolean IBM_rasterpos_clip;
GLboolean INGR_blend_func_separate;
GLboolean MESA_window_pos;
GLboolean MESA_resize_buffers;
GLboolean MESA_sprite_point;
GLboolean NV_blend_square;
GLboolean NV_texgen_reflection;
+ GLboolean NV_vertex_program;
+ GLboolean NV_vertex_program1_1;
GLboolean SGI_color_matrix;
GLboolean SGI_color_table;
GLboolean SGIS_generate_mipmap;
GLboolean SGIX_depth_texture;
GLboolean SGIX_pixel_texture;
GLboolean SGIX_shadow;
- GLboolean SGIX_shadow_ambient;
+ GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */
GLboolean _3DFX_texture_compression_FXT1;
};
+/* XXX just an idea */
+struct matrix_stack
+{
+ GLmatrix *Top; /* points into Stack */
+ GLmatrix *Stack; /* array [MaxDepth] of GLmatrix */
+ GLuint Depth; /* 0 <= Depth < MaxDepth */
+ GLuint MaxDepth; /* size of Stack[] array */
+ GLuint DirtyFlag; /* _NEW_MODELVIEW or _NEW_PROJECTION, for example */
+};
+
/*
* Bits for image transfer operations (ctx->ImageTransferState).
#define _NEW_RENDERMODE 0x800000 /* RenderMode, Feedback, Select */
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
+#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
+#define _NEW_PROGRAM 0x8000000 /* ctx->VertexProgram */
#define _NEW_ALL ~0
/* Bits to track array state changes (also used to summarize array enabled)
*/
-#define _NEW_ARRAY_VERTEX 0x1
-#define _NEW_ARRAY_COLOR 0x2
-#define _NEW_ARRAY_NORMAL 0x4
-#define _NEW_ARRAY_INDEX 0x8
-#define _NEW_ARRAY_EDGEFLAG 0x10
-#define _NEW_ARRAY_SECONDARYCOLOR 0x20
-#define _NEW_ARRAY_FOGCOORD 0x40
-#define _NEW_ARRAY_TEXCOORD_0 0x80
-#define _NEW_ARRAY_TEXCOORD_1 0x100
-#define _NEW_ARRAY_TEXCOORD_2 0x200
-#define _NEW_ARRAY_TEXCOORD_3 0x400
-#define _NEW_ARRAY_TEXCOORD_4 0x800
-#define _NEW_ARRAY_TEXCOORD_5 0x1000
-#define _NEW_ARRAY_TEXCOORD_6 0x2000
-#define _NEW_ARRAY_TEXCOORD_7 0x4000
-#define _NEW_ARRAY_ALL 0x7fff
+#define _NEW_ARRAY_VERTEX VERT_BIT_POS
+#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT
+#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL
+#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0
+#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1
+#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG
+#define _NEW_ARRAY_INDEX VERT_BIT_SIX
+#define _NEW_ARRAY_EDGEFLAG VERT_BIT_SEVEN
+#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0
+#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1
+#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2
+#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3
+#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4
+#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5
+#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6
+#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7
+#define _NEW_ARRAY_ALL 0xffff
+#define _NEW_ARRAY_VERT_ATTRIB0 0x10000
+
#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i))
#define _IMAGE_NEW_TRANSFER_STATE (_NEW_PIXEL | _NEW_COLOR_MATRIX)
+/* Bits for ctx->_NeedNormals */
#define NEED_NORMALS_TEXGEN 0x1
#define NEED_NORMALS_LIGHT 0x2
+/* Bits for ctx->_NeedEyeCoords */
#define NEED_EYE_TEXGEN 0x1
#define NEED_EYE_LIGHT 0x2
#define NEED_EYE_LIGHT_MODELVIEW 0x4
#define NEED_EYE_POINT_ATTEN 0x8
+#define NEED_EYE_DRIVER 0x10
/*
};
-/*
- * The library context:
+/**
+ * This is the central context data structure for Mesa. Almost all
+ * OpenGL state is contained in this structure.
*/
struct __GLcontextRec {
- /*
- ** Os related interfaces; these *must* be the first members of this
- ** structure, because they are exposed to the outside world (i.e. GLX
- ** extension).
- */
+ /**
+ * OS related interfaces; these *must* be the first members of this
+ * structure, because they are exposed to the outside world (i.e. GLX
+ * extension).
+ */
__GLimports imports;
__GLexports exports;
struct gl_shared_state *Shared;
/* API function pointer tables */
- struct _glapi_table *Save; /* Display list save funcs */
- struct _glapi_table *Exec; /* Execute funcs */
- struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */
+ struct _glapi_table *Save; /**< Display list save funcs */
+ struct _glapi_table *Exec; /**< Execute funcs */
+ struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */
- GLboolean ExecPrefersFloat; /* What preference for color conversion? */
+ GLboolean ExecPrefersFloat; /**< What preference for color conversion? */
GLboolean SavePrefersFloat;
GLvisual Visual;
- GLframebuffer *DrawBuffer; /* buffer for writing */
- GLframebuffer *ReadBuffer; /* buffer for reading */
+ GLframebuffer *DrawBuffer; /**< buffer for writing */
+ GLframebuffer *ReadBuffer; /**< buffer for reading */
- /* Driver function pointer table */
+ /**
+ * Device driver function pointer table
+ */
struct dd_function_table Driver;
- void *DriverCtx; /* Points to device driver context/state */
- void *DriverMgrCtx; /* Points to device driver manager (optional)*/
+ void *DriverCtx; /**< Points to device driver context/state */
+ void *DriverMgrCtx; /**< Points to device driver manager (optional)*/
/* Core/Driver constants */
struct gl_constants Const;
- /* Modelview matrix and stack */
- GLmatrix ModelView; /* current matrix, not stored on stack */
- GLuint ModelViewStackDepth;
- GLmatrix ModelViewStack[MAX_MODELVIEW_STACK_DEPTH - 1];
-
- /* Projection matrix and stack */
- GLmatrix ProjectionMatrix; /* current matrix, not stored on stack */
- GLuint ProjectionStackDepth;
- GLmatrix ProjectionStack[MAX_PROJECTION_STACK_DEPTH - 1];
+ /* The various 4x4 matrix stacks */
+ struct matrix_stack ModelviewMatrixStack;
+ struct matrix_stack ProjectionMatrixStack;
+ struct matrix_stack ColorMatrixStack;
+ struct matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS];
+ struct matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES];
+ struct matrix_stack *CurrentStack; /* Points to one of the above stacks */
/* Combined modelview and projection matrix */
GLmatrix _ModelProjectMatrix;
- /* Texture matrix and stack */
- GLmatrix TextureMatrix[MAX_TEXTURE_UNITS];
- GLuint TextureStackDepth[MAX_TEXTURE_UNITS];
- GLmatrix TextureStack[MAX_TEXTURE_UNITS][MAX_TEXTURE_STACK_DEPTH - 1];
-
- /* Color matrix and stack */
- GLmatrix ColorMatrix;
- GLuint ColorStackDepth;
- GLmatrix ColorStack[MAX_COLOR_STACK_DEPTH - 1];
-
/* Display lists */
GLuint CallDepth; /* Current recursion calling depth */
GLboolean ExecuteFlag; /* Execute GL commands? */
struct gl_color_table PostColorMatrixColorTable;
struct gl_color_table ProxyPostColorMatrixColorTable;
+ struct vertex_program_state VertexProgram; /* GL_NV_vertex_program */
+
GLenum ErrorValue; /* Last error code */
GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */
GLuint NewState; /* bitwise-or of _NEW_* flags */
GLuint _NeedEyeCoords;
GLuint _NeedNormals; /* Are vertex normal vectors needed? */
- struct gl_shine_tab *_ShineTable[2]; /* Active shine tables */
- struct gl_shine_tab *_ShineTabList; /* Mru list of inactive shine tables */
+ struct gl_shine_tab *_ShineTable[2]; /* Active shine tables */
+ struct gl_shine_tab *_ShineTabList; /* Mru list of inactive shine tables */
struct gl_list_extensions listext; /* driver dlist extensions */
- GLboolean OcclusionResult; /* GL_HP_occlusion_test */
- GLboolean OcclusionResultSaved; /* GL_HP_occlusion_test */
+ GLboolean OcclusionResult; /**< for GL_HP_occlusion_test */
+ GLboolean OcclusionResultSaved; /**< for GL_HP_occlusion_test */
/* Z buffer stuff */
- GLuint DepthMax; /* Max depth buffer value */
- GLfloat DepthMaxF; /* Float max depth buffer value */
- GLfloat MRD; /* minimum resolvable difference in Z values */
+ GLuint DepthMax; /**< Max depth buffer value */
+ GLfloat DepthMaxF; /**< Float max depth buffer value */
+ GLfloat MRD; /**< minimum resolvable difference in Z values */
- /* Should 3Dfx Glide driver catch signals? */
+ /** Should 3Dfx Glide driver catch signals? */
GLboolean CatchSignals;
- /* For debugging/development only */
+ /** For debugging/development only */
GLboolean NoRaster;
GLboolean FirstTimeCurrent;
- /* Dither disable via MESA_NO_DITHER env var */
+ /** Dither disable via MESA_NO_DITHER env var */
GLboolean NoDither;
GLboolean Rendering;