mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-16 13:40:29 +01:00
r600: Allow eight bit, three channel formats for vertex buffers
While using three component texture formats results in CTs failures,
three component vertex attributes are fine, and not allowing them
results in significant performance regressisons.
Fixes: e41958e344
r600: Disable eight bit three channel formats
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6399
v2: rename function to is_buffer_format_supported (Emma)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16267>
This commit is contained in:
parent
0be9cac742
commit
4a2ff9eb86
3 changed files with 7 additions and 7 deletions
|
|
@ -273,7 +273,7 @@ bool evergreen_is_format_supported(struct pipe_screen *screen,
|
|||
|
||||
if (usage & PIPE_BIND_SAMPLER_VIEW) {
|
||||
if (target == PIPE_BUFFER) {
|
||||
if (r600_is_vertex_format_supported(format))
|
||||
if (r600_is_buffer_format_supported(format, false))
|
||||
retval |= PIPE_BIND_SAMPLER_VIEW;
|
||||
} else {
|
||||
if (r600_is_sampler_format_supported(screen, format))
|
||||
|
|
@ -303,7 +303,7 @@ bool evergreen_is_format_supported(struct pipe_screen *screen,
|
|||
}
|
||||
|
||||
if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
|
||||
r600_is_vertex_format_supported(format)) {
|
||||
r600_is_buffer_format_supported(format, true)) {
|
||||
retval |= PIPE_BIND_VERTEX_BUFFER;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ static inline unsigned r600_endian_swap(unsigned size)
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool r600_is_vertex_format_supported(enum pipe_format format)
|
||||
static inline bool r600_is_buffer_format_supported(enum pipe_format format, bool for_vbo)
|
||||
{
|
||||
const struct util_format_description *desc = util_format_description(format);
|
||||
unsigned i;
|
||||
|
|
@ -115,9 +115,9 @@ static inline bool r600_is_vertex_format_supported(enum pipe_format format)
|
|||
desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED))
|
||||
return false;
|
||||
|
||||
/* No 8 bit 3 channel formats */
|
||||
/* No 8 bit 3 channel formats for TBOs */
|
||||
if (desc->channel[i].size == 8 && desc->nr_channels == 3)
|
||||
return false;
|
||||
return for_vbo;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ bool r600_is_format_supported(struct pipe_screen *screen,
|
|||
|
||||
if (usage & PIPE_BIND_SAMPLER_VIEW) {
|
||||
if (target == PIPE_BUFFER) {
|
||||
if (r600_is_vertex_format_supported(format))
|
||||
if (r600_is_buffer_format_supported(format, false))
|
||||
retval |= PIPE_BIND_SAMPLER_VIEW;
|
||||
} else {
|
||||
if (r600_is_sampler_format_supported(screen, format))
|
||||
|
|
@ -232,7 +232,7 @@ bool r600_is_format_supported(struct pipe_screen *screen,
|
|||
}
|
||||
|
||||
if ((usage & PIPE_BIND_VERTEX_BUFFER) &&
|
||||
r600_is_vertex_format_supported(format)) {
|
||||
r600_is_buffer_format_supported(format, true)) {
|
||||
retval |= PIPE_BIND_VERTEX_BUFFER;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue