From e4af55c78f9d639653bb9290e0fc63c6658cdc4d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 23 Sep 2013 18:13:52 -0700 Subject: glsl: Create and use a has_explicit_attrib_location() helper. Explicit attribute locations are supported with GLSL 3.30, GLSL ES 3.00, or "#extension GL_ARB_explicit_attrib_location: enable". Using a helper function makes it easy to check for this. This enables support in GLSL 3.30, which was previously missing. Previously, we overrode the extension enable flag for ES 3.00. This is not robust against a shader such as: #version 330 #extension GL_ARB_explicit_attrib_location : disable Disabling extensions should not remove core language functionality. Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/glsl/glsl_parser.yy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glsl/glsl_parser.yy') diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index fa6e2053adf..56ca4ad8b07 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1262,7 +1262,7 @@ layout_qualifier_id: { memset(& $$, 0, sizeof($$)); - if (state->ARB_explicit_attrib_location_enable) { + if (state->has_explicit_attrib_location()) { if (strcmp("location", $1) == 0) { $$.flags.q.explicit_location = 1; -- cgit v1.2.3