summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/viewport.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-09-26 15:13:30 -0700
committerKenneth Graunke <[email protected]>2014-10-01 01:08:26 -0700
commit95073a2dca03a48f4c77bc846a4a6d1f0eb81ae6 (patch)
treeeaa1a41937548e88046fb66282beb28d9f2e0c60 /src/mesa/main/viewport.c
parent0a1730200e91b6ad62cdf04bb1ec02cb1e96056a (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/viewport.c')
-rw-r--r--src/mesa/main/viewport.c6
1 files changed, 6 insertions, 0 deletions
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;