summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r--src/glsl/glsl_parser_extras.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 884e83e2f62..300d9005117 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -135,6 +135,23 @@ struct _mesa_glsl_parse_state {
return true;
}
+ bool check_separate_shader_objects_allowed(YYLTYPE *locp,
+ const ir_variable *var)
+ {
+ if (!this->has_separate_shader_objects()) {
+ const char *const requirement = this->es_shader
+ ? "GL_EXT_separate_shader_objects (not supported by this "
+ "implementation)"
+ : "GL_ARB_separate_shader_objects extension or GLSL 420";
+
+ _mesa_glsl_error(locp, this, "%s explicit location requires %s",
+ mode_string(var), requirement);
+ return false;
+ }
+
+ return true;
+ }
+
bool has_explicit_attrib_location() const
{
return ARB_explicit_attrib_location_enable || is_version(330, 300);