glsl: Create and use a has_explicit_attrib_location() helper.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 24 Sep 2013 01:13:52 +0000 (18:13 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 26 Sep 2013 23:55:18 +0000 (16:55 -0700)
commite4af55c78f9d639653bb9290e0fc63c6658cdc4d
tree4703a3137ed166cc66a40012481ee3f86cc86b59
parente9b410b54dd893568a50af661fdbba12b4573ed9
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 <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp
src/glsl/glsl_parser.yy
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h