Mesa (master): mesa: short-circuit no-change in _mesa_DepthRange()

Brian Paul brianp at kemper.freedesktop.org
Thu Aug 13 18:51:02 UTC 2009


Module: Mesa
Branch: master
Commit: b9f67df6e72e3a33b91c7d942aaa99622efd688c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9f67df6e72e3a33b91c7d942aaa99622efd688c

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Aug 11 15:46:46 2009 -0600

mesa: short-circuit no-change in _mesa_DepthRange()

---

 src/mesa/main/viewport.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 50e0402..309308c 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;




More information about the mesa-commit mailing list