diff options
author | Chris Forbes <[email protected]> | 2014-09-21 13:33:14 +1200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-07-23 00:59:27 +0200 |
commit | 7c758c5a216b0a72a089c4fe9b4facde0e7b2726 (patch) | |
tree | e409a4453bd9f050bd360d78151fc909519f2c80 /src/glsl/link_varyings.cpp | |
parent | 1009b3311febe3909e82d4b5be38ceecad6afcc1 (diff) |
glsl: allow linking of tessellation shaders.
Marek: require a tess eval shader if a tess control shader is present
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r-- | src/glsl/link_varyings.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index c1a8f1bb3f7..9174e9c2f2d 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -54,10 +54,16 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog, /* Check that the types match between stages. */ const glsl_type *type_to_match = input->type; - if (consumer_stage == MESA_SHADER_GEOMETRY) { - assert(type_to_match->is_array()); /* Enforced by ast_to_hir */ + + /* VS -> GS, VS -> TCS, VS -> TES, TES -> GS */ + const bool extra_array_level = (producer_stage == MESA_SHADER_VERTEX && + consumer_stage != MESA_SHADER_FRAGMENT) || + consumer_stage == MESA_SHADER_GEOMETRY; + if (extra_array_level) { + assert(type_to_match->is_array()); type_to_match = type_to_match->fields.array; } + if (type_to_match != output->type) { /* There is a bit of a special case for gl_TexCoord. This * built-in is unsized by default. Applications that variable |