diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-02-12 04:49:30 +0100 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-02-13 15:44:43 +0100 |
commit | 8eb4cd5b825db7bf26da240ccddaf9a7e5e55a62 (patch) | |
tree | e159044848c055c6147ff0f8f479a561150aa41b /src/gallium/drivers/r300/r300_state_derived.c | |
parent | 67049b59fdc3fb8dff6a04cb4929f48c28cd88ca (diff) |
r300g: cleanup the emission of RS block state
Emit as few regs as possible.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state_derived.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index bad9e76067..2cbce9210a 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -306,7 +306,7 @@ static void r300_update_rs_block(struct r300_context* r300, struct r300_shader_semantics* fs_inputs) { struct r300_rs_block rs = { { 0 } }; - int i, col_count = 0, tex_count = 0, fp_offset = 0; + int i, col_count = 0, tex_count = 0, fp_offset = 0, count; void (*rX00_rs_col)(struct r300_rs_block*, int, int, boolean); void (*rX00_rs_col_write)(struct r300_rs_block*, int, int); void (*rX00_rs_tex)(struct r300_rs_block*, int, int, boolean); @@ -410,11 +410,13 @@ static void r300_update_rs_block(struct r300_context* r300, rs.count = (tex_count*4) | (col_count << R300_IC_COUNT_SHIFT) | R300_HIRES_EN; - rs.inst_count = MAX3(col_count - 1, tex_count - 1, 0); + count = MAX3(col_count, tex_count, 1); + rs.inst_count = count - 1; /* Now, after all that, see if we actually need to update the state. */ if (memcmp(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block))) { memcpy(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block)); + r300->rs_block_state.size = 5 + count; r300->rs_block_state.dirty = TRUE; } } |