diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2024-08-16 10:07:10 +0200 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2024-08-16 17:53:35 +0200 |
commit | 0d8a86f519b4aec74f6d43d7a6f49ecaa060ec7e (patch) | |
tree | 4f80f6f4284772d57e6050765e1ebffc837f10de /src/panfrost | |
parent | c799cfe577a338324e45ec9a57a418e09697baa4 (diff) |
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 <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30685>
(cherry picked from commit 9241af23e5b6a70009a0ccb6d54d49bacd1d00d1)
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/vulkan/panvk_vX_blend.c | 13 |
1 files changed, 13 insertions, 0 deletions
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) { |