diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-05-26 20:53:56 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-05-26 22:22:52 +0200 |
commit | 55a6d3743436fb811dfa1825aabff82fb6610c04 (patch) | |
tree | a3ba0cca56bc58f0368b4ab53190ff4d4059ee06 | |
parent | 500160a3c9b0a777586c60abd3d136a5c30937f4 (diff) |
r300g/swtcl: move emitting AOS to prepare_for_rendering
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 15 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 8fceb53998..40e7b4cb60 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -864,7 +864,7 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset, boolean indexed) END_CS; } -void r300_emit_vertex_buffer(struct r300_context* r300) +void r300_emit_aos_swtcl(struct r300_context *r300) { CS_LOCALS(r300); @@ -1168,7 +1168,6 @@ unsigned r300_get_num_dirty_dwords(struct r300_context *r300) /* Emit all dirty state. */ void r300_emit_dirty_state(struct r300_context* r300) { - struct r300_screen* r300screen = r300->screen; struct r300_atom* atom; foreach(atom, &r300->atom_list) { @@ -1181,10 +1180,5 @@ void r300_emit_dirty_state(struct r300_context* r300) } } - /* Emit the VBO for SWTCL. */ - if (!r300screen->caps.has_tcl) { - r300_emit_vertex_buffer(r300); - } - r300->dirty_hw++; } diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 3c0edf6fdc..da05aff45b 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -76,7 +76,7 @@ void r300_emit_scissor_state(struct r300_context* r300, void r300_emit_textures_state(struct r300_context *r300, unsigned size, void *state); -void r300_emit_vertex_buffer(struct r300_context* r300); +void r300_emit_aos_swtcl(struct r300_context *r300); void r300_emit_vertex_stream_state(struct r300_context* r300, unsigned size, void* state); diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 1961e0e53a..041ae8036b 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -136,7 +136,8 @@ enum r300_prepare_flags { PREP_FIRST_DRAW = (1 << 0), PREP_VALIDATE_VBOS = (1 << 1), PREP_EMIT_AOS = (1 << 2), - PREP_INDEXED = (1 << 3) + PREP_EMIT_AOS_SWTCL = (1 << 3), + PREP_INDEXED = (1 << 4) }; /* Check if the requested number of dwords is available in the CS and @@ -152,6 +153,7 @@ static void r300_prepare_for_rendering(struct r300_context *r300, boolean flushed = FALSE; boolean first_draw = flags & PREP_FIRST_DRAW; boolean emit_aos = flags & PREP_EMIT_AOS; + boolean emit_aos_swtcl = flags & PREP_EMIT_AOS_SWTCL; /* Stencil ref fallback. */ if (r300->stencil_ref_bf_fallback) { @@ -167,6 +169,9 @@ static void r300_prepare_for_rendering(struct r300_context *r300, if (emit_aos) cs_dwords += 55; /* emit_aos */ + + if (emit_aos_swtcl) + cs_dwords += 7; /* emit_aos_swtcl */ } /* Emitted in flush. */ @@ -185,6 +190,8 @@ static void r300_prepare_for_rendering(struct r300_context *r300, r500_emit_index_offset(r300, index_bias); if (emit_aos) r300_emit_aos(r300, aos_offset, flags & PREP_INDEXED); + if (emit_aos_swtcl) + r300_emit_aos_swtcl(r300); } } @@ -945,7 +952,8 @@ static void r500_render_draw_arrays(struct vbuf_render* render, (void) i; (void) ptr; - r300_prepare_for_rendering(r300, PREP_FIRST_DRAW, NULL, dwords, 0, 0); + r300_prepare_for_rendering(r300, PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL, + NULL, dwords, 0, 0); DBG(r300, DBG_DRAW, "r300: Doing vbuf render, count %d\n", count); @@ -989,7 +997,8 @@ static void r500_render_draw_elements(struct vbuf_render* render, CS_LOCALS(r300); - r300_prepare_for_rendering(r300, PREP_FIRST_DRAW, NULL, dwords, 0, 0); + r300_prepare_for_rendering(r300, PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL, + NULL, dwords, 0, 0); BEGIN_CS(dwords); OUT_CS_REG(R300_GA_COLOR_CONTROL, |