Mesa (main): lima: use 1 as blend factor for dst_alpha for SRC_ALPHA_SATURATE
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 29 19:45:00 UTC 2021
Module: Mesa
Branch: main
Commit: 5f9434b611203d856294317a4b801c53fe3420d7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f9434b611203d856294317a4b801c53fe3420d7
Author: Vasily Khoruzhick <anarsoul at gmail.com>
Date: Tue Nov 23 22:31:04 2021 -0800
lima: use 1 as blend factor for dst_alpha for SRC_ALPHA_SATURATE
As per [1] alpha blend factors for Sa and Da should be 1 for
SRC_ALPHA_SATURATE
[1] https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_blend_func_extended.txt
Reviewed-by: Andreas Baierl <ichgeh at imkreisrum.de>
Reviewed-by: Erico Nunes <nunes.erico at gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13873>
---
src/gallium/drivers/lima/lima_draw.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c
index bde83281e14..1d00fd40199 100644
--- a/src/gallium/drivers/lima/lima_draw.c
+++ b/src/gallium/drivers/lima/lima_draw.c
@@ -509,11 +509,14 @@ lima_calculate_alpha_blend(enum pipe_blend_func rgb_func, enum pipe_blend_func a
enum pipe_blendfactor alpha_src_factor, enum pipe_blendfactor alpha_dst_factor)
{
/* PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE has to be changed to PIPE_BLENDFACTOR_ONE
- * if it is set for alpha_src.
+ * if it is set for alpha_src or alpha_dst.
*/
if (alpha_src_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE)
alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ if (alpha_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE)
+ alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+
return lima_blend_func(rgb_func) |
(lima_blend_func(alpha_func) << 3) |
(lima_blend_factor(rgb_src_factor) << 6) |
More information about the mesa-commit
mailing list