aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_blit.c
diff options
context:
space:
mode:
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);