summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2015-11-21 12:47:25 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2015-12-01 12:45:03 +1100
commit12ba6cfba7974cdf4609b146303a5988447d30c2 (patch)
tree9f3c004317ca9cee410a1a8b4954b88079d3f564 /src/glsl/link_varyings.cpp
parent4d64459a92a4c1a64fb7051fd1320c14c1854dcb (diff)
downloadexternal_mesa3d-12ba6cfba7974cdf4609b146303a5988447d30c2.zip
external_mesa3d-12ba6cfba7974cdf4609b146303a5988447d30c2.tar.gz
external_mesa3d-12ba6cfba7974cdf4609b146303a5988447d30c2.tar.bz2
glsl: optimise inputs/outputs with explicit locations
This change allows used defined inputs/outputs with explicit locations to be removed if they are detected to not be used between shaders at link time. To enable this we change the is_unmatched_generic_inout field to be flagged when we have a user defined varying. Previously explicit_location was assumed to be set only in builtins however SSO allows the user to set an explicit location. We then add a function to match explicit locations between shaders. V2: call match_explicit_outputs_to_inputs() after is_unmatched_generic_inout has been initialised. Cc: Gregory Hainaut <gregory.hainaut@gmail.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index c0b4b3e..ac2755f 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -896,8 +896,10 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
{
assert(producer_var != NULL || consumer_var != NULL);
- if ((producer_var && !producer_var->data.is_unmatched_generic_inout)
- || (consumer_var && !consumer_var->data.is_unmatched_generic_inout)) {
+ if ((producer_var && (!producer_var->data.is_unmatched_generic_inout ||
+ producer_var->data.explicit_location)) ||
+ (consumer_var && (!consumer_var->data.is_unmatched_generic_inout ||
+ consumer_var->data.explicit_location))) {
/* Either a location already exists for this variable (since it is part
* of fixed functionality), or it has already been recorded as part of a
* previous match.