summaryrefslogtreecommitdiff
path: root/src/mesa/main/mtypes.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2008-12-31 11:54:02 -0700
committerBrian Paul <brianp@vmware.com>2008-12-31 12:00:17 -0700
commite9b34885b8ff2ccb67a801cd1ce07e0df1b0e397 (patch)
tree588afee46d734cba7e002fdc01cfc588a999f52e /src/mesa/main/mtypes.h
parentbfebeffc0045266d354a36968336337e099a9f27 (diff)
mesa: increase max texture image units and GLSL samplers to 16
The max texture coord units is still 8. All the fixed-function paths are still limited to 8 too. But GLSL shaders can use more samplers now. Note that some texcoord-related data structures are declared to be 16 elements in size rather than 8. This just simplifies the code in a few places; the extra elements aren't accessible to the user. These changes haven't been extensively tested yet, but sanity checking has been done. It should be possible to increase the max image units/samplers to 32 without doing anything special. Beyond that we'll need longer bitfields in a few places.
Diffstat (limited to 'src/mesa/main/mtypes.h')
-rw-r--r--src/mesa/main/mtypes.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 5ed73b7d0e..9cb6159f00 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,15 +1,9 @@
-/**
- * \file mtypes.h
- * Main Mesa data structures.
- *
- * Please try to mark derived values with a leading underscore ('_').
- */
-
/*
* Mesa 3-D graphics library
* Version: 7.3
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 VMware, Inc. 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"),
@@ -29,7 +23,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/**
+ * \file mtypes.h
+ * Main Mesa data structures.
+ *
+ * Please try to mark derived values with a leading underscore ('_').
+ */
#ifndef TYPES_H
#define TYPES_H
@@ -639,7 +638,7 @@ struct gl_current_attrib
GLfloat RasterColor[4];
GLfloat RasterSecondaryColor[4];
GLfloat RasterIndex;
- GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4];
+ GLfloat RasterTexCoords[MAX_TEXTURE_UNITS][4];
GLboolean RasterPosValid;
/*@}*/
};
@@ -723,10 +722,10 @@ struct gl_enable_attrib
GLboolean SampleCoverage; /* GL_ARB_multisample */
GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */
- GLuint Texture[MAX_TEXTURE_IMAGE_UNITS];
- GLuint TexGen[MAX_TEXTURE_COORD_UNITS];
+ GLuint Texture[MAX_TEXTURE_UNITS];
+ GLuint TexGen[MAX_TEXTURE_UNITS];
/* SGI_texture_color_table */
- GLboolean TextureColorTable[MAX_TEXTURE_IMAGE_UNITS];
+ GLboolean TextureColorTable[MAX_TEXTURE_UNITS];
/* GL_ARB_vertex_program / GL_NV_vertex_program */
GLboolean VertexProgram;
GLboolean VertexProgramPointSize;
@@ -1069,7 +1068,7 @@ struct gl_point_attrib
GLfloat Threshold; /**< GL_EXT_point_parameters */
GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */
GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */
- GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite */
+ GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /**< GL_ARB_point_sprite */
GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */
GLenum SpriteOrigin; /**< GL_ARB_point_sprite */
};
@@ -1557,7 +1556,7 @@ struct gl_texture_attrib
* name multitexture
*/
/**@{*/
- GLuint CurrentUnit; /**< Active texture unit */
+ GLuint CurrentUnit; /**< Active texture unit [0, MaxTextureImageUnits-1] */
GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */
GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */
GLbitfield _GenFlags; /**< for texgen */
@@ -1875,7 +1874,7 @@ struct gl_program
GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */
GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */
GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
- GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
+ GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */
GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */
@@ -2469,9 +2468,9 @@ struct gl_constants
GLint MaxTextureRectSize; /* GL_NV_texture_rectangle */
GLuint MaxTextureCoordUnits;
GLuint MaxTextureImageUnits;
- GLuint MaxTextureUnits; /* = MIN(CoordUnits, ImageUnits) */
- GLfloat MaxTextureMaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
- GLfloat MaxTextureLodBias; /* GL_EXT_texture_lod_bias */
+ GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */
+ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
+ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */
GLuint MaxArrayLockSize;
GLint SubPixelBits;
GLfloat MinPointSize, MaxPointSize; /* aliased */
@@ -2946,7 +2945,7 @@ struct __GLcontextRec
struct gl_matrix_stack ModelviewMatrixStack;
struct gl_matrix_stack ProjectionMatrixStack;
struct gl_matrix_stack ColorMatrixStack;
- struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_COORD_UNITS];
+ struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS];
struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES];
struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */
/*@}*/