Module: Mesa Branch: main Commit: b9c1d74ff4f823e3e8c63eab6cd3ecb3686eaeec URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9c1d74ff4f823e3e8c63eab6cd3ecb3686eaeec
Author: Rhys Perry <[email protected]> Date: Thu Jun 1 16:03:46 2023 +0100 radv: correctly skip vertex loads with packed formats 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 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timur Kristóf <[email protected]> Fixes: a46acdbc3ff ("radv: Lower non-dynamic VS inputs in NIR.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9062 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23370> --- 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. *
