summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-09-04 22:36:00 -0400
committerJonathan Marek <[email protected]>2019-09-06 02:24:29 +0000
commitac4ca24c32bc4a1821790b5d2fdbf201680d3e67 (patch)
tree215deb881daead88d523fead81719eab9effe516
parent80906a12d98740bd838f4b4c1cfc9931e4e59322 (diff)
freedreno/a2xx: fix SRC_ALPHA_SATURATE for alpha blend function
Fixes failures in the following deqp tests: dEQP-GLES2.functional.fragment_ops.*src_alpha_saturate* Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_blend.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_blend.c b/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
index 223eec9f592..8e03e840fcb 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
@@ -83,8 +83,13 @@ fd2_blend_state_create(struct pipe_context *pctx,
A2XX_RB_BLEND_CONTROL_COLOR_COMB_FCN(blend_func(rt->rgb_func)) |
A2XX_RB_BLEND_CONTROL_COLOR_DESTBLEND(fd_blend_factor(rt->rgb_dst_factor));
+ /* hardware doesn't support SRC_ALPHA_SATURATE for alpha, but it is equivalent to ONE */
+ unsigned alpha_src_factor = rt->alpha_src_factor;
+ if (alpha_src_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE)
+ alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+
so->rb_blendcontrol_alpha =
- A2XX_RB_BLEND_CONTROL_ALPHA_SRCBLEND(fd_blend_factor(rt->alpha_src_factor)) |
+ A2XX_RB_BLEND_CONTROL_ALPHA_SRCBLEND(fd_blend_factor(alpha_src_factor)) |
A2XX_RB_BLEND_CONTROL_ALPHA_COMB_FCN(blend_func(rt->alpha_func)) |
A2XX_RB_BLEND_CONTROL_ALPHA_DESTBLEND(fd_blend_factor(rt->alpha_dst_factor));