Mesa (master): r300g: fix fallback for misaligned ushort indices with num vertices >= 65535

Marek Olšák mareko at kemper.freedesktop.org
Mon Feb 14 10:49:36 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Feb 14 10:05:52 2011 +0100

r300g: fix fallback for misaligned ushort indices with num vertices >= 65535

---

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

diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index fddabee..051f434 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -615,7 +615,11 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
 				minIndex, maxIndex, mode, start, count, indices3);
     } else {
         do {
-            short_count = MIN2(count, 65534);
+            if (indexSize == 2 && (start & 1))
+                short_count = MIN2(count, 65535);
+            else
+                short_count = MIN2(count, 65534);
+
             r300_emit_draw_elements(r300, indexBuffer, indexSize,
                                      minIndex, maxIndex,
                                      mode, start, short_count, indices3);




More information about the mesa-commit mailing list