From: Maxence Le Doré Date: Wed, 10 Dec 2014 07:09:24 +0000 (+0100) Subject: glsl: Add gl_MaxViewports to available builtin constants X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19e05d68986690cfcdd49de6cfb87d88ad54cd58;p=mesa.git glsl: Add gl_MaxViewports to available builtin constants It seems to have been forgotten during viewports array implementation time. Cc: "10.4 10.3" Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- 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; /**