Mesa (master): nv50: fix mrt clear

Ben Skeggs darktama at kemper.freedesktop.org
Mon Apr 13 04:44:12 UTC 2009


Module: Mesa
Branch: master
Commit: 352de305bd2b03b0a8d079dbbcb29ae812cc6028
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=352de305bd2b03b0a8d079dbbcb29ae812cc6028

Author: Ben Skeggs <bskeggs at redhat.com>
Date:   Mon Apr 13 14:41:06 2009 +1000

nv50: fix mrt clear

---

 src/gallium/drivers/nv50/nv50_clear.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_clear.c b/src/gallium/drivers/nv50/nv50_clear.c
index eca65a8..33427a1 100644
--- a/src/gallium/drivers/nv50/nv50_clear.c
+++ b/src/gallium/drivers/nv50/nv50_clear.c
@@ -39,14 +39,12 @@ nv50_clear(struct pipe_context *pipe, unsigned buffers,
 	if (!nv50_state_validate(nv50))
 		return;
 
-	if (buffers & PIPE_CLEAR_COLOR) {
-		BEGIN_RING(chan, tesla, NV50TCL_CLEAR_COLOR(0), 4*fb->nr_cbufs);
-		for (i = 0; i < fb->nr_cbufs; i++) {
-			OUT_RING  (chan, fui(rgba[0]));
-			OUT_RING  (chan, fui(rgba[1]));
-			OUT_RING  (chan, fui(rgba[2]));
-			OUT_RING  (chan, fui(rgba[3]));
-		}
+	if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) {
+		BEGIN_RING(chan, tesla, NV50TCL_CLEAR_COLOR(0), 4);
+		OUT_RING  (chan, fui(rgba[0]));
+		OUT_RING  (chan, fui(rgba[1]));
+		OUT_RING  (chan, fui(rgba[2]));
+		OUT_RING  (chan, fui(rgba[3]));
 		mode |= 0x3c;
 	}
 
@@ -61,5 +59,10 @@ nv50_clear(struct pipe_context *pipe, unsigned buffers,
 
 	BEGIN_RING(chan, tesla, NV50TCL_CLEAR_BUFFERS, 1);
 	OUT_RING  (chan, mode);
+
+	for (i = 1; i < fb->nr_cbufs; i++) {
+		BEGIN_RING(chan, tesla, NV50TCL_CLEAR_BUFFERS, 1);
+		OUT_RING  (chan, (i << 6) | 0x3c);
+	}
 }
 




More information about the mesa-commit mailing list