nir/opt_varyings: Fix relocate_slot so it doesn't mix up 32-bit and 16-bit I/O.

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 <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28685>
This commit is contained in:
Timur Kristóf 2024-04-11 23:34:47 +02:00 committed by Marge Bot
parent 7e43c2d08f
commit 91dd9c35be
1 changed files with 4 additions and 1 deletions

View File

@ -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 */