r600: explicitly advertise index buffer format support

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11132>
This commit is contained in:
Erik Faye-Lund 2021-06-03 08:58:19 -04:00 committed by Marge Bot
parent de9c66d749
commit aea35a5ac2
3 changed files with 23 additions and 0 deletions

View file

@ -307,6 +307,11 @@ bool evergreen_is_format_supported(struct pipe_screen *screen,
retval |= PIPE_BIND_VERTEX_BUFFER;
}
if (usage & PIPE_BIND_INDEX_BUFFER &&
r600_is_index_format_supported(format)) {
retval |= PIPE_BIND_INDEX_BUFFER;
}
if ((usage & PIPE_BIND_LINEAR) &&
!util_format_is_compressed(format) &&
!(usage & PIPE_BIND_DEPTH_STENCIL))

View file

@ -122,4 +122,17 @@ static inline bool r600_is_vertex_format_supported(enum pipe_format format)
return true;
}
static inline bool r600_is_index_format_supported(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_R8_UINT:
case PIPE_FORMAT_R16_UINT:
case PIPE_FORMAT_R32_UINT:
return true;
default:
return false;
}
}
#endif

View file

@ -236,6 +236,11 @@ bool r600_is_format_supported(struct pipe_screen *screen,
retval |= PIPE_BIND_VERTEX_BUFFER;
}
if (usage & PIPE_BIND_INDEX_BUFFER &&
r600_is_index_format_supported(format)) {
retval |= PIPE_BIND_INDEX_BUFFER;
}
if ((usage & PIPE_BIND_LINEAR) &&
!util_format_is_compressed(format) &&
!(usage & PIPE_BIND_DEPTH_STENCIL))