R6xx/r7xx: Correct the indeices of DRAW_INDEX_IMMD
authorCooper Yuan <cooperyuan@gmail.com>
Thu, 2 Jul 2009 08:49:19 +0000 (16:49 +0800)
committerCooper Yuan <cooperyuan@gmail.com>
Thu, 2 Jul 2009 08:49:19 +0000 (16:49 +0800)
src/mesa/drivers/dri/r600/r700_render.c

index e46b21c85c15b621d95efce9fd59d7d41384f678..a1ad929a67b4e169996a279e03e9c214e0a72afc 100644 (file)
@@ -238,6 +238,7 @@ static GLboolean r700RunRender(GLcontext * ctx,
 {
     context_t *context = R700_CONTEXT(ctx);
     R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
+    int lastIndex = 0;
 #if 1
     BATCH_LOCALS(&context->radeon);
 
@@ -308,7 +309,6 @@ static GLboolean r700RunRender(GLcontext * ctx,
         GLuint end = vb->Primitive[i].start + vb->Primitive[i].count;
         GLuint numIndices = vb->Primitive[i].count;
         GLuint numEntires;
-               //r300RunRenderPrimitive(rmesa, ctx, start, end, prim);
 
         unsigned int VGT_DRAW_INITIATOR = 0;
         unsigned int VGT_INDEX_TYPE     = 0;
@@ -340,10 +340,12 @@ static GLboolean r700RunRender(GLcontext * ctx,
         R600_OUT_BATCH(VGT_NUM_INDICES);
         R600_OUT_BATCH(VGT_DRAW_INITIATOR);
 
-        for (j=0; j<numIndices; j++)
+        for (j = lastIndex; j < lastIndex + numIndices; j++)
         {
             R600_OUT_BATCH(j);
         }
+        lastIndex += numIndices;
+
         END_BATCH();
         COMMIT_BATCH();
     }