summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-06-22 15:03:20 +0200
committerSamuel Pitoiset <[email protected]>2017-06-24 16:47:43 +0200
commitcb577e379e20d70d62821c0ca2f1cb77c7b6790e (patch)
treefb51c90320eefbdc7d3be77dd2b209ea5757d256 /src/mesa/main
parent4178cea06d6976f25c4a84e0694f7cde4d23118f (diff)
mesa: only flush vertices when the viewport is different
This prevents glViewport() and friends to always flush and trigger _NEW_VIEWPORT. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/viewport.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index d37c2f3f108..8055ba55e5c 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;