intel: Set DepthRange in the metaops using RasterPos[2].
authorEric Anholt <eric@anholt.net>
Tue, 14 Jul 2009 21:30:12 +0000 (14:30 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 14 Jul 2009 22:14:52 +0000 (15:14 -0700)
RasterPos[2] is already sent through the window transform, which includes
DepthRange handling.  So make DepthRange for the metaops a noop.

Fixes a failure in oglconform depthrange.c

src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
src/mesa/drivers/dri/intel/intel_pixel_draw.c

index 0e8ec92f0cb1e65be80251d3f5168ef7315b9765..ebba6aafad5eb2154d7ac974ff7e45931fb567e6 100644 (file)
@@ -42,6 +42,7 @@
 #include "main/varray.h"
 #include "main/attrib.h"
 #include "main/enable.h"
+#include "main/viewport.h"
 #include "shader/arbprogram.h"
 #include "glapi/dispatch.h"
 #include "swrast/swrast.h"
@@ -484,6 +485,9 @@ intel_texture_bitmap(GLcontext * ctx,
    /* convert rasterpos Z from [0,1] to NDC coord in [-1,1] */
    dst_z = -1.0 + 2.0 * ctx->Current.RasterPos[2];
 
+   /* RasterPos[2] already takes into account the DepthRange mapping. */
+   _mesa_DepthRange(0.0, 1.0);
+
    vertices[0][0] = dst_x;
    vertices[0][1] = dst_y;
    vertices[0][2] = dst_z;
index ddcc661e00c80e70d2ed11657babbd97d078d57c..dfc9e1539fc221adf335850b0f2de7d9c7a0297d 100644 (file)
@@ -45,6 +45,7 @@
 #include "main/depth.h"
 #include "main/hash.h"
 #include "main/blend.h"
+#include "main/viewport.h"
 #include "glapi/dispatch.h"
 #include "swrast/swrast.h"
 
@@ -128,7 +129,7 @@ intel_texture_drawpixels(GLcontext * ctx,
    }
 
    _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT |
-                   GL_CURRENT_BIT);
+                   GL_CURRENT_BIT | GL_VIEWPORT_BIT);
    _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
 
    /* XXX: pixel store stuff */
@@ -154,6 +155,9 @@ intel_texture_drawpixels(GLcontext * ctx,
    /* convert rasterpos Z from [0,1] to NDC coord in [-1,1] */
    z = -1.0 + 2.0 * ctx->Current.RasterPos[2];
 
+   /* RasterPos[2] already takes into account the DepthRange mapping. */
+   _mesa_DepthRange(0.0, 1.0);
+
    /* Create the vertex buffer based on the current raster pos.  The x and y
     * we're handed are ctx->Current.RasterPos[0,1] rounded to integers.
     * We also apply the depth.  However, the W component is already multiplied