Mesa (7.10): r300g: fix draw_vbo splitting on r3xx-r4xx

Marek Olšák mareko at kemper.freedesktop.org
Wed Jun 8 23:39:16 UTC 2011


Module: Mesa
Branch: 7.10
Commit: 8f8d7d0803a51d2f88493042b31fbf99ccf62f47
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f8d7d0803a51d2f88493042b31fbf99ccf62f47

Author: Marek Olšák <maraeo at gmail.com>
Date:   Thu Jun  9 01:38:24 2011 +0200

r300g: fix draw_vbo splitting on r3xx-r4xx

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 578d4539ba72a9f52e0cb3f615bb04bf9407b574)

Conflicts:

	src/gallium/drivers/r300/r300_render.c

---

 src/gallium/drivers/r300/r300_render.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index b4197e0..494c452 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -566,7 +566,12 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
 				minIndex, maxIndex, mode, start, count);
     } else {
         do {
-            short_count = MIN2(count, 65534);
+            /* The maximum must be divisible by 4 and 3,
+             * so that quad and triangle lists are split correctly.
+             *
+             * Strips, loops, and fans won't work. */
+            short_count = MIN2(count, 65532);
+
             r300_emit_draw_elements(r300, indexBuffer, indexSize,
                                      minIndex, maxIndex,
                                      mode, start, short_count);
@@ -614,7 +619,11 @@ static void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
             r300_emit_draw_arrays(r300, mode, count);
         } else {
             do {
-                short_count = MIN2(count, 65535);
+                /* The maximum must be divisible by 4 and 3,
+                 * so that quad and triangle lists are split correctly.
+                 *
+                 * Strips, loops, and fans won't work. */
+                short_count = MIN2(count, 65532);
                 r300_emit_draw_arrays(r300, mode, short_count);
 
                 start += short_count;




More information about the mesa-commit mailing list