summaryrefslogtreecommitdiff
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-07-22 16:20:36 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-07-22 16:50:36 -0700
commitaa9f86ae8b3bb2172092ff9b50751677c509e6b4 (patch)
treecff9cb7d2253c00f5736e92b05f7f30113054c8c /src/glsl/glsl_parser_extras.cpp
parent40c4298a6ea9e83b49858916d5423fd2135ef39c (diff)
glsl2: Fix standalone compiler to not crash horribly.
ir_to_mesa was updated for the _mesa_glsl_parse_state constructor changes, but main.cpp was not.
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index bcf2579733..009aabcd35 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -68,10 +68,33 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct __GLcontextRec *ctx,
this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
} else {
+ /* If there is no GL context (standalone compiler), fill in constants
+ * with the minimum required values.
+ */
static struct gl_extensions null_extensions;
memset(&null_extensions, 0, sizeof(null_extensions));
this->extensions = &null_extensions;
+
+ /* 1.10 minimums. */
+ this->Const.MaxLights = 8;
+ this->Const.MaxClipPlanes = 8;
+ this->Const.MaxTextureUnits = 2;
+
+ /* More than the 1.10 minimum to appease parser tests taken from
+ * apps that (hopefully) already checked the number of coords.
+ */
+ this->Const.MaxTextureCoords = 4;
+
+ this->Const.MaxVertexAttribs = 16;
+ this->Const.MaxVertexUniformComponents = 512;
+ this->Const.MaxVaryingFloats = 32;
+ this->Const.MaxVertexTextureImageUnits = 0;
+ this->Const.MaxCombinedTextureImageUnits = 2;
+ this->Const.MaxTextureImageUnits = 2;
+ this->Const.MaxFragmentUniformComponents = 64;
+
+ this->Const.MaxDrawBuffers = 2;
}
}