summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_emit.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-06-05 00:11:41 +0200
committerChristian König <[email protected]>2011-06-05 00:11:41 +0200
commit1eb957bb4108123bea95b818e0544e3b5f255e08 (patch)
treed7febd8e6cc841ab16dca53f031322ec47d5ccd9 /src/gallium/drivers/r300/r300_emit.c
parenta6c76c8a90dc8995feed3c61b02dbd8408149036 (diff)
parent6491e9593d5cbc5644eb02593a2f562447efdcbb (diff)
Merge remote-tracking branch 'origin/master' into pipe-video
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 874037ed9fd..d214af4cd5b 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -439,6 +439,19 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
OUT_CS_REG(R300_ZB_ZMASK_OFFSET, 0);
OUT_CS_REG(R300_ZB_ZMASK_PITCH, surf->pitch_zmask);
}
+ /* Set up a dummy zbuffer. Otherwise occlusion queries won't work.
+ * Use the first colorbuffer, we will disable writes in the DSA state
+ * so as not to corrupt it. */
+ } else if (fb->nr_cbufs) {
+ surf = r300_surface(fb->cbufs[0]);
+
+ OUT_CS_REG(R300_ZB_FORMAT, R300_DEPTHFORMAT_16BIT_INT_Z);
+
+ OUT_CS_REG(R300_ZB_DEPTHOFFSET, 0);
+ OUT_CS_RELOC(surf);
+
+ OUT_CS_REG(R300_ZB_DEPTHPITCH, 4 | R300_DEPTHMICROTILE_TILED_SQUARE);
+ OUT_CS_RELOC(surf);
}
END_CS;