mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-19 06:40:32 +01:00
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>
(cherry picked from commit bf76e5bb38)
This commit is contained in:
parent
c245cc600e
commit
2fa267d9e3
2 changed files with 11 additions and 7 deletions
|
|
@ -5144,7 +5144,7 @@
|
|||
"description": "r600: refactor r600_is_buffer_format_supported() for the next update",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue