From: Timothy Arceri Date: Mon, 18 Jan 2016 09:46:29 +0000 (+1100) Subject: glsl: relax stage restrictions on layout defaults for outputs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b407fececeb0e0bcc0e54929db3ef6809655632;p=mesa.git 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 --- 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) {