summaryrefslogtreecommitdiff
path: root/src/mesa/main/context.c
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/context.c
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/context.c')
-rw-r--r--src/mesa/main/context.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index a9e520716d..4651760d78 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -487,7 +487,7 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
if (type == GL_VERTEX_PROGRAM_ARB) {
- prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS;
+ prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
}
@@ -497,15 +497,17 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS;
}
- /* copy the above limits to init native limits */
- prog->MaxNativeInstructions = prog->MaxInstructions;
- prog->MaxNativeAluInstructions = prog->MaxAluInstructions;
- prog->MaxNativeTexInstructions = prog->MaxTexInstructions;
- prog->MaxNativeTexIndirections = prog->MaxTexIndirections;
- prog->MaxNativeAttribs = prog->MaxAttribs;
- prog->MaxNativeTemps = prog->MaxTemps;
- prog->MaxNativeAddressRegs = prog->MaxAddressRegs;
- prog->MaxNativeParameters = prog->MaxParameters;
+ /* Set the native limits to zero. This implies that there is no native
+ * support for shaders. Let the drivers fill in the actual values.
+ */
+ prog->MaxNativeInstructions = 0;
+ prog->MaxNativeAluInstructions = 0;
+ prog->MaxNativeTexInstructions = 0;
+ prog->MaxNativeTexIndirections = 0;
+ prog->MaxNativeAttribs = 0;
+ prog->MaxNativeTemps = 0;
+ prog->MaxNativeAddressRegs = 0;
+ prog->MaxNativeParameters = 0;
}