util: simplify loop logic in util_format_get_first_non_void_channel()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28800>
This commit is contained in:
Eric Engestrom 2024-04-18 10:41:35 +02:00 committed by Marge Bot
parent 71b93f63dd
commit b3e6ef964f

View file

@ -1556,12 +1556,9 @@ util_format_get_first_non_void_channel(enum pipe_format format)
for (i = 0; i < 4; i++)
if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID)
break;
return i;
if (i == 4)
return -1;
return i;
return -1;
}
/**