aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r600/r700_chip.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2009-07-14 20:08:27 -0400
committerAlex Deucher <[email protected]>2009-07-14 20:08:27 -0400
commit9385e4e1ff343c135532ddde04c0febf297003d7 (patch)
tree0f7d38708816fca4e34ec16ca161c9fdb35a4b94 /src/mesa/drivers/dri/r600/r700_chip.c
parent9ae78dc0bc948d56198c344d077a1513e531c4d4 (diff)
r6xx/r7xx: fix buffer aging bug
We were using sparse indexing for aos, while the common code expected packed indexing.
Diffstat (limited to 'src/mesa/drivers/dri/r600/r700_chip.c')
-rw-r--r--src/mesa/drivers/dri/r600/r700_chip.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c
index ae380d83fcd..9bd892a4394 100644
--- a/src/mesa/drivers/dri/r600/r700_chip.c
+++ b/src/mesa/drivers/dri/r600/r700_chip.c
@@ -355,7 +355,7 @@ int r700SetupStreams(GLcontext * ctx)
struct vertex_buffer *vb = &tnl->vb;
unsigned int unBit;
- unsigned int i;
+ unsigned int i, j = 0;
BEGIN_BATCH_NO_AUTOSTATE(6);
R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CTL_CONST, 1));
@@ -374,21 +374,23 @@ int r700SetupStreams(GLcontext * ctx)
unBit = 1 << i;
if(vpc->mesa_program.Base.InputsRead & unBit)
{
- rcommon_emit_vector(ctx,
- &context->radeon.tcl.aos[i],
- vb->AttribPtr[i]->data,
- vb->AttribPtr[i]->size,
- vb->AttribPtr[i]->stride,
- vb->Count);
-
- /* currently aos are packed */
- r700SetupVTXConstants(ctx,
- i,
- (void*)(&context->radeon.tcl.aos[i]),
- (unsigned int)context->radeon.tcl.aos[i].components,
- (unsigned int)context->radeon.tcl.aos[i].stride * 4,
- (unsigned int)context->radeon.tcl.aos[i].count);
-
+ if (!context->radeon.tcl.aos[j].bo) {
+ rcommon_emit_vector(ctx,
+ &context->radeon.tcl.aos[j],
+ vb->AttribPtr[i]->data,
+ vb->AttribPtr[i]->size,
+ vb->AttribPtr[i]->stride,
+ vb->Count);
+
+ /* currently aos are packed */
+ r700SetupVTXConstants(ctx,
+ j,
+ (void*)(&context->radeon.tcl.aos[j]),
+ (unsigned int)context->radeon.tcl.aos[j].components,
+ (unsigned int)context->radeon.tcl.aos[j].stride * 4,
+ (unsigned int)context->radeon.tcl.aos[j].count);
+ j++;
+ }
context->radeon.tcl.aos_count++;
}
}