diff options
author | Maxence Le Doré <maxence.ledore@gmail.com> | 2014-12-10 08:09:24 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2014-12-21 21:17:24 +0000 |
commit | 893583776e78d8f311302ad1579378f8aadcdcef (patch) | |
tree | 9097043606b4153b18f8a009b4cb83bfb42c7a95 | |
parent | 2d669f6583bfa788f479d1607c6aa1e21c426ce2 (diff) |
glsl: Add gl_MaxViewports to available builtin constants
It seems to have been forgotten during viewports array implementation time.
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 19e05d68986690cfcdd49de6cfb87d88ad54cd58)
-rw-r--r-- | src/glsl/builtin_variables.cpp | 4 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.cpp | 3 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index c36d19831f8..65e32ad7397 100644 --- a/src/glsl/builtin_variables.cpp +++ b/src/glsl/builtin_variables.cpp @@ -724,6 +724,10 @@ builtin_variable_generator::generate_constants() add_const("gl_MaxCombinedImageUniforms", state->Const.MaxCombinedImageUniforms); } + + if (state->is_version(410, 0) || + state->ARB_viewport_array_enable) + add_const("gl_MaxViewports", state->Const.MaxViewports); } diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 27e3301e209..2fc37da1060 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -134,6 +134,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->Const.MaxFragmentImageUniforms = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms; this->Const.MaxCombinedImageUniforms = ctx->Const.MaxCombinedImageUniforms; + /* ARB_viewport_array */ + this->Const.MaxViewports = ctx->Const.MaxViewports; + this->current_function = NULL; this->toplevel_ir = NULL; this->found_return = false; diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index c14d74c9846..c87c0e1adf3 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -343,6 +343,9 @@ struct _mesa_glsl_parse_state { unsigned MaxGeometryImageUniforms; unsigned MaxFragmentImageUniforms; unsigned MaxCombinedImageUniforms; + + /* ARB_viewport_array */ + unsigned MaxViewports; } Const; /** |