Mesa (master): intel: Fix ClearDepth to not be affected by DepthRange.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jul 14 22:17:55 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jul 14 14:49:03 2009 -0700

intel: Fix ClearDepth to not be affected by DepthRange.

Fixes new piglit depthrange-clear.c test.

---

 src/mesa/drivers/dri/intel/intel_clear.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c
index 0d0cf39..13b433d 100644
--- a/src/mesa/drivers/dri/intel/intel_clear.c
+++ b/src/mesa/drivers/dri/intel/intel_clear.c
@@ -143,7 +143,8 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask)
 		    GL_POLYGON_BIT |
 		    GL_STENCIL_BUFFER_BIT |
 		    GL_TRANSFORM_BIT |
-		    GL_CURRENT_BIT);
+		    GL_CURRENT_BIT |
+		    GL_VIEWPORT_BIT);
    saved_active_texture = ctx->Texture.CurrentUnit;
 
    /* Disable existing GL state we don't want to apply to a clear. */
@@ -209,6 +210,11 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask)
    /* convert clear Z from [0,1] to NDC coord in [-1,1] */
    dst_z = -1.0 + 2.0 * ctx->Depth.Clear;
 
+   /* The ClearDepth value is unaffected by DepthRange, so do a default
+    * mapping.
+    */
+   _mesa_DepthRange(0.0, 1.0);
+
    /* Prepare the vertices, which are the same regardless of which buffer we're
     * drawing to.
     */




More information about the mesa-commit mailing list