rendered paste bodydiff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 65930ff..ad7d402 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -192,9 +192,9 @@ static int r600_cs_begin(struct radeon_cs *cs,
if (cs->cdw + ndw > cs->ndw) {
uint32_t tmp, *ptr;
- int num = (ndw > 0x3FF) ? ndw : 0x3FF;
+ int num = (ndw > 0x400) ? ndw : 0x400;
- tmp = (cs->cdw + 1 + num) & (~num);
+ tmp = (cs->cdw + num + 0x3FF) & (~0x3FF);
ptr = (uint32_t*)realloc(cs->packets, 4 * tmp);
if (ptr == NULL) {
return -ENOMEM;
@@ -228,7 +228,13 @@ static int r600_cs_end(struct radeon_cs *cs,
file, func, line);
return -EPIPE;
}
-
+ if (cs->cdw > cs->ndw) {
+ fprintf(stderr, "CS section overflow at (%s,%s,%d) cdw %d ndw %d\n",
+ cs->section_file, cs->section_func, cs->section_line,cs->cdw,cs->ndw);
+ fprintf(stderr, "CS section end at (%s,%s,%d)\n",
+ file, func, line);
+ assert(0);
+ }
return 0;
}
diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c
index e1bbbfe..0fba73c 100644
--- a/src/mesa/drivers/dri/r600/r700_render.c
+++ b/src/mesa/drivers/dri/r600/r700_render.c
@@ -243,7 +243,8 @@ static int r700NumVerts(int num_verts, int prim)
return -1;
break;
}
-
+ if(verts_off)
+ fprintf(stderr,"Stripping %i verts\n",verts_off);
return num_verts - verts_off;
}
@@ -298,9 +299,14 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim
R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1)));
R600_OUT_BATCH(vgt_num_indices);
R600_OUT_BATCH(vgt_draw_initiator);
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *vb = &tnl->vb;
for (i = start; i < (start + num_indices); i++) {
- R600_OUT_BATCH(i);
+ if(vb->Elts)
+ R600_OUT_BATCH(vb->Elts[i]);
+ else
+ R600_OUT_BATCH(i);
}
END_BATCH();
COMMIT_BATCH();
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 12911f5..5e4605b 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -675,7 +675,7 @@ vbo_exec_DrawRangeElements(GLenum mode,
if (end >= ctx->Array.ArrayObj->_MaxElement) {
/* the max element is out of bounds of one or more enabled arrays */
- _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
+ if (0) _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, "
"type 0x%x, indices=%p)\n"
"\tindex=%u is out of bounds (max=%u) "
"Element Buffer %u (size %d)",
@@ -689,7 +689,7 @@ vbo_exec_DrawRangeElements(GLenum mode,
if (0)
_mesa_print_arrays(ctx);
- return;
+ //return;
}
else if (0) {
_mesa_printf("glDraw[Range]Elements"