Mesa (master): r300g: Don't write non-existent bit on non-r500.

Corbin Simpson csimpson at kemper.freedesktop.org
Tue Feb 9 21:54:25 UTC 2010


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

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Tue Feb  9 13:53:30 2010 -0800

r300g: Don't write non-existent bit on non-r500.

Might help with compiz being funky with MRTs.

---

 src/gallium/drivers/r300/r300_emit.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index ae83511..de6ba65 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -381,6 +381,7 @@ void r500_emit_fs_constant_buffer(struct r300_context* r300,
 void r300_emit_fb_state(struct r300_context* r300, void* state)
 {
     struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)state;
+    struct r300_screen* r300screen = r300_screen(r300->context.screen);
     struct r300_texture* tex;
     struct pipe_surface* surf;
     int i;
@@ -399,10 +400,16 @@ void r300_emit_fb_state(struct r300_context* r300, void* state)
 
     /* Set the number of colorbuffers. */
     if (fb->nr_cbufs > 1) {
-        OUT_CS_REG(R300_RB3D_CCTL,
-            R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
-            R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE |
-            R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
+        if (r300screen->caps->is_r500) {
+            OUT_CS_REG(R300_RB3D_CCTL,
+                R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
+                R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE |
+                R300_RB3D_CCTL_INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE);
+        } else {
+            OUT_CS_REG(R300_RB3D_CCTL,
+                R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs) |
+                R300_RB3D_CCTL_INDEPENDENT_COLORFORMAT_ENABLE_ENABLE);
+        }
     } else {
         OUT_CS_REG(R300_RB3D_CCTL, 0x0);
     }




More information about the mesa-commit mailing list