mirror of https://gitlab.freedesktop.org/mesa/mesa
radv: use PIPE_FORMAT in radv_translate_colorswap()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29265>
This commit is contained in:
parent
255e76b419
commit
40428bd497
|
@ -1683,7 +1683,7 @@ radv_initialise_color_surface(struct radv_device *device, struct radv_color_buff
|
|||
format = ac_get_cb_format(pdev->info.gfx_level, desc->format);
|
||||
assert(format != V_028C70_COLOR_INVALID);
|
||||
|
||||
swap = radv_translate_colorswap(iview->vk.format, false);
|
||||
swap = radv_translate_colorswap(vk_format_to_pipe_format(iview->vk.format), false);
|
||||
endian = radv_colorformat_endian_swap(format);
|
||||
|
||||
/* blend clamp should be set for all NORM/SRGB types */
|
||||
|
|
|
@ -446,7 +446,7 @@ radv_is_colorbuffer_format_supported(const struct radv_physical_device *pdev, Vk
|
|||
{
|
||||
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 = radv_translate_colorswap(format, false);
|
||||
uint32_t color_swap = radv_translate_colorswap(desc->format, false);
|
||||
uint32_t color_num_format = ac_get_cb_number_type(desc->format);
|
||||
|
||||
if (color_num_format == V_028C70_NUMBER_UINT || color_num_format == V_028C70_NUMBER_SINT ||
|
||||
|
@ -859,16 +859,16 @@ radv_translate_dbformat(VkFormat format)
|
|||
}
|
||||
|
||||
unsigned
|
||||
radv_translate_colorswap(VkFormat format, bool do_endian_swap)
|
||||
radv_translate_colorswap(enum pipe_format format, bool do_endian_swap)
|
||||
{
|
||||
const struct util_format_description *desc = vk_format_description(format);
|
||||
const struct util_format_description *desc = util_format_description(format);
|
||||
|
||||
#define HAS_SWIZZLE(chan, swz) (desc->swizzle[chan] == PIPE_SWIZZLE_##swz)
|
||||
|
||||
if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32)
|
||||
if (format == PIPE_FORMAT_R11G11B10_FLOAT)
|
||||
return V_028C70_SWAP_STD;
|
||||
|
||||
if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32)
|
||||
if (format == PIPE_FORMAT_R9G9B9E5_FLOAT)
|
||||
return V_028C70_SWAP_STD;
|
||||
|
||||
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
|
||||
|
|
|
@ -163,7 +163,7 @@ uint32_t radv_colorformat_endian_swap(uint32_t colorformat);
|
|||
|
||||
uint32_t radv_translate_dbformat(VkFormat format);
|
||||
|
||||
unsigned radv_translate_colorswap(VkFormat format, bool do_endian_swap);
|
||||
unsigned radv_translate_colorswap(enum pipe_format format, bool do_endian_swap);
|
||||
|
||||
bool radv_format_pack_clear_color(VkFormat format, uint32_t clear_vals[2], VkClearColorValue *value);
|
||||
|
||||
|
|
|
@ -777,7 +777,7 @@ vi_alpha_is_on_msb(const struct radv_device *device, const VkFormat format)
|
|||
if (pdev->info.gfx_level >= GFX10 && desc->nr_channels == 1)
|
||||
return desc->swizzle[3] == PIPE_SWIZZLE_X;
|
||||
|
||||
return radv_translate_colorswap(format, false) <= 1;
|
||||
return radv_translate_colorswap(desc->format, false) <= 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -112,7 +112,7 @@ radv_choose_spi_color_format(const struct radv_device *device, VkFormat vk_forma
|
|||
|
||||
format = ac_get_cb_format(pdev->info.gfx_level, desc->format);
|
||||
ntype = ac_get_cb_number_type(desc->format);
|
||||
swap = radv_translate_colorswap(vk_format, false);
|
||||
swap = radv_translate_colorswap(desc->format, false);
|
||||
|
||||
ac_choose_spi_color_formats(format, swap, ntype, false, use_rbplus, &formats);
|
||||
|
||||
|
|
Loading…
Reference in New Issue