From 080918e3766c7fe1a978dfbbc6ab60c142728789 Mon Sep 17 00:00:00 2001 From: Lepton Wu Date: Wed, 29 Jan 2020 11:52:13 -0800 Subject: [PATCH] vrend: blend: Fix missed glColorMask call One bug was found when running dEQP-GLES3.functional.fragment_out.random.*. If run them one by one, they pass. If run them all together, some cases fails. The fix is: when independent_blend_enable changes from true to false, we should call glColorMask, otherwise color masks for some color buffers could stay in stale states. Signed-off-by: Lepton Wu Reviewed-by: Gert Wollny --- src/vrend_renderer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index d34b49d..cbd4e67 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4842,7 +4842,9 @@ static void vrend_hw_emit_blend(struct vrend_context *ctx, struct pipe_blend_sta else glDisable(GL_BLEND); - if (state->rt[0].colormask != ctx->sub->hw_blend_state.rt[0].colormask) { + if (state->rt[0].colormask != ctx->sub->hw_blend_state.rt[0].colormask || + (ctx->sub->hw_blend_state.independent_blend_enable && + !state->independent_blend_enable)) { int i; for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) ctx->sub->hw_blend_state.rt[i].colormask = state->rt[i].colormask;