[Mesa-dev] [PATCH 35/40] i965: Consider all scissor rectangles in noop_scissor

Ian Romanick idr at freedesktop.org
Fri Jan 10 18:32:28 PST 2014


On 01/10/2014 05:40 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>

I actually think this patch is unnecessary.  Clears should only care
about the "class" GL viewport, so we should only have to check
ScissorArray[0].  I'll need to come up with some test cases to try that
theory out.

> v2: Use '& 1' instead of '& i'.  Noticed by Ken.
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_clear.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
> index 58fd612..19bde0f 100644
> --- a/src/mesa/drivers/dri/i965/brw_clear.c
> +++ b/src/mesa/drivers/dri/i965/brw_clear.c
> @@ -83,10 +83,16 @@ debug_mask(const char *name, GLbitfield mask)
>  static bool
>  noop_scissor(struct gl_context *ctx, struct gl_framebuffer *fb)
>  {
> -   return ctx->Scissor.ScissorArray[0].X <= 0 &&
> -          ctx->Scissor.ScissorArray[0].Y <= 0 &&
> -          ctx->Scissor.ScissorArray[0].Width >= fb->Width &&
> -          ctx->Scissor.ScissorArray[0].Height >= fb->Height;
> +   for (unsigned i = 0; i < ctx->Const.MaxViewports; i++) {
> +      if (((ctx->Scissor.EnableFlags >> i) & 1) &&
> +          (ctx->Scissor.ScissorArray[i].X > 0 ||
> +           ctx->Scissor.ScissorArray[i].Y > 0 ||
> +           ctx->Scissor.ScissorArray[i].Width < fb->Width ||
> +           ctx->Scissor.ScissorArray[i].Height < fb->Height))
> +         return false;
> +   }
> +
> +   return true;
>  }
>  
>  /**
> 



More information about the mesa-dev mailing list