From 4ac6aae3a4d5829aab84c38173c23184ee2f5655 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 24 Jun 2025 15:34:42 +0200 Subject: [PATCH] radv/nir/lower_cmat: fix gfx11 B->ACC conversion Of course I messed up the one path that's not tested by CTS. Fixes: 249ccc6b4c4 ("radv/nir/lower_cmat: implement use conversions/transpose") Reviewed-by: Rhys Perry Part-of: --- src/amd/vulkan/nir/radv_nir_lower_cooperative_matrix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/nir/radv_nir_lower_cooperative_matrix.c b/src/amd/vulkan/nir/radv_nir_lower_cooperative_matrix.c index 7558eb0c449..5830194e187 100644 --- a/src/amd/vulkan/nir/radv_nir_lower_cooperative_matrix.c +++ b/src/amd/vulkan/nir/radv_nir_lower_cooperative_matrix.c @@ -265,10 +265,10 @@ convert_use(nir_builder *b, nir_def *src, enum glsl_cmat_use src_use, enum glsl_ for (unsigned keep32 = 0; keep32 < ((params->wave_size == 64) ? 2 : 1); keep32++) { nir_def *ballot = nir_imm_intN_t(b, keep32 ? UINT32_MAX : 0xffff0000ffffull, params->wave_size); nir_def *keep = nir_inverse_ballot(b, 1, ballot); - for (unsigned i = 0; i < num_comps; i++) { - components[i] = nir_bcsel(b, keep, components[i], components[i + 1]); - } num_comps /= 2; + for (unsigned i = 0; i < num_comps; i++) { + components[i] = nir_bcsel(b, keep, components[i * 2], components[i * 2 + 1]); + } } } else if ((src_use == GLSL_CMAT_USE_A && dst_use == GLSL_CMAT_USE_B) || (src_use == GLSL_CMAT_USE_B && dst_use == GLSL_CMAT_USE_A)) {