From ea2507dd8b3ec0ebffab30bebd79d151d7165632 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Fri, 6 Feb 2026 08:23:11 +0100 Subject: [PATCH] tu,ir3: lower multiview indirect stores to register indirects nir_lower_multiview creates a loop that loops over the view mask and uses indirect stores. Since we only support direct store_per_view_output, we have to make sure these indirects are gone. Lowering the IO vars to temporaries will replace them with indirects on registers. Signed-off-by: Job Noorman Fixes: 6a1c8d3a0cf ("ir3, freedreno, turnip: Lower io earlier") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14787 Part-of: --- src/freedreno/vulkan/tu_nir_lower_multiview.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/freedreno/vulkan/tu_nir_lower_multiview.cc b/src/freedreno/vulkan/tu_nir_lower_multiview.cc index 5947d16ad51..c5882805bbe 100644 --- a/src/freedreno/vulkan/tu_nir_lower_multiview.cc +++ b/src/freedreno/vulkan/tu_nir_lower_multiview.cc @@ -9,6 +9,8 @@ #include "tu_device.h" +#include "ir3/ir3_nir.h" + /* Some a6xx variants cannot support a non-contiguous multiview mask. Instead, * inside the shader something like this needs to be inserted: * @@ -105,6 +107,15 @@ tu_nir_lower_multiview(nir_shader *nir, uint32_t mask, struct tu_device *dev) NIR_PASS(progress, nir, lower_multiview_mask, &options.view_mask); NIR_PASS(_, nir, nir_lower_multiview, options); + + /* nir_lower_multiview creates a loop that loops over the view mask and + * uses indirect stores. Since we only support direct + * store_per_view_output, we have to make sure these indirects are gone. + * Lowering the IO vars to temporaries will replace them with indirects + * on registers. + */ + ir3_nir_lower_io_vars_to_temporaries(nir); + progress = true; }