Fix viewport Z scale/bias to get the right Z values from drawing the quad.
authorBrian <brian.paul@tungstengraphics.com>
Wed, 17 Oct 2007 17:24:06 +0000 (11:24 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 17 Oct 2007 17:24:06 +0000 (11:24 -0600)
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c

index 4f269ed3f7ad538da6137524a75f8734528b8d92..c0ea1a4bf6c2c47ffd343b36f608850a0216087a 100644 (file)
@@ -326,7 +326,7 @@ clear_with_quad(GLcontext *ctx,
       pipe->bind_depth_stencil_state(pipe, cso->data);
    }
 
-   /* setup state: nothing */
+   /* rasterizer state: nothing */
    {
       struct pipe_rasterizer_state raster;
       const struct cso_rasterizer *cso;
@@ -367,11 +367,11 @@ clear_with_quad(GLcontext *ctx,
       struct pipe_viewport_state vp;
       vp.scale[0] =  0.5 * width;
       vp.scale[1] = -0.5 * height;
-      vp.scale[2] = 0.5;
+      vp.scale[2] = 1.0;
       vp.scale[3] = 1.0;
       vp.translate[0] = 0.5 * width;
       vp.translate[1] = 0.5 * height;
-      vp.translate[2] = 0.5;
+      vp.translate[2] = 0.0;
       vp.translate[3] = 0.0;
       pipe->set_viewport_state(pipe, &vp);
    }
index 97d4f41ed9da91e7b2693635724195d80d4465cc..9031ef46dfe22ff951fe7f64a152c8166efb3149 100644 (file)
@@ -570,11 +570,11 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
       struct pipe_viewport_state vp;
       vp.scale[0] =  0.5 * width;
       vp.scale[1] = -0.5 * height;
-      vp.scale[2] = 0.5;
+      vp.scale[2] = 1.0;
       vp.scale[3] = 1.0;
       vp.translate[0] = 0.5 * width;
       vp.translate[1] = 0.5 * height;
-      vp.translate[2] = 0.5;
+      vp.translate[2] = 0.0;
       vp.translate[3] = 0.0;
       pipe->set_viewport_state(pipe, &vp);
    }