r300-gallium: Emit Z/stencil buffer offset.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 14 Feb 2009 09:55:38 +0000 (01:55 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 14 Feb 2009 09:55:38 +0000 (01:55 -0800)
src/gallium/drivers/r300/r300_emit.c

index 8108b99f944fc15477773c8dfb1f9a68df7cd86f..21803443fe2585491e074923e97ccda12d05f647 100644 (file)
@@ -168,6 +168,19 @@ void r300_emit_fb_state(struct r300_context* r300,
         OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i),
             translate_out_fmt(fb->cbufs[i]->format));
     }
+
+    if (fb->zsbuf) {
+        tex = (struct r300_texture*)fb->zsbuf->texture;
+        OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1);
+        OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+    }
+
+    OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT,
+        R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS |
+        R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D);
+    OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT,
+        R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE |
+        R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE);
     R300_PACIFY;
     END_CS;
 }