summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-04-26 05:04:07 +0200
committerMarek Olšák <maraeo@gmail.com>2010-04-26 07:22:00 +0200
commitb9e637e8cf1cba99c138f5ca2d79ae5afefb1020 (patch)
tree03b454aa5775157279e98f3e43c62aad122c9f21 /src
parent537d117ed57734d034560cc64fe1bed65a6375e3 (diff)
r300g: force prefetch for non-indexed vertices
Diffstat (limited to 'src')
-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_reg.h2
-rw-r--r--src/gallium/drivers/r300/r300_render.c8
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 7dc7c1d0ef..ac3b5b0905 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -823,7 +823,7 @@ void r300_emit_textures_state(struct r300_context *r300,
END_CS;
}
-void r300_emit_aos(struct r300_context* r300, unsigned offset)
+void r300_emit_aos(struct r300_context* r300, unsigned offset, boolean indexed)
{
struct pipe_vertex_buffer *vb1, *vb2, *vbuf = r300->vertex_buffer;
struct pipe_vertex_element *velem = r300->velems->velem;
@@ -843,7 +843,7 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset)
BEGIN_CS(2 + packet_size + aos_count * 2);
OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, packet_size);
- OUT_CS(aos_count);
+ OUT_CS(aos_count | (!indexed ? R300_VC_FORCE_PREFETCH : 0));
for (i = 0; i < aos_count - 1; i += 2) {
vb1 = &vbuf[velem[i].vertex_buffer_index];
diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h
index 56f7318cdb..c3eb195d4e 100644
--- a/src/gallium/drivers/r300/r300_emit.h
+++ b/src/gallium/drivers/r300/r300_emit.h
@@ -29,7 +29,7 @@
struct rX00_fragment_program_code;
struct r300_vertex_program_code;
-void r300_emit_aos(struct r300_context* r300, unsigned offset);
+void r300_emit_aos(struct r300_context* r300, unsigned offset, boolean indexed);
void r300_emit_blend_state(struct r300_context* r300,
unsigned size, void* state);
diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
index 239f91443f..675a9317f9 100644
--- a/src/gallium/drivers/r300/r300_reg.h
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -3377,7 +3377,7 @@ enum {
* the last block is omitted.
*/
#define R300_PACKET3_3D_LOAD_VBPNTR 0x00002F00
-
+# define R300_VC_FORCE_PREFETCH (1 << 5)
# define R300_VBPNTR_SIZE0(x) ((x) >> 2)
# define R300_VBPNTR_STRIDE0(x) (((x) >> 2) << 8)
# define R300_VBPNTR_SIZE1(x) (((x) >> 2) << 16)
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 23b61df89c..8e2acc4ac3 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -574,7 +574,7 @@ void r300_draw_range_elements(struct pipe_context* pipe,
r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128);
r300_emit_buffer_validate(r300, TRUE, indexBuffer);
r300_emit_dirty_state(r300);
- r300_emit_aos(r300, 0);
+ r300_emit_aos(r300, 0, TRUE);
u_upload_flush(r300->upload_vb);
u_upload_flush(r300->upload_ib);
@@ -595,7 +595,7 @@ void r300_draw_range_elements(struct pipe_context* pipe,
if (count && r300_reserve_cs_space(r300, 16)) {
r300_emit_buffer_validate(r300, TRUE, indexBuffer);
r300_emit_dirty_state(r300);
- r300_emit_aos(r300, 0);
+ r300_emit_aos(r300, 0, TRUE);
}
} while (count);
}
@@ -650,12 +650,12 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
r300_emit_dirty_state(r300);
if (alt_num_verts || count <= 65535) {
- r300_emit_aos(r300, start);
+ r300_emit_aos(r300, start, FALSE);
r300->emit_draw_arrays(r300, mode, count);
} else {
do {
short_count = MIN2(count, 65535);
- r300_emit_aos(r300, start);
+ r300_emit_aos(r300, start, FALSE);
r300->emit_draw_arrays(r300, mode, short_count);
start += short_count;