[Mesa-dev] [PATCH 1/3] mesa: only check errors when the state change in glDepthBoundsEXT()

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Aug 23 14:43:31 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/depth.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 930f5e816f..ddd91481cd 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -146,17 +146,17 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glDepthBounds(%f, %f)\n", zmin, zmax);
 
-   if (zmin > zmax) {
-      _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
-      return;
-   }
-
    zmin = CLAMP(zmin, 0.0, 1.0);
    zmax = CLAMP(zmax, 0.0, 1.0);
 
    if (ctx->Depth.BoundsMin == zmin && ctx->Depth.BoundsMax == zmax)
       return;
 
+   if (zmin > zmax) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
+      return;
+   }
+
    FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepth ? 0 : _NEW_DEPTH);
    ctx->NewDriverState |= ctx->DriverFlags.NewDepth;
    ctx->Depth.BoundsMin = (GLfloat) zmin;
-- 
2.14.1



More information about the mesa-dev mailing list