diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/config.h | 2 | ||||
-rw-r--r-- | src/mesa/main/context.c | 15 | ||||
-rw-r--r-- | src/mesa/main/imports.c | 2 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 18 | ||||
-rw-r--r-- | src/mesa/main/querymatrix.c | 6 |
5 files changed, 24 insertions, 19 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 32f7d969d8d..0f2d1a8f8da 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -177,7 +177,7 @@ /** * Per-program constants (power of two) * - * \c MAX_PROGRAM_LOCAL_PARAMS and \c MAX_UNIFORMS are just the assmebly shader + * \c MAX_PROGRAM_LOCAL_PARAMS and \c MAX_UNIFORMS are just the assembly 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. diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index a369532e99c..b01fed1781e 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 diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c3993510967..46e5c932d0f 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -756,7 +756,7 @@ _mesa_strdup( const char *s ) float _mesa_strtof( const char *s, char **end ) { -#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) +#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) static locale_t loc = NULL; if (!loc) { loc = newlocale(LC_CTYPE_MASK, "C", NULL); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e89f55befe4..b8bcda56bfa 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2505,29 +2505,29 @@ struct gl_framebuffer /** - * Limits for vertex and fragment programs. + * Limits for vertex and fragment programs/shaders. */ struct gl_program_constants { /* logical limits */ GLuint MaxInstructions; - GLuint MaxAluInstructions; /* fragment programs only, for now */ - GLuint MaxTexInstructions; /* fragment programs only, for now */ - GLuint MaxTexIndirections; /* fragment programs only, for now */ + GLuint MaxAluInstructions; + GLuint MaxTexInstructions; + GLuint MaxTexIndirections; GLuint MaxAttribs; GLuint MaxTemps; - GLuint MaxAddressRegs; /* vertex program only, for now */ + GLuint MaxAddressRegs; GLuint MaxParameters; GLuint MaxLocalParams; GLuint MaxEnvParams; /* native/hardware limits */ GLuint MaxNativeInstructions; - GLuint MaxNativeAluInstructions; /* fragment programs only, for now */ - GLuint MaxNativeTexInstructions; /* fragment programs only, for now */ - GLuint MaxNativeTexIndirections; /* fragment programs only, for now */ + GLuint MaxNativeAluInstructions; + GLuint MaxNativeTexInstructions; + GLuint MaxNativeTexIndirections; GLuint MaxNativeAttribs; GLuint MaxNativeTemps; - GLuint MaxNativeAddressRegs; /* vertex program only, for now */ + GLuint MaxNativeAddressRegs; GLuint MaxNativeParameters; /* For shaders */ GLuint MaxUniformComponents; diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c index 6f62415ba8c..32aaa79f7fb 100644 --- a/src/mesa/main/querymatrix.c +++ b/src/mesa/main/querymatrix.c @@ -36,9 +36,9 @@ #define INT_TO_FIXED(x) ((GLfixed) ((x) << 16)) #define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0)) -#if defined(WIN32) || defined(_WIN32_WCE) +#if defined(_MSC_VER) /* Oddly, the fpclassify() function doesn't exist in such a form - * on Windows. This is an implementation using slightly different + * on MSVC. This is an implementation using slightly different * lower-level Windows functions. */ #include <float.h> @@ -72,7 +72,7 @@ fpclassify(double x) #elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ - (defined(__sun) && defined(__C99FEATURES__)) + (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) /* fpclassify is available. */ |