summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2016-11-30 14:47:41 +0000
committerLionel Landwerlin <[email protected]>2016-12-07 11:02:16 +0000
commit039d836d6ea5621ede88ff3504be841a6dd865c6 (patch)
treeb3a34fad43bb1cb7b85b5641ce02fbcc6673a772 /src/compiler/glsl/glsl_parser.yy
parent0ff74a8990d9fe37365beb35ed8abacfbf3ed567 (diff)
mesa: add support for GL_INTEL_conservative_rasterization
Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
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. */