summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-05-29 06:12:22 +0200
committerMarek Olšák <[email protected]>2011-05-29 16:17:11 +0200
commit76056510bcd35b6b5607b572c0c0ff47b5c5e7e2 (patch)
treeddbcdd942f333de81752bbb0d9d77b281318251e /src/gallium/drivers/r300/r300_blit.c
parentaae56150f5d59d45e13a4033b20f0ccf20a3319c (diff)
r300g: clear can be killed by render condition
Fixes piglit: - NV_conditional_render/clear
Diffstat (limited to 'src/gallium/drivers/r300/r300_blit.c')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index 7f430269e41..388ebcdbf32 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -30,14 +30,24 @@
enum r300_blitter_op /* bitmask */
{
- R300_CLEAR = 1,
- R300_CLEAR_SURFACE = 2,
- R300_COPY = 4
+ R300_STOP_QUERY = 1,
+ R300_SAVE_TEXTURES = 2,
+ R300_SAVE_FRAMEBUFFER = 4,
+ R300_IGNORE_RENDER_COND = 8,
+
+ R300_CLEAR = R300_STOP_QUERY,
+
+ R300_CLEAR_SURFACE = R300_STOP_QUERY | R300_SAVE_FRAMEBUFFER,
+
+ R300_COPY = R300_STOP_QUERY | R300_SAVE_FRAMEBUFFER |
+ R300_SAVE_TEXTURES | R300_IGNORE_RENDER_COND,
+
+ R300_DECOMPRESS = R300_STOP_QUERY | R300_IGNORE_RENDER_COND,
};
static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op op)
{
- if (r300->query_current) {
+ if ((op & R300_STOP_QUERY) && r300->query_current) {
r300->blitter_saved_query = r300->query_current;
r300_stop_query(r300);
}
@@ -57,11 +67,11 @@ static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op o
util_blitter_save_vertex_buffers(r300->blitter, r300->vbuf_mgr->nr_vertex_buffers,
r300->vbuf_mgr->vertex_buffer);
- if (op & (R300_CLEAR_SURFACE | R300_COPY)) {
+ if (op & R300_SAVE_FRAMEBUFFER) {
util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
}
- if (op & R300_COPY) {
+ if (op & R300_SAVE_TEXTURES) {
struct r300_textures_state* state =
(struct r300_textures_state*)r300->textures_state.state;
@@ -73,6 +83,14 @@ static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op o
r300->blitter, state->sampler_view_count,
(struct pipe_sampler_view**)state->sampler_views);
}
+
+ if (op & R300_IGNORE_RENDER_COND) {
+ /* Save the flag. */
+ r300->blitter_saved_skip_rendering = r300->skip_rendering+1;
+ r300->skip_rendering = FALSE;
+ } else {
+ r300->blitter_saved_skip_rendering = 0;
+ }
}
static void r300_blitter_end(struct r300_context *r300)
@@ -81,6 +99,11 @@ static void r300_blitter_end(struct r300_context *r300)
r300_resume_query(r300, r300->blitter_saved_query);
r300->blitter_saved_query = NULL;
}
+
+ if (r300->blitter_saved_skip_rendering) {
+ /* Restore the flag. */
+ r300->skip_rendering = r300->blitter_saved_skip_rendering-1;
+ }
}
static uint32_t r300_depth_clear_cb_value(enum pipe_format format,
@@ -374,7 +397,7 @@ void r300_decompress_zmask(struct r300_context *r300)
r300->zmask_decompress = TRUE;
r300_mark_atom_dirty(r300, &r300->hyperz_state);
- r300_blitter_begin(r300, R300_CLEAR);
+ r300_blitter_begin(r300, R300_DECOMPRESS);
util_blitter_clear_depth_custom(r300->blitter, fb->width, fb->height, 0,
r300->dsa_decompress_zmask);
r300_blitter_end(r300);