From 07d5b352b115fd4150e6ee92212922242adda300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Wed, 1 Feb 2023 01:02:09 +0100 Subject: [PATCH] radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue when a vector component of an arrayed output has a deref. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8197 Part-of: (cherry picked from commit e13074d76312ca95648460629aef7021ee7482d1) --- .pick_status.json | 2 +- src/amd/vulkan/radv_pipeline.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index c75b0bcb559..27afda58b4e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1723,7 +1723,7 @@ "description": "radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 9758c79084e..81d4df31eb1 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2427,6 +2427,10 @@ radv_lower_io_to_scalar_early(nir_shader *nir, nir_variable_mode mask) { bool progress = false; + NIR_PASS(progress, nir, nir_lower_array_deref_of_vec, mask, + nir_lower_direct_array_deref_of_vec_load | nir_lower_indirect_array_deref_of_vec_load | + nir_lower_direct_array_deref_of_vec_store | + nir_lower_indirect_array_deref_of_vec_store); NIR_PASS(progress, nir, nir_lower_io_to_scalar_early, mask); if (progress) { /* Optimize the new vector code and then remove dead vars */