summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2014-03-05 12:35:03 +0200
committerTapani Pälli <tapani.palli@intel.com>2014-06-16 06:49:59 +0300
commite8fb8b1bb35ff22897df9b6d607f3cb2a203f88c (patch)
tree5c9013bba2e2ee66c70fb58837352bea9819e74e /src/glsl/glsl_parser_extras.h
parent8381f0f0c375308f96b602ba27315d3824c86e8a (diff)
downloadexternal_mesa3d-e8fb8b1bb35ff22897df9b6d607f3cb2a203f88c.zip
external_mesa3d-e8fb8b1bb35ff22897df9b6d607f3cb2a203f88c.tar.gz
external_mesa3d-e8fb8b1bb35ff22897df9b6d607f3cb2a203f88c.tar.bz2
glsl: parser changes for GL_ARB_explicit_uniform_location
Patch adds a preprocessor define for the extension and stores explicit location data for uniforms during AST->HIR conversion. It also sets layout token to be available when having the extension in place. v2: change parser check to require GLSL 330 or enabling GL_ARB_explicit_attrib_location (Ian) v3: fix the check and comment in AST->HIR (Petri) Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r--src/glsl/glsl_parser_extras.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 6459cac..a59090f 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -151,6 +151,21 @@ struct _mesa_glsl_parse_state {
return true;
}
+ bool check_explicit_uniform_location_allowed(YYLTYPE *locp,
+ const ir_variable *var)
+ {
+ if (!this->has_explicit_attrib_location() ||
+ !this->ARB_explicit_uniform_location_enable) {
+ _mesa_glsl_error(locp, this,
+ "uniform explicit location requires "
+ "GL_ARB_explicit_uniform_location and either "
+ "GL_ARB_explicit_attrib_location or GLSL 330.");
+ return false;
+ }
+
+ return true;
+ }
+
bool has_explicit_attrib_location() const
{
return ARB_explicit_attrib_location_enable || is_version(330, 300);