summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-05-26 20:59:46 +0200
committerMarek Olšák <maraeo@gmail.com>2010-05-26 22:22:52 +0200
commit3a6fd21917b7fb5a96bb60cd963f481ac5f989a6 (patch)
treea51678a49b197983945db4fe23d93820c2e4861b
parent55a6d3743436fb811dfa1825aabff82fb6610c04 (diff)
r300g/swtcl: force vertex prefetching for non-indexed primitives
-rw-r--r--src/gallium/drivers/r300/r300_emit.c4
-rw-r--r--src/gallium/drivers/r300/r300_emit.h2
-rw-r--r--src/gallium/drivers/r300/r300_render.c7
3 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 40e7b4cb60..123b084b2b 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_aos_swtcl(struct r300_context *r300)
+void r300_emit_aos_swtcl(struct r300_context *r300, boolean indexed)
{
CS_LOCALS(r300);
@@ -880,7 +880,7 @@ void r300_emit_aos_swtcl(struct r300_context *r300)
*/
BEGIN_CS(7);
OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, 3);
- OUT_CS(1);
+ OUT_CS(1 | (!indexed ? R300_VC_FORCE_PREFETCH : 0));
OUT_CS(r300->vertex_info.size |
(r300->vertex_info.size << 8));
OUT_CS(r300->vbo_offset);
diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h
index da05aff45b..55e5898ea8 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_aos_swtcl(struct r300_context *r300);
+void r300_emit_aos_swtcl(struct r300_context *r300, boolean indexed);
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 041ae8036b..a5d129449e 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -191,7 +191,7 @@ static void r300_prepare_for_rendering(struct r300_context *r300,
if (emit_aos)
r300_emit_aos(r300, aos_offset, flags & PREP_INDEXED);
if (emit_aos_swtcl)
- r300_emit_aos_swtcl(r300);
+ r300_emit_aos_swtcl(r300, flags & PREP_INDEXED);
}
}
@@ -997,8 +997,9 @@ static void r500_render_draw_elements(struct vbuf_render* render,
CS_LOCALS(r300);
- r300_prepare_for_rendering(r300, PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL,
- NULL, dwords, 0, 0);
+ r300_prepare_for_rendering(r300,
+ PREP_FIRST_DRAW | PREP_EMIT_AOS_SWTCL | PREP_INDEXED,
+ NULL, dwords, 0, 0);
BEGIN_CS(dwords);
OUT_CS_REG(R300_GA_COLOR_CONTROL,