Module: Mesa
Branch: master
Commit: 2764a5191ffcaf93a77beff464ac8eca15163fcc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2764a5191ffcaf93a77beff464ac8eca15163fcc

Author: Corbin Simpson <[email protected]>
Date:   Fri Mar 12 18:13:18 2010 -0800

r300g: Forcibly sanitize max index.

Not perfect, but the kernel should shut up now.

---

 src/gallium/drivers/r300/r300_render.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c 
b/src/gallium/drivers/r300/r300_render.c
index ef1b751..ccf3987 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -274,14 +274,14 @@ static void r300_emit_draw_elements(struct r300_context 
*r300,
 #endif
     CS_LOCALS(r300);
 
-    assert((start * indexSize)  % 4 == 0);
+    assert((start * indexSize) % 4 == 0);
     assert(count < (1 << 24));
 
+    maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, count - minIndex);
+
     DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n",
         count, minIndex, maxIndex);
 
-    maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, (1 << 24) - 1);
-
     if (alt_num_verts) {
         BEGIN_CS(15);
         OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to