summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-10-28 22:50:52 -0700
committerEric Anholt <[email protected]>2008-10-28 22:52:38 -0700
commit26c1c04fd034f7c7522e94480f5aa30c98c72f35 (patch)
treea337dcdc757dfcd783bf4425d0458bbc946824dd /src/mesa/drivers/dri
parent59b2c2adbbece27ccf54e58b598ea29cb3a5aa85 (diff)
intel: Fix glDrawPixels with 4d RasterPos.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index 50518a68792..4a2fbf3bc6b 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -141,22 +141,27 @@ intel_texture_drawpixels(GLcontext * ctx,
_mesa_PushMatrix();
_mesa_LoadIdentity();
+ /* 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
+ * into ctx->Current.RasterPos[0,1,2] and we can ignore it at this point.
+ */
vertices[0][0] = x;
vertices[0][1] = y;
vertices[0][2] = ctx->Current.RasterPos[2];
- vertices[0][3] = ctx->Current.RasterPos[3];
+ vertices[0][3] = 1.0;
vertices[1][0] = x + width * ctx->Pixel.ZoomX;
vertices[1][1] = y;
vertices[1][2] = ctx->Current.RasterPos[2];
- vertices[1][3] = ctx->Current.RasterPos[3];
+ vertices[1][3] = 1.0;
vertices[2][0] = x + width * ctx->Pixel.ZoomX;
vertices[2][1] = y + height * ctx->Pixel.ZoomY;
vertices[2][2] = ctx->Current.RasterPos[2];
- vertices[2][3] = ctx->Current.RasterPos[3];
+ vertices[2][3] = 1.0;
vertices[3][0] = x;
vertices[3][1] = y + height * ctx->Pixel.ZoomY;
vertices[3][2] = ctx->Current.RasterPos[2];
- vertices[3][3] = ctx->Current.RasterPos[3];
+ vertices[3][3] = 1.0;
texcoords[0][0] = 0.0;
texcoords[0][1] = 0.0;