[Mesa-dev] [PATCH 2/2] mesa: Avoid flagging _NEW_VIEWPORT on redundant viewport updates.
Brian Paul
brianp at vmware.com
Fri Sep 26 15:48:53 PDT 2014
On 09/26/2014 04:13 PM, Kenneth Graunke wrote:
> Cuts the number of i965 color calculator viewport uploads by 100x
> (11017983 -> 113385) in 'x11perf -gc' with Glamor in Xephyr.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/mesa/main/viewport.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index 6545bf6..222ae30 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -58,6 +58,12 @@ set_viewport_no_notify(struct gl_context *ctx, unsigned idx,
> ctx->Const.ViewportBounds.Min, ctx->Const.ViewportBounds.Max);
> }
>
> + if (ctx->ViewportArray[idx].X == x &&
> + ctx->ViewportArray[idx].Width == width &&
> + ctx->ViewportArray[idx].Y == y &&
> + ctx->ViewportArray[idx].Height == height)
> + return;
> +
> ctx->ViewportArray[idx].X = x;
> ctx->ViewportArray[idx].Width = width;
> ctx->ViewportArray[idx].Y = y;
>
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list