mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
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 <anuj.phogat@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
0d88b15f07
commit
0317dfcd9b
1 changed files with 5 additions and 4 deletions
|
|
@ -2843,7 +2843,7 @@ match_explicit_outputs_to_inputs(struct gl_shader_program *prog,
|
||||||
gl_shader *consumer)
|
gl_shader *consumer)
|
||||||
{
|
{
|
||||||
glsl_symbol_table parameters;
|
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.
|
/* 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 &&
|
if (var->data.explicit_location &&
|
||||||
var->data.location >= VARYING_SLOT_VAR0) {
|
var->data.location >= VARYING_SLOT_VAR0) {
|
||||||
const unsigned idx = var->data.location - VARYING_SLOT_VAR0;
|
const unsigned idx = var->data.location - VARYING_SLOT_VAR0;
|
||||||
if (explicit_locations[idx] == NULL)
|
if (explicit_locations[idx][var->data.location_frac] == NULL)
|
||||||
explicit_locations[idx] = var;
|
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;
|
ir_variable *output = NULL;
|
||||||
if (input->data.explicit_location
|
if (input->data.explicit_location
|
||||||
&& input->data.location >= VARYING_SLOT_VAR0) {
|
&& 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){
|
if (output != NULL){
|
||||||
input->data.is_unmatched_generic_inout = 0;
|
input->data.is_unmatched_generic_inout = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue