diff options
author | Marek Olšák <[email protected]> | 2010-04-11 08:27:33 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-04-11 10:15:50 +0200 |
commit | 08afcaa56e187cdd137a5c6581c265c1a0fc8d18 (patch) | |
tree | 7ca1e4cae2ce0e9c4c8ff64254949b613a653a6a /src/gallium/drivers/r300/r300_state.c | |
parent | f39dcdc70ca7413ba3114c76ea43e52c3ab54612 (diff) |
r300g: use cliprects for scissoring
Cliprects can be disabled, scissors can't. It maps nicely to hardware.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index f549b453ee5..95ce1a9600d 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -641,16 +641,13 @@ static void if (!!old_state->zsbuf != !!state->zsbuf) { r300->dsa_state.dirty = TRUE; } - if (!r300->scissor_enabled) { - r300->scissor_state.dirty = TRUE; - } r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state)); r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) + - (state->zsbuf ? 10 : 0) + 8; + (state->zsbuf ? 10 : 0) + 11; /* Polygon offset depends on the zbuffer bit depth. */ if (state->zsbuf && r300->polygon_offset_enabled) { @@ -836,6 +833,8 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->color_control = R300_SHADE_MODEL_SMOOTH; } + rs->clip_rule = state->scissor ? 0xAAAA : 0xFFFF; + return (void*)rs; } @@ -844,7 +843,6 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) { struct r300_context* r300 = r300_context(pipe); struct r300_rs_state* rs = (struct r300_rs_state*)state; - boolean scissor_was_enabled = r300->scissor_enabled; if (r300->draw) { draw_flush(r300->draw); @@ -853,18 +851,12 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) if (rs) { r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; - r300->scissor_enabled = rs->rs.scissor; } else { r300->polygon_offset_enabled = FALSE; - r300->scissor_enabled = FALSE; } UPDATE_STATE(state, r300->rs_state); - r300->rs_state.size = 17 + (r300->polygon_offset_enabled ? 5 : 0); - - if (scissor_was_enabled != r300->scissor_enabled) { - r300->scissor_state.dirty = TRUE; - } + r300->rs_state.size = 19 + (r300->polygon_offset_enabled ? 5 : 0); } /* Free rasterizer state. */ @@ -1070,9 +1062,7 @@ static void r300_set_scissor_state(struct pipe_context* pipe, memcpy(r300->scissor_state.state, state, sizeof(struct pipe_scissor_state)); - if (r300->scissor_enabled) { - r300->scissor_state.dirty = TRUE; - } + r300->scissor_state.dirty = TRUE; } static void r300_set_viewport_state(struct pipe_context* pipe, |