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 <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Lepton Wu 5 years ago
parent 039baad8cd
commit 080918e376
  1. 4
      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;

Loading…
Cancel
Save