From eabe12df44a41e97fb5736959e8864ddbd01be14 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 24 Aug 2009 12:54:48 -0700 Subject: 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. --- src/mesa/main/context.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/mesa/main/context.c') 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; } -- cgit v1.2.3