diff options
author | Maxence Le Doré <[email protected]> | 2014-12-10 08:09:24 +0100 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-12-15 12:20:00 -0800 |
commit | 19e05d68986690cfcdd49de6cfb87d88ad54cd58 (patch) | |
tree | 42fe52d1fffb3b9d529a61c38d071f2d23247c56 /src | |
parent | 8517e665bc4c378e8e7523827090fd1b06abaecd (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" <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-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 6893c7b82cc..dd02a808e0d 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -135,6 +135,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 e9eb237b0b3..e04f7ced565 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; /** |