summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glsl_parser.yy
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-07-19 20:10:21 -0700
committerFrancisco Jerez <[email protected]>2016-08-24 13:28:30 -0700
commit19e929a1774938cb826f68592dc87c520d048597 (patch)
treed554d347f79c36b88404ad6ba85b6fa898480361 /src/compiler/glsl/glsl_parser.yy
parentb49d8f20f43ec429e6c17e7d92c7c2d3f926ee5e (diff)
glsl: Handle the inout qualifier in fragment shader output declarations.
According to the EXT_shader_framebuffer_fetch extension the inout qualifier can be used on ESSL 3.0+ shaders to declare a special kind of fragment output that gets implicitly initialized with the previous framebuffer contents at the current fragment coordinates. In addition we allow using the same language to define FB fetch outputs in GLSL 1.3+ shaders in preparation for the desktop MESA_shader_framebuffer_fetch extensions. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
-rw-r--r--src/compiler/glsl/glsl_parser.yy12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 5b6586141d8..f2853da0848 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1944,6 +1944,18 @@ storage_qualifier:
$$.xfb_buffer = state->out_qualifier->xfb_buffer;
}
}
+ | INOUT_TOK
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.flags.q.in = 1;
+ $$.flags.q.out = 1;
+
+ if (!state->has_framebuffer_fetch() ||
+ !state->is_version(130, 300) ||
+ state->stage != MESA_SHADER_FRAGMENT)
+ _mesa_glsl_error(&@1, state, "A single interface variable cannot be "
+ "declared as both input and output");
+ }
| UNIFORM
{
memset(& $$, 0, sizeof($$));