aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-12-22 16:37:40 +1100
committerTimothy Arceri <[email protected]>2016-05-01 23:13:15 +1000
commit0317dfcd9b32e37d5a993662c8cab75fbdbed44e (patch)
treeb9fdd153b70b8007c4f89105644b26f6bb369465 /src
parent0d88b15f073d09afed1747d9cdde98f15c7aa28d (diff)
glsl: update explicit location matching to support component qualifier
This is needed so we don't optimise away the varying when more than one shares the same location. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/linker.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 7bd795c9a38..975b299db55 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2843,7 +2843,7 @@ match_explicit_outputs_to_inputs(struct gl_shader_program *prog,
gl_shader *consumer)
{
glsl_symbol_table parameters;
- ir_variable *explicit_locations[MAX_VARYING] = { NULL };
+ ir_variable *explicit_locations[MAX_VARYING][4] = { {NULL, NULL} };
/* Find all shader outputs in the "producer" stage.
*/
@@ -2856,8 +2856,8 @@ match_explicit_outputs_to_inputs(struct gl_shader_program *prog,
if (var->data.explicit_location &&
var->data.location >= VARYING_SLOT_VAR0) {
const unsigned idx = var->data.location - VARYING_SLOT_VAR0;
- if (explicit_locations[idx] == NULL)
- explicit_locations[idx] = var;
+ if (explicit_locations[idx][var->data.location_frac] == NULL)
+ explicit_locations[idx][var->data.location_frac] = var;
}
}
@@ -2871,7 +2871,8 @@ match_explicit_outputs_to_inputs(struct gl_shader_program *prog,
ir_variable *output = NULL;
if (input->data.explicit_location
&& input->data.location >= VARYING_SLOT_VAR0) {
- output = explicit_locations[input->data.location - VARYING_SLOT_VAR0];
+ output = explicit_locations[input->data.location - VARYING_SLOT_VAR0]
+ [input->data.location_frac];
if (output != NULL){
input->data.is_unmatched_generic_inout = 0;