From b9c1d74ff4f823e3e8c63eab6cd3ecb3686eaeec Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 1 Jun 2023 16:03:46 +0100 Subject: [PATCH] radv: correctly skip vertex loads with packed formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is supposed to check whether any channels of the element is used, but skipped_start is always 0 for packed formats. Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Fixes: a46acdbc3ff ("radv: Lower non-dynamic VS inputs in NIR.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9062 Part-of: --- src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c b/src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c index f3022259d5f..8f0707bb9b3 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c +++ b/src/amd/vulkan/nir/radv_nir_lower_vs_inputs.c @@ -287,7 +287,7 @@ lower_load_vs_input(nir_builder *b, nir_intrinsic_instr *intrin, lower_vs_inputs first_used_swizzled_channel(f, dest_use_mask, true) + 1; const unsigned max_loaded_channels = MIN2(first_trailing_unused_channel, f->nr_channels); const unsigned fetch_num_channels = - skipped_start >= max_loaded_channels ? 0 : max_loaded_channels - skipped_start; + first_used_channel >= max_loaded_channels ? 0 : max_loaded_channels - skipped_start; /* Load VS inputs from VRAM. *