summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
-rw-r--r--src/compiler/glsl/glsl_parser.yy34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 09b7e79c40b..e3893d5ec3b 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1372,9 +1372,10 @@ layout_qualifier_id:
}
}
}
+ }
- if (!$$.flags.i &&
- match_layout_qualifier($1, "early_fragment_tests", state) == 0) {
+ if (!$$.flags.i) {
+ if (match_layout_qualifier($1, "early_fragment_tests", state) == 0) {
/* From section 4.4.1.3 of the GLSL 4.50 specification
* (Fragment Shader Inputs):
*
@@ -1393,15 +1394,32 @@ layout_qualifier_id:
$$.flags.q.early_fragment_tests = 1;
}
- if (!$$.flags.i &&
- match_layout_qualifier($1, "post_depth_coverage", state) == 0) {
+ if (match_layout_qualifier($1, "inner_coverage", state) == 0) {
+ if (state->stage != MESA_SHADER_FRAGMENT) {
+ _mesa_glsl_error(& @1, state,
+ "inner_coverage layout qualifier only "
+ "valid in fragment shaders");
+ }
+
+ if (state->INTEL_conservative_rasterization_enable) {
+ $$.flags.q.inner_coverage = 1;
+ } else {
+ _mesa_glsl_error(& @1, state,
+ "inner_coverage layout qualifier present, "
+ "but the INTEL_conservative_rasterization extension "
+ "is not enabled.");
+ }
+ }
+
+ if (match_layout_qualifier($1, "post_depth_coverage", state) == 0) {
if (state->stage != MESA_SHADER_FRAGMENT) {
_mesa_glsl_error(& @1, state,
"post_depth_coverage layout qualifier only "
"valid in fragment shaders");
}
- if (state->ARB_post_depth_coverage_enable) {
+ if (state->ARB_post_depth_coverage_enable ||
+ state->INTEL_conservative_rasterization_enable) {
$$.flags.q.post_depth_coverage = 1;
} else {
_mesa_glsl_error(& @1, state,
@@ -1410,6 +1428,12 @@ layout_qualifier_id:
"is not enabled.");
}
}
+
+ if ($$.flags.q.post_depth_coverage && $$.flags.q.inner_coverage) {
+ _mesa_glsl_error(& @1, state,
+ "post_depth_coverage & inner_coverage layout qualifiers "
+ "are mutually exclusive");
+ }
}
/* Layout qualifiers for tessellation evaluation shaders. */