aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/glsl_parser_extras.h')
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h
index 2a5aea477..fd1391c2a 100644
--- a/mesalib/src/glsl/glsl_parser_extras.h
+++ b/mesalib/src/glsl/glsl_parser_extras.h
@@ -123,6 +123,19 @@ struct _mesa_glsl_parse_state {
return check_version(130, 300, locp, "bit-wise operations are forbidden");
}
+ bool check_explicit_attrib_stream_allowed(YYLTYPE *locp)
+ {
+ if (!this->has_explicit_attrib_stream()) {
+ const char *const requirement = "GL_ARB_gpu_shader5 extension or GLSL 400";
+
+ _mesa_glsl_error(locp, this, "explicit stream requires %s",
+ requirement);
+ return false;
+ }
+
+ return true;
+ }
+
bool check_explicit_attrib_location_allowed(YYLTYPE *locp,
const ir_variable *var)
{
@@ -170,6 +183,11 @@ struct _mesa_glsl_parse_state {
return true;
}
+ bool has_explicit_attrib_stream() const
+ {
+ return ARB_gpu_shader5_enable || is_version(400, 0);
+ }
+
bool has_explicit_attrib_location() const
{
return ARB_explicit_attrib_location_enable || is_version(330, 300);