[Mesa-stable] [PATCH] mesa: Remove glClear optimization based on drawable size

Brian Paul brianp at vmware.com
Tue May 13 09:04:40 PDT 2014


On 05/12/2014 05:40 PM, Kristian Høgsberg wrote:
> A drawable size of 0x0 means that we don't have buffers for a drawable yet,
> not that we have a zero-sized buffer.  Core mesa shouldn't be optimizing out
> drawing based on buffer size, since the draw call could be what triggers
> the driver to go and get buffers.  As discussed in the referenced bug report,
> the optimization was added as part of a scatter-shot attempt to fix a
> different problem.  There's no other example in mesa core of using the
> buffer size in this way.
>
> Bugzilla: https://urldefense.proofpoint.com/v1/url?u=https://bugs.freedesktop.org/show_bug.cgi?id%3D74005&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=GSPsRdu2uFPT5i7iaDmWUeoXDh9XvPrddhOniCKPups%3D%0A&s=dfb821b7dc7c917f44139fe1184729096002529b207a870191d694063aa58bec
> Cc: "10.2" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
> ---
>   src/mesa/main/clear.c | 5 -----
>   1 file changed, 5 deletions(-)
>
> diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
> index 9df1f5e..cf93418 100644
> --- a/src/mesa/main/clear.c
> +++ b/src/mesa/main/clear.c
> @@ -180,11 +180,6 @@ _mesa_Clear( GLbitfield mask )
>         return;
>      }
>
> -   if (ctx->DrawBuffer->Width == 0 || ctx->DrawBuffer->Height == 0 ||
> -       ctx->DrawBuffer->_Xmin >= ctx->DrawBuffer->_Xmax ||
> -       ctx->DrawBuffer->_Ymin >= ctx->DrawBuffer->_Ymax)
> -      return;
> -
>      if (ctx->RasterDiscard)
>         return;
>
>

Reviewed-by: Brian Paul <brianp at vmware.com>




More information about the mesa-stable mailing list