[Mesa-dev] [PATCH 4/4] mesa: only flush vertices when the viewport is different

Marek Olšák maraeo at gmail.com
Mon Jun 26 20:41:49 UTC 2017


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Jun 22, 2017 at 4:35 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> This prevents glViewport() and friends to always flush and
> trigger _NEW_VIEWPORT.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/mesa/main/viewport.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index 33aa1269520..ae03d6a5dd2 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -40,9 +40,6 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx,
>                         GLfloat x, GLfloat y,
>                         GLfloat width, GLfloat height)
>  {
> -   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewViewport ? 0 : _NEW_VIEWPORT);
> -   ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
> -
>     /* clamp width and height to the implementation dependent range */
>     width  = MIN2(width, (GLfloat) ctx->Const.MaxViewportWidth);
>     height = MIN2(height, (GLfloat) ctx->Const.MaxViewportHeight);
> @@ -70,6 +67,9 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx,
>         ctx->ViewportArray[idx].Height == height)
>        return;
>
> +   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewViewport ? 0 : _NEW_VIEWPORT);
> +   ctx->NewDriverState |= ctx->DriverFlags.NewViewport;
> +
>     ctx->ViewportArray[idx].X = x;
>     ctx->ViewportArray[idx].Width = width;
>     ctx->ViewportArray[idx].Y = y;
> --
> 2.13.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list