summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_surface.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-02-14 14:10:41 +0100
committerChristoph Bumiller <[email protected]>2011-02-16 15:45:31 +0100
commit19f2272e94895cf241f6b05117535e008e07d0a7 (patch)
treee196e475c93b458a5d3ff3ea4c5e7f6ca69e642b /src/gallium/drivers/nvc0/nvc0_surface.c
parent293a8d1b600cd5bd89b3c4c0b6c2bb245d9bd80f (diff)
nvc0: demagic the clear flags and fix region clears
The CLIP_RECTs always affect dedicated clears, and it's nicer than having to mark the viewport or scissor state dirty after it.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_surface.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_surface.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c
index faa51769313..8898bc733a3 100644
--- a/src/gallium/drivers/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nvc0/nvc0_surface.c
@@ -243,15 +243,16 @@ nvc0_clear_render_target(struct pipe_context *pipe,
OUT_RING (chan, 1);
OUT_RING (chan, 0);
- /* NOTE: only works with D3D clear flag (5097/0x143c bit 4) */
-
- BEGIN_RING(chan, RING_3D(VIEWPORT_HORIZ(0)), 2);
- OUT_RING (chan, (width << 16) | dstx);
- OUT_RING (chan, (height << 16) | dsty);
+ BEGIN_RING(chan, RING_3D(CLIP_RECT_HORIZ(0)), 2);
+ OUT_RING (chan, ((dstx + width) << 16) | dstx);
+ OUT_RING (chan, ((dsty + height) << 16) | dsty);
+ IMMED_RING(chan, RING_3D(CLIP_RECTS_EN), 1);
BEGIN_RING(chan, RING_3D(CLEAR_BUFFERS), 1);
OUT_RING (chan, 0x3c);
+ IMMED_RING(chan, RING_3D(CLIP_RECTS_EN), 0);
+
nv50->dirty |= NVC0_NEW_FRAMEBUFFER;
}
@@ -300,13 +301,16 @@ nvc0_clear_depth_stencil(struct pipe_context *pipe,
OUT_RING (chan, sf->height);
OUT_RING (chan, (1 << 16) | 1);
- BEGIN_RING(chan, RING_3D(VIEWPORT_HORIZ(0)), 2);
- OUT_RING (chan, (width << 16) | dstx);
- OUT_RING (chan, (height << 16) | dsty);
+ BEGIN_RING(chan, RING_3D(CLIP_RECT_HORIZ(0)), 2);
+ OUT_RING (chan, ((dstx + width) << 16) | dstx);
+ OUT_RING (chan, ((dsty + height) << 16) | dsty);
+ IMMED_RING(chan, RING_3D(CLIP_RECTS_EN), 1);
BEGIN_RING(chan, RING_3D(CLEAR_BUFFERS), 1);
OUT_RING (chan, mode);
+ IMMED_RING(chan, RING_3D(CLIP_RECTS_EN), 0);
+
nv50->dirty |= NVC0_NEW_FRAMEBUFFER;
}