llvmpipe: Use get_first_non_void_channel more often

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18634>
This commit is contained in:
Konstantin Seurer 2022-09-22 19:39:11 +02:00 committed by Marge Bot
parent c94e3687d1
commit ef168a57b9

View file

@ -170,8 +170,6 @@ static inline void
lp_mem_type_from_format_desc(const struct util_format_description *format_desc,
struct lp_type* type)
{
unsigned i;
if (format_expands_to_float_soa(format_desc)) {
/* just make this a uint with width of block */
type->floating = false;
@ -183,11 +181,7 @@ lp_mem_type_from_format_desc(const struct util_format_description *format_desc,
return;
}
for (i = 0; i < 4; i++) {
if (format_desc->channel[i].type != UTIL_FORMAT_TYPE_VOID)
break;
}
unsigned chan = i;
int chan = util_format_get_first_non_void_channel(format_desc->format);
memset(type, 0, sizeof(struct lp_type));
type->floating = format_desc->channel[chan].type == UTIL_FORMAT_TYPE_FLOAT;
@ -1730,11 +1724,7 @@ lp_blend_type_from_format_desc(const struct util_format_description *format_desc
return;
}
unsigned i;
for (i = 0; i < 4; i++)
if (format_desc->channel[i].type != UTIL_FORMAT_TYPE_VOID)
break;
const unsigned chan = i;
const int chan = util_format_get_first_non_void_channel(format_desc->format);
memset(type, 0, sizeof(struct lp_type));
type->floating = format_desc->channel[chan].type == UTIL_FORMAT_TYPE_FLOAT;