Mesa (master): u_vbuf_mgr: fixed vbo max_index calculation

Marek Olšák mareko at kemper.freedesktop.org
Mon Apr 11 16:16:04 UTC 2011


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

Author: pepp <pelloux at gmail.com>
Date:   Mon Apr 11 17:16:45 2011 +0200

u_vbuf_mgr: fixed vbo max_index calculation

Signed-off-by: Marek Olšák <maraeo at gmail.com>

---

 src/gallium/auxiliary/util/u_vbuf_mgr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index b2eaff8..dea2928 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -499,7 +499,7 @@ void u_vbuf_mgr_set_vertex_buffers(struct u_vbuf_mgr *mgrb,
       /* Update the maximum index. */
       mgr->b.max_index =
             MIN2(mgr->b.max_index,
-                 (vb->buffer->width0 - vb->buffer_offset) / vb->stride);
+                 (vb->buffer->width0 - vb->buffer_offset) / vb->stride - 1);
    }
 
    for (; i < mgr->b.nr_real_vertex_buffers; i++) {




More information about the mesa-commit mailing list