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

This commit is contained in:
Brian Paul 2009-08-11 15:46:46 -06:00
parent ace98f09e6
commit b9f67df6e7

View 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;