vrend: Keep track op HW scissor state and disable them in vrend_clear

vrend_clear executes the Gallium clear command which is only called
when the whole viewport is cleared. So far mesa was doing excessive checks
on the scissors, thereby updating the scissors to framebuffer size when they
were disabled, and the according state changes were transmitted to the host.
With mesa/2037478 this was optimized away, so that not disabling the scissors
in the clear command manifested itself as a regression in a number of tests.
Keeping track of the scissor state in the hardware and disabling the scissors
before the clear is executes, and re-enabling them according to the last state
fixes this.

Closes #116

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 5 years ago
parent 5baaab6f3b
commit ac7b52cf24
  1. 7
      src/vrend_renderer.c

@ -3492,6 +3492,8 @@ void vrend_clear(struct vrend_context *ctx,
vrend_use_program(ctx, 0);
glDisable(GL_SCISSOR_TEST);
if (buffers & PIPE_CLEAR_COLOR) {
if (ctx->sub->nr_cbufs && ctx->sub->surf[0] && vrend_format_is_emulated_alpha(ctx->sub->surf[0]->format)) {
glClearColor(color->f[3], 0.0, 0.0, 0.0);
@ -3603,6 +3605,10 @@ void vrend_clear(struct vrend_context *ctx,
ctx->sub->hw_blend_state.rt[0].colormask & PIPE_MASK_A ? GL_TRUE : GL_FALSE);
}
}
if (ctx->sub->hw_rs_state.scissor)
glEnable(GL_SCISSOR_TEST);
else
glDisable(GL_SCISSOR_TEST);
}
static void vrend_update_scissor_state(struct vrend_context *ctx)
@ -5247,6 +5253,7 @@ static void vrend_hw_emit_rs(struct vrend_context *ctx)
glEnable(GL_SCISSOR_TEST);
else
glDisable(GL_SCISSOR_TEST);
ctx->sub->hw_rs_state.scissor = state->scissor;
}

Loading…
Cancel
Save