glsl: add gl_MaxSamples, new in GL 4.5 / GL ES 3.2
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 19 Feb 2016 18:20:48 +0000 (13:20 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 31 Mar 2016 02:57:17 +0000 (22:57 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h

index 76a22cee29c53aa39f71334aeb54c8229dce96c0..6a772911f7651823a8e1e54da028a6c54426a61d 100644 (file)
@@ -878,6 +878,9 @@ builtin_variable_generator::generate_constants()
       add_const("gl_MaxTessControlUniformComponents", state->Const.MaxTessControlUniformComponents);
       add_const("gl_MaxTessEvaluationUniformComponents", state->Const.MaxTessEvaluationUniformComponents);
    }
+
+   if (state->is_version(450, 320))
+      add_const("gl_MaxSamples", state->Const.MaxSamples);
 }
 
 
index 0ce89ceb3a843fdf3a8f31282eed78026ec4c769..e592e5cd55c8988dc1bab3e6bd6cda4127f8cdfb 100644 (file)
@@ -179,6 +179,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
    this->Const.MaxTessControlUniformComponents = ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxUniformComponents;
    this->Const.MaxTessEvaluationUniformComponents = ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxUniformComponents;
 
+   /* GL 4.5 / OES_sample_variables */
+   this->Const.MaxSamples = ctx->Const.MaxSamples;
+
    this->current_function = NULL;
    this->toplevel_ir = NULL;
    this->found_return = false;
index 86008b4851907ec0f850ccf58df3067615111cca..6185d14a20dd6878dfe6203bd5e0099355da503d 100644 (file)
@@ -461,6 +461,9 @@ struct _mesa_glsl_parse_state {
       unsigned MaxTessControlTotalOutputComponents;
       unsigned MaxTessControlUniformComponents;
       unsigned MaxTessEvaluationUniformComponents;
+
+      /* GL 4.5 / OES_sample_variables */
+      unsigned MaxSamples;
    } Const;
 
    /**