mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 05:48:07 +02:00
nir: fix gathering color interp modes in nir_lower_color_inputs
Fixes: 709ebd82 ("amd: expose nir_io_mix_convergent_flat_with_interpolated")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12800
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34942>
This commit is contained in:
parent
ef63e3e4d2
commit
a1ee6d6730
1 changed files with 12 additions and 2 deletions
|
|
@ -3236,6 +3236,14 @@ nir_lower_color_inputs(nir_shader *nir)
|
|||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||
bool progress = false;
|
||||
|
||||
/* Both flat and non-flat can occur with nir_io_mix_convergent_flat_with_interpolated,
|
||||
* but we want to save only the non-flat interp mode in that case.
|
||||
*
|
||||
* Start with flat and set to non-flat only if it's present.
|
||||
*/
|
||||
nir->info.fs.color0_interp = INTERP_MODE_FLAT;
|
||||
nir->info.fs.color1_interp = INTERP_MODE_FLAT;
|
||||
|
||||
nir_builder b = nir_builder_create(impl);
|
||||
|
||||
nir_foreach_block(block, impl) {
|
||||
|
|
@ -3279,13 +3287,15 @@ nir_lower_color_inputs(nir_shader *nir)
|
|||
|
||||
if (sem.location == VARYING_SLOT_COL0) {
|
||||
load = nir_load_color0(&b);
|
||||
nir->info.fs.color0_interp = interp;
|
||||
if (interp != INTERP_MODE_FLAT)
|
||||
nir->info.fs.color0_interp = interp;
|
||||
nir->info.fs.color0_sample = sample;
|
||||
nir->info.fs.color0_centroid = centroid;
|
||||
} else {
|
||||
assert(sem.location == VARYING_SLOT_COL1);
|
||||
load = nir_load_color1(&b);
|
||||
nir->info.fs.color1_interp = interp;
|
||||
if (interp != INTERP_MODE_FLAT)
|
||||
nir->info.fs.color1_interp = interp;
|
||||
nir->info.fs.color1_sample = sample;
|
||||
nir->info.fs.color1_centroid = centroid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue