From: Kenneth Graunke Date: Fri, 26 Sep 2014 22:13:30 +0000 (-0700) Subject: mesa: Avoid flagging _NEW_VIEWPORT on redundant viewport updates. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95073a2dca03a48f4c77bc846a4a6d1f0eb81ae6;p=mesa.git mesa: Avoid flagging _NEW_VIEWPORT on redundant viewport updates. 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 Reviewed-by: Brian Paul Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c index 6545bf68a77..222ae307b55 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;