diff options
author | Francisco Jerez <[email protected]> | 2014-02-12 17:10:09 +0100 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2014-02-12 18:44:05 +0100 |
commit | fcd869ed56db83cfdafe8af030518cd8cf7f5708 (patch) | |
tree | deeb08dad5e2bc11a1fca55c1bfa297eff5c5fac /src/glsl/glsl_parser.yy | |
parent | b0b26faa25110df16791f20e5560beb57a27894a (diff) |
glsl/parser: Handle the early_fragment_tests input layout qualifier.
v2: Only allow the early_fragment_tests qualifier in fragment shaders.
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser.yy')
-rw-r--r-- | src/glsl/glsl_parser.yy | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index e43bc4f17ba..2b5061d4c57 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1231,6 +1231,15 @@ layout_qualifier_id: } } + /* Layout qualifiers for ARB_shader_image_load_store. */ + if (state->ARB_shader_image_load_store_enable || + state->is_version(420, 0)) { + if (!$$.flags.i && + match_layout_qualifier($1, "early_fragment_tests", state) == 0) { + $$.flags.q.early_fragment_tests = 1; + } + } + if (!$$.flags.i) { _mesa_glsl_error(& @1, state, "unrecognized layout identifier " "`%s'", $1); @@ -2388,6 +2397,13 @@ layout_defaults: } } break; + case MESA_SHADER_FRAGMENT: + if ($1.flags.q.early_fragment_tests) { + state->early_fragment_tests = true; + } else { + _mesa_glsl_error(& @1, state, "invalid input layout qualifier"); + } + break; case MESA_SHADER_COMPUTE: { if ($1.flags.q.local_size == 0) { _mesa_glsl_error(& @1, state, @@ -2409,7 +2425,7 @@ layout_defaults: default: _mesa_glsl_error(& @1, state, "input layout qualifiers only valid in " - "geometry and compute shaders"); + "geometry, fragment and compute shaders"); break; } } |