From 2910a82eb43bafc73d542336c21f415f5f4a3bed Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Fri, 26 Jul 2013 11:55:52 -0700 Subject: glsl: Add new GLSL 1.50 constants. This patch populates the following built-in GLSL 1.50 variables based on constants stored in ctx->Const: - gl_MaxVertexOutputComponents - gl_MaxGeometryInputComponents - gl_MaxGeometryOutputComponents - gl_MaxFragmentInputComponents - gl_MaxGeometryTextureImageUnits - gl_MaxGeometryOutputVertices - gl_MaxGeometryTotalOutputComponents - gl_MaxGeometryUniformComponents - gl_MaxGeometryVaryingComponents On i965/gen7, fixes all Piglit tests in "spec/glsl-1.50/built-in constants/*" except for gl_MaxCombinedTextureImageUnits and gl_MaxGeometryUniformComponents. Reviewed-by: Matt Turner --- src/glsl/glsl_parser_extras.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/glsl/glsl_parser_extras.cpp') diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index f1cabf4be4c..be17109e134 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -108,6 +108,16 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers; + /* 1.50 constants */ + this->Const.MaxVertexOutputComponents = ctx->Const.VertexProgram.MaxOutputComponents; + this->Const.MaxGeometryInputComponents = ctx->Const.GeometryProgram.MaxInputComponents; + this->Const.MaxGeometryOutputComponents = ctx->Const.GeometryProgram.MaxOutputComponents; + this->Const.MaxFragmentInputComponents = ctx->Const.FragmentProgram.MaxInputComponents; + this->Const.MaxGeometryTextureImageUnits = ctx->Const.GeometryProgram.MaxTextureImageUnits; + this->Const.MaxGeometryOutputVertices = ctx->Const.MaxGeometryOutputVertices; + this->Const.MaxGeometryTotalOutputComponents = ctx->Const.MaxGeometryTotalOutputComponents; + this->Const.MaxGeometryUniformComponents = ctx->Const.GeometryProgram.MaxUniformComponents; + this->current_function = NULL; this->toplevel_ir = NULL; this->found_return = false; -- cgit v1.2.3