diff options
author | Marek Olšák <[email protected]> | 2010-07-08 06:20:01 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-07-08 18:02:30 +0200 |
commit | 62c631b20576ddee9a3c3d53709ca2932b0fbf9f (patch) | |
tree | d370e2917394777f6ae69f9e71a13037cc30fa21 /src/gallium/drivers/r300/r300_state.c | |
parent | f9e8cdc145fc0ba1f6c47e20860add6528387c7c (diff) |
r300g: add a function for marking framebuffer atoms as dirty
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4bb57576899..4fbe8bfa4e6 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -670,6 +670,30 @@ static void r300_print_fb_surf_info(struct pipe_surface *surf, unsigned index, tex->last_level, util_format_short_name(tex->format)); } +void r300_mark_fb_state_dirty(struct r300_context *r300, + enum r300_fb_state_change change) +{ + struct pipe_framebuffer_state *state = r300->fb_state.state; + + /* What is marked as dirty depends on the enum r300_fb_state_change. */ + r300->gpu_flush.dirty = TRUE; + r300->fb_state.dirty = TRUE; + r300->hyperz_state.dirty = TRUE; + + if (change == R300_CHANGED_FB_STATE) { + r300->aa_state.dirty = TRUE; + r300->fb_state_pipelined.dirty = TRUE; + } + + /* Now compute the fb_state atom size. */ + r300->fb_state.size = 2 + (8 * state->nr_cbufs); + + if (state->zsbuf) + r300->fb_state.size += r300->screen->caps.has_hiz ? 18 : 14; + + /* The size of the rest of atoms stays the same. */ +} + static void r300_set_framebuffer_state(struct pipe_context* pipe, const struct pipe_framebuffer_state* state) @@ -698,12 +722,6 @@ static void draw_flush(r300->draw); } - r300->gpu_flush.dirty = TRUE; - r300->aa_state.dirty = TRUE; - r300->fb_state.dirty = TRUE; - r300->hyperz_state.dirty = TRUE; - r300->fb_state_pipelined.dirty = TRUE; - /* If nr_cbufs is changed from zero to non-zero or vice versa... */ if (!!old_state->nr_cbufs != !!state->nr_cbufs) { r300->blend_state.dirty = TRUE; @@ -718,10 +736,7 @@ static void util_assign_framebuffer_state(r300->fb_state.state, state); - r300->fb_state.size = - 2 + - (8 * state->nr_cbufs) + - (state->zsbuf ? (r300->screen->caps.has_hiz ? 18 : 14) : 0); + r300_mark_fb_state_dirty(r300, R300_CHANGED_FB_STATE); /* Polygon offset depends on the zbuffer bit depth. */ if (state->zsbuf && r300->polygon_offset_enabled) { |