diff options
| author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-08-18 14:37:47 +0200 |
|---|---|---|
| committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-08-18 14:37:47 +0200 |
| commit | 3e54d63429fe7ca5db3c75c181abbaf7a7f55724 (patch) | |
| tree | e129c36aaef712525f0a04fc5b06c445e3cf84df /src/mesa/main/context.c | |
| parent | eaab76457818fad0926b84c663440e8987e1f19f (diff) | |
| parent | 85d9bc236d6a8ff8f12cbc2150f8c3740354f573 (diff) | |
Merge remote branch 'origin/master' into nv50-compiler
Diffstat (limited to 'src/mesa/main/context.c')
| -rw-r--r-- | src/mesa/main/context.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index a369532e99..b01fed1781 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -462,7 +462,7 @@ _mesa_init_current(GLcontext *ctx) /** - * Init vertex/fragment program limits. + * Init vertex/fragment/geometry program limits. * Important: drivers should override these with actual limits. */ static void @@ -477,16 +477,18 @@ init_program_limits(GLenum type, struct gl_program_constants *prog) prog->MaxLocalParams = MAX_PROGRAM_LOCAL_PARAMS; prog->MaxUniformComponents = 4 * MAX_UNIFORMS; - if (type == GL_VERTEX_PROGRAM_ARB) { + switch (type) { + case GL_VERTEX_PROGRAM_ARB: prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; - } - else if (type == GL_FRAGMENT_PROGRAM_ARB) { + break; + case GL_FRAGMENT_PROGRAM_ARB: prog->MaxParameters = MAX_NV_FRAGMENT_PROGRAM_PARAMS; prog->MaxAttribs = MAX_NV_FRAGMENT_PROGRAM_INPUTS; prog->MaxAddressRegs = MAX_FRAGMENT_PROGRAM_ADDRESS_REGS; - } else { + break; + case MESA_GEOMETRY_PROGRAM: prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS; prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; @@ -497,6 +499,9 @@ init_program_limits(GLenum type, struct gl_program_constants *prog) prog->MaxGeometryUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS; prog->MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES; prog->MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; + break; + default: + assert(0 && "Bad program type in init_program_limits()"); } /* Set the native limits to zero. This implies that there is no native |
