From b677c40abbed358984491b8ad3fcecf4742b2823 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 14 Jul 2009 14:30:12 -0700 Subject: [PATCH] intel: Set DepthRange in the metaops using RasterPos[2]. 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 | 4 ++++ src/mesa/drivers/dri/intel/intel_pixel_draw.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 0e8ec92f0cb..ebba6aafad5 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -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; diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index ddcc661e00c..dfc9e1539fc 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -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 -- 2.30.2