summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_interface_blocks.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-09-21 13:33:14 +1200
committerMarek Olšák <[email protected]>2015-07-23 00:59:27 +0200
commit7c758c5a216b0a72a089c4fe9b4facde0e7b2726 (patch)
treee409a4453bd9f050bd360d78151fc909519f2c80 /src/glsl/link_interface_blocks.cpp
parent1009b3311febe3909e82d4b5be38ceecad6afcc1 (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_interface_blocks.cpp')
-rw-r--r--src/glsl/link_interface_blocks.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/glsl/link_interface_blocks.cpp b/src/glsl/link_interface_blocks.cpp
index f9ddb13cd56..936e2e0ba21 100644
--- a/src/glsl/link_interface_blocks.cpp
+++ b/src/glsl/link_interface_blocks.cpp
@@ -134,9 +134,9 @@ intrastage_match(interface_block_definition *a,
* Check if two interfaces match, according to interstage (in/out) interface
* matching rules.
*
- * If \c extra_array_level is true, then vertex-to-geometry shader matching
- * rules are enforced (i.e. a successful match requires the consumer interface
- * to be an array and the producer interface to be a non-array).
+ * If \c extra_array_level is true, the consumer interface is required to be
+ * an array and the producer interface is required to be a non-array.
+ * This is used for tessellation control and geometry shader consumers.
*/
bool
interstage_match(const interface_block_definition *producer,
@@ -318,7 +318,10 @@ validate_interstage_inout_blocks(struct gl_shader_program *prog,
const gl_shader *consumer)
{
interface_block_definitions definitions;
- const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY;
+ /* 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;
/* Add input interfaces from the consumer to the symbol table. */
foreach_in_list(ir_instruction, node, consumer->ir) {