summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2005-02-18 16:58:19 +0000
committerAapo Tahkola <aet@rasterburn.org>2005-02-18 16:58:19 +0000
commit4d73f1af35aed1483804b7a9639f231be1ee4bf1 (patch)
treee6795fb26442b7567e838e8cb709368634a63b6d /src/mesa/drivers/dri/r300
parent26d812ae00e0bb5abb23e95a36492ef59d416c16 (diff)
We dont need to call r300EmitAOS if we arent going to draw anything(r300_get_num_verts returns 0).
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index e184a16d56..71977e7e41 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -556,7 +556,7 @@ static void inline fire_EB(PREFIX unsigned long addr, int vertex_count, int type
}
#endif
check_space(6);
-
+
start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0);
e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count<<16) | type);
@@ -564,6 +564,7 @@ static void inline fire_EB(PREFIX unsigned long addr, int vertex_count, int type
e32(R300_EB_UNK1 | (magic_1 << 16) | R300_EB_UNK2);
e32(addr);
e32(((vertex_count+1) / 2) + magic_1); /* This still fails once in a while */
+
}
static void r300_render_vb_primitive(r300ContextPtr rmesa,
@@ -588,6 +589,7 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa,
unsigned long elt_count;
WARN_ONCE("Rendering with elts\n");
+ r300EmitAOS(rmesa, rmesa->state.aos_count, 0);
#if 1
start_index32_packet(num_verts, type);
for(i=0; i < num_verts; i++)
@@ -598,8 +600,10 @@ static void r300_render_vb_primitive(r300ContextPtr rmesa,
emit_elts(ctx, rmesa->state.Elts+start, num_verts, elt_count, get_align(elt_count));
fire_EB(PASS_PREFIX rsp->gartTextures.handle/*rmesa->state.elt_ao.aos_offset*/, elt_count, type);
#endif
- }else
+ }else{
+ r300EmitAOS(rmesa, rmesa->state.aos_count, start);
fire_AOS(PASS_PREFIX num_verts, type);
+ }
}
static GLboolean r300_run_vb_render(GLcontext *ctx,
@@ -639,10 +643,7 @@ static GLboolean r300_run_vb_render(GLcontext *ctx,
GLuint prim = VB->Primitive[i].mode;
GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;
- if(rmesa->state.Elts)
- r300EmitAOS(rmesa, rmesa->state.aos_count, 0);
- else
- r300EmitAOS(rmesa, rmesa->state.aos_count, start);
+
r300_render_vb_primitive(rmesa, ctx, start, start + length, prim);
}