nir/opt_varyings: remove redundant conditions from a while loop

Most of these conditions are repeated below with a continue statement.
This just puts break at the end where all of them are false.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32424>
This commit is contained in:
Marek Olšák 2024-11-30 04:17:06 -05:00 committed by Marge Bot
parent a618a2aa8b
commit b01f3cea7a

View file

@ -4212,13 +4212,7 @@ fs_assign_slots(struct linkage_info *linkage,
/* Skip indirectly-indexed scalar slots and slots incompatible
* with the FS vec4 type.
*/
while ((fs_vec4_type != FS_VEC4_TYPE_NONE &&
assigned_fs_vec4_type[vec4_slot(slot_index)] !=
FS_VEC4_TYPE_NONE &&
assigned_fs_vec4_type[vec4_slot(slot_index)] !=
fs_vec4_type) ||
BITSET_TEST32(linkage->indirect_mask, slot_index) ||
BITSET_TEST(assigned_mask, slot_index)) {
while (1) {
/* If the FS vec4 type is incompatible. Move to the next vec4. */
if (fs_vec4_type != FS_VEC4_TYPE_NONE &&
assigned_fs_vec4_type[vec4_slot(slot_index)] !=
@ -4244,7 +4238,11 @@ fs_assign_slots(struct linkage_info *linkage,
/* This slot is already assigned (assigned_mask is set). Move to
* the next one.
*/
slot_index += slot_size;
if (BITSET_TEST(assigned_mask, slot_index)) {
slot_index += slot_size;
continue;
}
break;
}
/* Assign color channels in this order, starting