struct pipe_viewport_state vp;
vp.scale[0] = 0.5f * width;
vp.scale[1] = height * (invert ? -0.5f : 0.5f);
- vp.scale[2] = 1.0f;
+ vp.scale[2] = 0.5f;
vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width;
vp.translate[1] = 0.5f * height;
- vp.translate[2] = 0.0f;
+ vp.translate[2] = 0.5f;
vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
+ /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
+ z = z * 2.0 - 1.0;
+
/* draw textured quad */
offset = setup_bitmap_vertex_data(st, x, y, width, height, z, color);
struct pipe_viewport_state vp;
vp.scale[0] = 0.5f * w;
vp.scale[1] = -0.5f * h;
- vp.scale[2] = 1.0f;
+ vp.scale[2] = 0.5f;
vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * w;
vp.translate[1] = 0.5f * h;
- vp.translate[2] = 0.0f;
+ vp.translate[2] = 0.5f;
vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
y0 = (GLfloat) y;
y1 = y + height * ctx->Pixel.ZoomY;
+ /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
+ z = z * 2.0 - 1.0;
+
draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex,
(GLfloat) width / pt->width0,
(GLfloat) height / pt->height0);