From fc17f79f2ccd75ba19f17055ae1f5e441208e599 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 6 Oct 2021 16:26:57 +0200 Subject: [PATCH] etnaviv: fix alpha blend with dither on older GPUs While setting up DITHER_MODE allows alpha blending to work properly together with dithering on new GPUs (those with PE_DITHER_FIX), older cores still change the render target. As dithering is optional and implementation defined we can simply disable it on the affected GPUs, when alpha blending is enabled to work around this bug. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_blend.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c index 3662426..9927664 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blend.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c @@ -108,7 +108,9 @@ etna_blend_state_create(struct pipe_context *pctx, * dither pattern, * for now, set the same values as the blob. */ - if (so->dither) { + if (so->dither && + (!alpha_enable || + VIV_FEATURE(ctx->screen, chipMinorFeatures3, PE_DITHER_FIX))) { co->PE_DITHER[0] = 0x6e4ca280; co->PE_DITHER[1] = 0x5d7f91b3; } else { -- 2.7.4