summaryrefslogtreecommitdiff
path: root/src/mesa/main/config.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-08-24 12:54:48 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-08-26 22:05:53 -0700
commiteabe12df44a41e97fb5736959e8864ddbd01be14 (patch)
tree754fd01ac75f14f07322d8a9061d0ecc8a33e759 /src/mesa/main/config.h
parent20d9204fbd71aebf870834b612579419d2c278b5 (diff)
ARB prog: Change handling of program parameter limits
Several changes are made to program parameter limits. Several of the non-NATIVE limits are set higher. All of the NATIVE limits are set to zero in the core Mesa code. Each driver must set the actual value in its context creation routine. If the NATIVE value remains zero, this indicates that hardware shaders may not be supported. Each of the preceeding changes matches the bahavior of Apple's shader assembler, so it seems safe. Finally, we limit the value of MaxEnvParams to be no greater than MaxNativeAttribs. At least one case has been found where an application does the wrong thing if MaxNativeAttribs < MaxEnvParams. See also bugzilla #23490.
Diffstat (limited to 'src/mesa/main/config.h')
-rw-r--r--src/mesa/main/config.h56
1 files changed, 39 insertions, 17 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index e4995c35c4..8a09efdb53 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -170,9 +170,48 @@
/** For GL_EXT_texture_lod_bias (typically MAX_TEXTURE_LEVELS - 1) */
#define MAX_TEXTURE_LOD_BIAS 12.0
+/** For any program target/extension */
+/*@{*/
+#define MAX_PROGRAM_INSTRUCTIONS (16 * 1024)
+
+/**
+ * Per-program constants (power of two)
+ *
+ * \c MAX_PROGRAM_LOCAL_PARAMS and \c MAX_UNIFORMS are just the assmebly shader
+ * and GLSL shader names for the same thing. They should \b always have the
+ * same value. Each refers to the number of vec4 values supplied as
+ * per-program parameters.
+ */
+/*@{*/
+#define MAX_PROGRAM_LOCAL_PARAMS 1024
+#define MAX_UNIFORMS 1024
+/*@}*/
+
+/**
+ * Per-context constants (power of two)
+ *
+ * \note
+ * This value should always be less than or equal to \c MAX_PROGRAM_LOCAL_PARAMS
+ * and \c MAX_VERTEX_PROGRAM_PARAMS. Otherwise some applications will make
+ * incorrect assumptions.
+ */
+#define MAX_PROGRAM_ENV_PARAMS 256
+
+#define MAX_PROGRAM_MATRICES 8
+#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
+#define MAX_PROGRAM_CALL_DEPTH 8
+#define MAX_PROGRAM_TEMPS 256
+#define MAX_PROGRAM_ADDRESS_REGS 2
+#define MAX_VARYING 16 /**< number of float[4] vectors */
+#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
+#define MAX_PROGRAM_INPUTS 32
+#define MAX_PROGRAM_OUTPUTS 32
+/*@}*/
+
/** For GL_ARB_vertex_program */
/*@{*/
#define MAX_VERTEX_PROGRAM_ADDRESS_REGS 1
+#define MAX_VERTEX_PROGRAM_PARAMS MAX_UNIFORMS
/*@}*/
/** For GL_ARB_fragment_program */
@@ -180,23 +219,6 @@
#define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0
/*@}*/
-/** For any program target/extension */
-/*@{*/
-#define MAX_PROGRAM_INSTRUCTIONS (16 * 1024)
-#define MAX_PROGRAM_LOCAL_PARAMS 256 /**< per-program constants (power of two) */
-#define MAX_PROGRAM_ENV_PARAMS 256 /**< per-context constants (power of two) */
-#define MAX_PROGRAM_MATRICES 8
-#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
-#define MAX_PROGRAM_CALL_DEPTH 8
-#define MAX_PROGRAM_TEMPS 256
-#define MAX_PROGRAM_ADDRESS_REGS 2
-#define MAX_UNIFORMS 1024 /**< number of vec4 uniforms */
-#define MAX_VARYING 16 /**< number of float[4] vectors */
-#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
-#define MAX_PROGRAM_INPUTS 32
-#define MAX_PROGRAM_OUTPUTS 32
-/*@}*/
-
/** For GL_NV_vertex_program */
/*@{*/
#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128