r600: refactor r600_is_buffer_format_supported() for the next update

The variable "i" is updated to the type returned by
util_format_get_first_non_void_channel() which is int.

The function is refactored to handle "for_vbo" as false.

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35430>
This commit is contained in:
Patrick Lerda 2025-06-06 13:21:18 +02:00 committed by Marge Bot
parent 79c0c828c7
commit bf76e5bb38

View file

@ -84,15 +84,17 @@ static inline unsigned r600_endian_swap(unsigned size)
}
}
static inline bool r600_is_buffer_format_supported(enum pipe_format format, bool for_vbo)
static inline bool
r600_is_buffer_format_supported(const enum pipe_format format,
const bool for_vbo)
{
const struct util_format_description *desc = util_format_description(format);
unsigned i;
if (format == PIPE_FORMAT_R11G11B10_FLOAT)
return true;
i = util_format_get_first_non_void_channel(format);
const int i = util_format_get_first_non_void_channel(format);
if (i == -1)
return false;
@ -110,9 +112,11 @@ static inline bool r600_is_buffer_format_supported(enum pipe_format format, bool
desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED))
return false;
/* No 8 bit 3 channel formats for TBOs */
if (desc->channel[i].size == 8 && desc->nr_channels == 3)
return for_vbo;
if (!for_vbo) {
/* No 8 bit 3 channel formats for TBOs */
if (desc->channel[i].size == 8 && desc->nr_channels == 3)
return false;
}
return true;
}