freedreno/a3xx: fix viewport on gmem->mem resolve
authorRob Clark <robclark@freedesktop.org>
Sat, 13 Jul 2013 17:08:22 +0000 (13:08 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 24 Aug 2013 17:04:29 +0000 (13:04 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_gmem.c

index 1cb170af261576730aa8f75b5123d4333fa9a1da..9050166e0788b9aa63fa4cffaf769d12434a6fc0 100644 (file)
@@ -168,6 +168,14 @@ fd3_emit_tile_gmem2mem(struct fd_context *ctx, uint32_t xoff, uint32_t yoff,
        OUT_PKT0(ring, REG_A3XX_GRAS_CL_CLIP_CNTL, 1);
        OUT_RING(ring, 0x00000000);   /* GRAS_CL_CLIP_CNTL */
 
+       OUT_PKT0(ring, REG_A3XX_GRAS_CL_VPORT_XOFFSET, 6);
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_XOFFSET((float)pfb->width/2.0 - 0.5));
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_XSCALE((float)pfb->width/2.0));
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_YOFFSET((float)pfb->height/2.0 - 0.5));
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_YSCALE(-(float)pfb->height/2.0));
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_ZOFFSET(0.0));
+       OUT_RING(ring, A3XX_GRAS_CL_VPORT_ZSCALE(1.0));
+
        OUT_PKT0(ring, REG_A3XX_RB_MODE_CONTROL, 1);
        OUT_RING(ring, A3XX_RB_MODE_CONTROL_RENDER_MODE(RB_RESOLVE_PASS) |
                        A3XX_RB_MODE_CONTROL_MARB_CACHE_SPLIT_MODE);