summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-03-21 13:30:49 +0100
committerSamuel Pitoiset <[email protected]>2017-05-06 16:40:19 +0200
commit115d938cea5f362c3c078bcc6e75da1245aa6675 (patch)
tree10646e5d45ad873e009b67df7d9bda70bf2f1849 /src/compiler/glsl/glsl_parser.yy
parentcf52b8cd21172e2fc54cb762f2bab18cef217a75 (diff)
glsl: process bindless/bound layout qualifiers
This adds bindless_sampler and bound_sampler (and respectively bindless_image and bound_image) to the parser. v3: - add an extra space in apply_bindless_qualifier_to_variable() - fix indentation in merge_qualifier() Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
-rw-r--r--src/compiler/glsl/glsl_parser.yy21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index e703073c9ca..9cdc37eb9a3 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1589,6 +1589,27 @@ layout_qualifier_id:
}
}
+ /* Layout qualifiers for ARB_bindless_texture. */
+ if (!$$.flags.i) {
+ if (match_layout_qualifier($1, "bindless_sampler", state) == 0)
+ $$.flags.q.bindless_sampler = 1;
+ if (match_layout_qualifier($1, "bound_sampler", state) == 0)
+ $$.flags.q.bound_sampler = 1;
+
+ if (state->has_shader_image_load_store()) {
+ if (match_layout_qualifier($1, "bindless_image", state) == 0)
+ $$.flags.q.bindless_image = 1;
+ if (match_layout_qualifier($1, "bound_image", state) == 0)
+ $$.flags.q.bound_image = 1;
+ }
+
+ if ($$.flags.i && !state->has_bindless()) {
+ _mesa_glsl_error(& @1, state,
+ "qualifier `%s` requires "
+ "ARB_bindless_texture", $1);
+ }
+ }
+
if (!$$.flags.i) {
_mesa_glsl_error(& @1, state, "unrecognized layout identifier "
"`%s'", $1);