diff options
author | Marek Olšák <[email protected]> | 2010-07-21 20:41:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-07-21 22:54:34 +0200 |
commit | 5725738ef6a4b5110064d4e2e0ce4f7609e875e4 (patch) | |
tree | 6d25ee4ecf8e3a0c41fd68623df5f381755376ac /src/gallium | |
parent | 9ca48de1068d4ebce81853d29455c83b4898e25e (diff) |
r300g: cleanup clip state emission
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 8d849cd2442..0bbc022f837 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -429,12 +429,16 @@ static void r300_set_clip_state(struct pipe_context* pipe, clip->clip = *state; if (r300->screen->caps.has_tcl) { - BEGIN_CB(clip->cb, 29); - OUT_CB_REG(R300_VAP_PVS_VECTOR_INDX_REG, - (r300->screen->caps.is_r500 ? - R500_PVS_UCP_START : R300_PVS_UCP_START)); - OUT_CB_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, 6 * 4); - OUT_CB_TABLE(state->ucp, 6 * 4); + r300->clip_state.size = 2 + !!state->nr * 3 + state->nr * 4; + + BEGIN_CB(clip->cb, r300->clip_state.size); + if (state->nr) { + OUT_CB_REG(R300_VAP_PVS_VECTOR_INDX_REG, + (r300->screen->caps.is_r500 ? + R500_PVS_UCP_START : R300_PVS_UCP_START)); + OUT_CB_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, state->nr * 4); + OUT_CB_TABLE(state->ucp, state->nr * 4); + } OUT_CB_REG(R300_VAP_CLIP_CNTL, ((1 << state->nr) - 1) | R300_PS_UCP_MODE_CLIP_AS_TRIFAN); END_CB; |