From: Brian Paul Date: Tue, 11 Aug 2009 21:46:46 +0000 (-0600) Subject: mesa: short-circuit no-change in _mesa_DepthRange() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b9f67df6e72e3a33b91c7d942aaa99622efd688c;p=mesa.git mesa: short-circuit no-change in _mesa_DepthRange() --- diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c index 50e0402d278..309308c983b 100644 --- a/src/mesa/main/viewport.c +++ b/src/mesa/main/viewport.c @@ -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;