From 91dd9c35bee7293d39efc7003976f0bd4a8c25eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Thu, 11 Apr 2024 23:34:47 +0200 Subject: [PATCH] nir/opt_varyings: Fix relocate_slot so it doesn't mix up 32-bit and 16-bit I/O. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, nir_opt_varyings was unable to distinguish between a fully occupied 32-bit flat input and the low part of a 16-bit flat input, and would assign them the same slot, thereby messing up both I/O slots in the process. Signed-off-by: Timur Kristóf Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_opt_varyings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index 4ad2f056ba2..ae609185fcf 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -3832,7 +3832,10 @@ fs_assign_slots(struct linkage_info *linkage, assert(slot_index < max_slot * 8); relocate_slot(linkage, &linkage->slot[i], i, new_slot_index, fs_vec4_type, progress); - BITSET_SET(assigned_mask, slot_index); + + for (unsigned i = 0; i < slot_size; ++i) + BITSET_SET(assigned_mask, slot_index + i); + if (assigned_fs_vec4_type) assigned_fs_vec4_type[vec4_slot(slot_index)] = fs_vec4_type; slot_index += slot_size; /* move to the next slot */