summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-01-18 20:46:29 +1100
committerTimothy Arceri <[email protected]>2016-03-31 12:50:04 +1100
commit7b407fececeb0e0bcc0e54929db3ef6809655632 (patch)
treeb9abe34df55ca4e5b9d3c278db85053871b742f5 /src/compiler
parentc9afd94af6fa129370eb001077724a77093ecd5a (diff)
glsl: relax stage restrictions on layout defaults for outputs
The new xfb_buffer and xfb_stride global qualifiers are allowed in geom, tess and vertex stages. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_type.cpp5
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp9
2 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp
index ab86577cc3e..8a3b175b63b 100644
--- a/src/compiler/glsl/ast_type.cpp
+++ b/src/compiler/glsl/ast_type.cpp
@@ -381,9 +381,10 @@ ast_type_qualifier::merge_out_qualifier(YYLTYPE *loc,
if (create_node) {
node = new(mem_ctx) ast_tcs_output_layout(*loc);
}
- } else {
+ } else if (!(state->stage == MESA_SHADER_TESS_EVAL ||
+ state->stage == MESA_SHADER_VERTEX)) {
_mesa_glsl_error(loc, state, "out layout qualifiers only valid in "
- "tessellation control or geometry shaders");
+ "geometry, tessellation and vertex shaders");
}
/* Allow future assigments of global out's */
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 76ae0f88167..b88b6220513 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1595,13 +1595,12 @@ set_shader_inout_layout(struct gl_shader *shader,
struct _mesa_glsl_parse_state *state)
{
/* Should have been prevented by the parser. */
- if (shader->Stage == MESA_SHADER_TESS_CTRL) {
+ if (shader->Stage == MESA_SHADER_TESS_CTRL ||
+ shader->Stage == MESA_SHADER_VERTEX) {
assert(!state->in_qualifier->flags.i);
- } else if (shader->Stage == MESA_SHADER_TESS_EVAL) {
- assert(!state->out_qualifier->flags.i);
- } else if (shader->Stage != MESA_SHADER_GEOMETRY) {
+ } else if (shader->Stage != MESA_SHADER_GEOMETRY &&
+ shader->Stage != MESA_SHADER_TESS_EVAL) {
assert(!state->in_qualifier->flags.i);
- assert(!state->out_qualifier->flags.i);
}
if (shader->Stage != MESA_SHADER_COMPUTE) {