summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-01-14 01:38:51 +0100
committerMarek Olšák <[email protected]>2013-01-15 21:50:34 +0100
commit7660529c44b3f6753e9b5636e876a3cd83c8ba51 (patch)
tree337240303d58cbe61f9b3489fda4aeee8426bf51 /src/gallium/drivers/r300/r300_blit.c
parentca2c28859eca83f8fbf1f43616f5ef861e95e8d6 (diff)
r300g: fix and cleanup flushing before clearing CMASK, ZMASK, and HIZ
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 2bb6063846b..e903e9a57cc 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -295,12 +295,14 @@ static void r300_clear(struct pipe_context* pipe,
r300_depth_clear_value(fb->zsbuf->format, depth, stencil);
r300_mark_atom_dirty(r300, &r300->zmask_clear);
+ r300_mark_atom_dirty(r300, &r300->gpu_flush);
buffers &= ~PIPE_CLEAR_DEPTHSTENCIL;
}
if (hiz_clear) {
r300->hiz_clear_value = r300_hiz_clear_value(depth);
r300_mark_atom_dirty(r300, &r300->hiz_clear);
+ r300_mark_atom_dirty(r300, &r300->gpu_flush);
}
r300->num_z_clears++;
}
@@ -339,6 +341,7 @@ static void r300_clear(struct pipe_context* pipe,
if (r300->screen->cmask_resource == fb->cbufs[0]->texture) {
r300_set_clear_color(r300, color);
r300_mark_atom_dirty(r300, &r300->cmask_clear);
+ r300_mark_atom_dirty(r300, &r300->gpu_flush);
buffers &= ~PIPE_CLEAR_COLOR;
}
}
@@ -375,6 +378,7 @@ static void r300_clear(struct pipe_context* pipe,
* procedure. */
/* Calculate zmask_clear and hiz_clear atom sizes. */
unsigned dwords =
+ r300->gpu_flush.size +
(r300->zmask_clear.dirty ? r300->zmask_clear.size : 0) +
(r300->hiz_clear.dirty ? r300->hiz_clear.size : 0) +
(r300->cmask_clear.dirty ? r300->cmask_clear.size : 0) +
@@ -386,6 +390,9 @@ static void r300_clear(struct pipe_context* pipe,
}
/* Emit clear packets. */
+ r300_emit_gpu_flush(r300, r300->gpu_flush.size, r300->gpu_flush.state);
+ r300->gpu_flush.dirty = FALSE;
+
if (r300->zmask_clear.dirty) {
r300_emit_zmask_clear(r300, r300->zmask_clear.size,
r300->zmask_clear.state);