diff options
author | Chris Forbes <[email protected]> | 2014-09-12 21:27:26 +1200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-07-23 00:59:28 +0200 |
commit | 19f46d0540d9557a4d458ceb72f27ece28fa935e (patch) | |
tree | dc87d9f896efdaaee66b45b9a2b8edd7414aa069 /src/glsl/ast_to_hir.cpp | |
parent | 8cf72972ce2fc7df83d0572745968bbcb41a8c92 (diff) |
glsl: allow redeclaration of TCS gl_out[]
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index dad8bceb41a..1cc0731e932 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -5892,16 +5892,28 @@ ast_interface_block::hir(exec_list *instructions, if (ir_variable *earlier_gl_Position = state->symbols->get_variable("gl_Position")) { earlier_per_vertex = earlier_gl_Position->get_interface_type(); + } else if (ir_variable *earlier_gl_out = + state->symbols->get_variable("gl_out")) { + earlier_per_vertex = earlier_gl_out->get_interface_type(); } else { _mesa_glsl_error(&loc, state, "redeclaration of gl_PerVertex output not " "allowed in the %s shader", _mesa_shader_stage_to_string(state->stage)); } - if (this->instance_name != NULL) { - _mesa_glsl_error(&loc, state, - "gl_PerVertex output may not be redeclared with " - "an instance name"); + if (state->stage == MESA_SHADER_TESS_CTRL) { + if (this->instance_name == NULL || + strcmp(this->instance_name, "gl_out") != 0 || this->array_specifier == NULL) { + _mesa_glsl_error(&loc, state, + "gl_PerVertex output must be redeclared as " + "gl_out[]"); + } + } else { + if (this->instance_name != NULL) { + _mesa_glsl_error(&loc, state, + "gl_PerVertex output may not be redeclared with " + "an instance name"); + } } break; default: |