summaryrefslogtreecommitdiff
path: root/src/mesa/main/config.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/config.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/config.h')
-rw-r--r--src/mesa/main/config.h53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 424ed60b571..cf1198cd0d5 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,13 +1,9 @@
-/**
- * \file config.h
- * Tunable configuration parameters.
- */
-
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.3
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 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"),
@@ -27,6 +23,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/**
+ * \file config.h
+ * Tunable configuration parameters.
+ */
#ifndef MESA_CONFIG_H_INCLUDED
#define MESA_CONFIG_H_INCLUDED
@@ -115,27 +115,28 @@
/** Maximum number of layers in a 1D or 2D array texture - GL_MESA_texture_array */
#define MAX_ARRAY_TEXTURE_LAYERS 64
-/** Number of texture units - GL_ARB_multitexture
- * This needs to be the larger of MAX_TEXTURE_COORD_UNITS and
- * MAX_TEXTURE_IMAGE_UNITS seen below, since MAX_TEXTURE_UNITS is used
- * to dimension some arrays that store both coord and image data.
-*/
-#define MAX_TEXTURE_UNITS 8
-
-/*@}*/
+/**
+ * Max number of texture coordinate units. This mainly just applies to
+ * the fixed-function vertex code. This will be difficult to raise above
+ * eight because of various vertex attribute bitvectors.
+ */
+#define MAX_TEXTURE_COORD_UNITS 8
+/**
+ * Max number of texture image units. Also determines number of texture
+ * samplers in shaders.
+ */
+#define MAX_TEXTURE_IMAGE_UNITS 16
/**
- * \name Separate numbers of texture coordinates and texture image units.
- *
- * These values will eventually replace most instances of MAX_TEXTURE_UNITS.
- * We should always have MAX_TEXTURE_COORD_UNITS <= MAX_TEXTURE_IMAGE_UNITS.
- * And, GL_MAX_TEXTURE_UNITS <= MAX_TEXTURE_COORD_UNITS.
+ * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS.
+ * This value is only used for dimensioning arrays.
+ * Either MAX_TEXTURE_COORD_UNITS or MAX_TEXTURE_IMAGE_UNITS (or the
+ * corresponding ctx->Const.MaxTextureCoord/ImageUnits fields) should be
+ * used almost everywhere else.
*/
-/*@{*/
-#define MAX_TEXTURE_COORD_UNITS 8
-#define MAX_TEXTURE_IMAGE_UNITS 8
-/*@}*/
+#define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS)
+
/**
* Maximum viewport/image width. Must accomodate all texture sizes too.
@@ -192,7 +193,7 @@
#define MAX_PROGRAM_ADDRESS_REGS 2
#define MAX_UNIFORMS 256 /**< number of vec4 uniforms */
#define MAX_VARYING 8 /**< number of float[4] vectors */
-#define MAX_SAMPLERS 8
+#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
#define MAX_PROGRAM_INPUTS 32
#define MAX_PROGRAM_OUTPUTS 32
/*@}*/
@@ -220,8 +221,8 @@
/** For GL_ARB_vertex_shader */
/*@{*/
#define MAX_VERTEX_ATTRIBS 16
-#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_UNITS
-#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS)
+#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
+#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS
/*@}*/