mesa: short-circuit no-change in _mesa_DepthRange()
authorBrian Paul <brianp@vmware.com>
Tue, 11 Aug 2009 21:46:46 +0000 (15:46 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 13 Aug 2009 18:25:53 +0000 (12:25 -0600)
src/mesa/main/viewport.c

index 50e0402d2788001c803e0c53d4d890cda0ee3ef3..309308c983b34067fb0240912570a8ce06cf0a1f 100644 (file)
@@ -120,6 +120,10 @@ _mesa_DepthRange(GLclampd nearval, GLclampd farval)
    if (MESA_VERBOSE&VERBOSE_API)
       _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
 
+   if (ctx->Viewport.Near == nearval &&
+       ctx->Viewport.Far == farval)
+      return;
+
    ctx->Viewport.Near = (GLfloat) CLAMP(nearval, 0.0, 1.0);
    ctx->Viewport.Far = (GLfloat) CLAMP(farval, 0.0, 1.0);
    ctx->NewState |= _NEW_VIEWPORT;