ac,radv,radeonsi: add helper to know if a format is supported by CB
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29291>
This commit is contained in:
committed by
Marge Bot
parent
c62f86587f
commit
d2234adf59
@@ -375,6 +375,13 @@ ac_translate_colorswap(enum amd_gfx_level gfx_level, enum pipe_format format, bo
|
||||
return ~0U;
|
||||
}
|
||||
|
||||
bool
|
||||
ac_is_colorbuffer_format_supported(enum amd_gfx_level gfx_level, enum pipe_format format)
|
||||
{
|
||||
return ac_get_cb_format(gfx_level, format) != V_028C70_COLOR_INVALID &&
|
||||
ac_translate_colorswap(gfx_level, format, false) != ~0U;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ac_colorformat_endian_swap(uint32_t colorformat)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,10 @@ ac_translate_colorswap(enum amd_gfx_level gfx_level,
|
||||
enum pipe_format format,
|
||||
bool do_endian_swap);
|
||||
|
||||
bool
|
||||
ac_is_colorbuffer_format_supported(enum amd_gfx_level gfx_level,
|
||||
enum pipe_format format);
|
||||
|
||||
uint32_t
|
||||
ac_colorformat_endian_swap(uint32_t colorformat);
|
||||
|
||||
|
||||
@@ -461,10 +461,7 @@ bool
|
||||
radv_is_colorbuffer_format_supported(const struct radv_physical_device *pdev, VkFormat format)
|
||||
{
|
||||
const struct util_format_description *desc = vk_format_description(format);
|
||||
uint32_t color_format = ac_get_cb_format(pdev->info.gfx_level, desc->format);
|
||||
uint32_t color_swap = ac_translate_colorswap(pdev->info.gfx_level, desc->format, false);
|
||||
|
||||
return color_format != V_028C70_COLOR_INVALID && color_swap != ~0U;
|
||||
return ac_is_colorbuffer_format_supported(pdev->info.gfx_level, desc->format);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
@@ -2456,13 +2456,6 @@ static unsigned si_is_vertex_format_supported(struct pipe_screen *screen, enum p
|
||||
return usage;
|
||||
}
|
||||
|
||||
static bool si_is_colorbuffer_format_supported(enum amd_gfx_level gfx_level,
|
||||
enum pipe_format format)
|
||||
{
|
||||
return ac_get_cb_format(gfx_level, format) != V_028C70_COLOR_INVALID &&
|
||||
ac_translate_colorswap(gfx_level, format, false) != ~0U;
|
||||
}
|
||||
|
||||
static bool si_is_zs_format_supported(enum pipe_format format)
|
||||
{
|
||||
if (format == PIPE_FORMAT_Z16_UNORM_S8_UINT)
|
||||
@@ -2543,7 +2536,7 @@ static bool si_is_format_supported(struct pipe_screen *screen, enum pipe_format
|
||||
|
||||
if ((usage & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT |
|
||||
PIPE_BIND_SHARED | PIPE_BIND_BLENDABLE)) &&
|
||||
si_is_colorbuffer_format_supported(sscreen->info.gfx_level, format)) {
|
||||
ac_is_colorbuffer_format_supported(sscreen->info.gfx_level, format)) {
|
||||
retval |= usage & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT |
|
||||
PIPE_BIND_SHARED);
|
||||
if (!util_format_is_pure_integer(format) && !util_format_is_depth_or_stencil(format))
|
||||
|
||||
Reference in New Issue
Block a user