From 0d8a86f519b4aec74f6d43d7a6f49ecaa060ec7e Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 16 Aug 2024 10:07:10 +0200 Subject: panvk: Adjust RGB component order for fixed-function blending Basically what 004e0eb3ab85 ("panfrost: use RGB1 component ordering for R5G6B5 pixel formats") was doing in the gallium driver, but applied to panvk this time. Fixes: 004e0eb3ab85 ("panfrost: use RGB1 component ordering for R5G6B5 pixel formats") Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Part-of: (cherry picked from commit 9241af23e5b6a70009a0ccb6d54d49bacd1d00d1) --- src/panfrost/vulkan/panvk_vX_blend.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/panfrost') diff --git a/src/panfrost/vulkan/panvk_vX_blend.c b/src/panfrost/vulkan/panvk_vX_blend.c index abec563a5f3..909d8166593 100644 --- a/src/panfrost/vulkan/panvk_vX_blend.c +++ b/src/panfrost/vulkan/panvk_vX_blend.c @@ -237,6 +237,19 @@ emit_blend_desc(const struct pan_shader_info *fs_info, mali_ptr fs_code, cfg.internal.fixed_function.num_comps = 4; cfg.internal.fixed_function.conversion.memory_format = GENX(panfrost_dithered_format_from_pipe_format)(rt->format, false); + +#if PAN_ARCH >= 7 + if (cfg.internal.mode == MALI_BLEND_MODE_FIXED_FUNCTION && + (cfg.internal.fixed_function.conversion.memory_format & 0xff) == + MALI_RGB_COMPONENT_ORDER_RGB1) { + /* fixed function does not like RGB1 as the component order */ + /* force this field to be the RGBA. */ + cfg.internal.fixed_function.conversion.memory_format &= ~0xff; + cfg.internal.fixed_function.conversion.memory_format |= + MALI_RGB_COMPONENT_ORDER_RGBA; + } +#endif + cfg.internal.fixed_function.rt = rt_idx; if (fs_info->fs.untyped_color_outputs) { -- cgit v1.2.3