nir: fix marking XFB varyings as always active IO
Components need to be handled, otherwise if a shader has two XFB varyings at the same location, only one will be marked as always active. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16092>
This commit is contained in:
parent
6873da0e42
commit
26f74f17d9
|
@ -957,14 +957,14 @@ nir_compact_varyings(nir_shader *producer, nir_shader *consumer,
|
||||||
void
|
void
|
||||||
nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer)
|
nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer)
|
||||||
{
|
{
|
||||||
nir_variable *input_vars[MAX_VARYING] = { 0 };
|
nir_variable *input_vars[MAX_VARYING][4] = { 0 };
|
||||||
|
|
||||||
nir_foreach_shader_in_variable(var, consumer) {
|
nir_foreach_shader_in_variable(var, consumer) {
|
||||||
if (var->data.location >= VARYING_SLOT_VAR0 &&
|
if (var->data.location >= VARYING_SLOT_VAR0 &&
|
||||||
var->data.location - VARYING_SLOT_VAR0 < MAX_VARYING) {
|
var->data.location - VARYING_SLOT_VAR0 < MAX_VARYING) {
|
||||||
|
|
||||||
unsigned location = var->data.location - VARYING_SLOT_VAR0;
|
unsigned location = var->data.location - VARYING_SLOT_VAR0;
|
||||||
input_vars[location] = var;
|
input_vars[location][var->data.location_frac] = var;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,8 +976,8 @@ nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
unsigned location = var->data.location - VARYING_SLOT_VAR0;
|
unsigned location = var->data.location - VARYING_SLOT_VAR0;
|
||||||
if (input_vars[location]) {
|
if (input_vars[location][var->data.location_frac]) {
|
||||||
input_vars[location]->data.always_active_io = true;
|
input_vars[location][var->data.location_frac]->data.always_active_io = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue