ac/nir: Only export parameters when they are actually varying.

In AMD terminology, varying outputs are implemented by
parameter export instructions on GFX6-10.3 GPUs.

Only emit those when actually necessary.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32640>
This commit is contained in:
Timur Kristóf 2024-12-13 07:07:52 +01:00
parent 4d6c00944b
commit 13234a8a8a

View file

@ -538,7 +538,7 @@ ac_nir_export_parameters(nir_builder *b,
uint32_t write_mask = 0;
for (int i = 0; i < 4; i++) {
if (out->outputs[slot][i])
write_mask |= BITFIELD_BIT(i);
write_mask |= (out->infos[slot].as_varying_mask & BITFIELD_BIT(i));
}
/* no one set this output slot, we can skip the param export */