aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorFabian Bieler <[email protected]>2014-03-05 13:43:17 +0100
committerMarek Olšák <[email protected]>2015-07-23 00:59:26 +0200
commit1009b3311febe3909e82d4b5be38ceecad6afcc1 (patch)
treec5efbaf2e95c6656617e3b4efd2b3bb8372d53fc /src/glsl/link_varyings.cpp
parent1036b024d4c8ce2376ac41219dfda01d5a59b3ef (diff)
glsl: add the patch in/out qualifier (v2)
v2: Dropped some unrelated reordering in glsl_parser.yy as Ken suggested. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 020842a54a3..c1a8f1bb3f7 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -116,6 +116,18 @@ cross_validate_types_and_qualifiers(struct gl_shader_program *prog,
return;
}
+ if (input->data.patch != output->data.patch) {
+ linker_error(prog,
+ "%s shader output `%s' %s patch qualifier, "
+ "but %s shader input %s patch qualifier\n",
+ _mesa_shader_stage_to_string(producer_stage),
+ output->name,
+ (output->data.patch) ? "has" : "lacks",
+ _mesa_shader_stage_to_string(consumer_stage),
+ (input->data.patch) ? "has" : "lacks");
+ return;
+ }
+
if (!prog->IsES && input->data.invariant != output->data.invariant) {
linker_error(prog,
"%s shader output `%s' %s invariant qualifier, "
@@ -989,7 +1001,8 @@ varying_matches::compute_packing_class(const ir_variable *var)
*
* Therefore, the packing class depends only on the interpolation type.
*/
- unsigned packing_class = var->data.centroid | (var->data.sample << 1);
+ unsigned packing_class = var->data.centroid | (var->data.sample << 1) |
+ (var->data.patch << 2);
packing_class *= 4;
packing_class += var->data.interpolation;
return packing_class;