[virglrenderer-devel] [PATCH] vrend: Set scissor_state_dirty correctly.

Gert Wollny gert.wollny at collabora.com
Tue Jul 24 18:09:36 UTC 2018


Since I couldn't really reproduce the problem I can not test it, but
the patch makes sense to me, 

Reviewed-By: Gert Wollny <gert.wollny at collabora.com>

Am Dienstag, den 24.07.2018, 10:52 -0700 schrieb Lepton Wu:
> We forgot to set scissor_state_dirty when we disable GL_SCISSOR_TEST
> in vrend_renderer_blit_int. This fixes bug mentioned in
> https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/
> 001230.html
> ---
>  src/vrend_renderer.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index c68bda0..17e9674 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -6689,12 +6689,19 @@ static void vrend_renderer_blit_int(struct
> vrend_context *ctx,
>        src_y2 = src_res->base.height0 - info->src.box.y;
>     }
>  
> -   if (info->scissor_enable) {
> +   bool current_scissor = glIsEnabled(GL_SCISSOR_TEST);
> +   bool tmp_scissor = info->scissor_enable;
> +   if (tmp_scissor) {
>        glScissor(info->scissor.minx, info->scissor.miny, info-
> >scissor.maxx - info->scissor.minx, info->scissor.maxy - info-
> >scissor.miny);
> +   }
> +   if (current_scissor != tmp_scissor) {
>        ctx->sub->scissor_state_dirty = (1 << 0);
> -      glEnable(GL_SCISSOR_TEST);
> -   } else
> -      glDisable(GL_SCISSOR_TEST);
> +      if (tmp_scissor) {
> +         glEnable(GL_SCISSOR_TEST);
> +      } else {
> +         glDisable(GL_SCISSOR_TEST);
> +      }
> +   }
>  
>     /* An GLES GL_INVALID_OPERATION is generated if one wants to blit
> from a
>      * multi-sample fbo to a non multi-sample fbo and the source and
> destination


More information about the virglrenderer-devel mailing list