Mesa (master): u_vbuf_mgr: fix uploading if format size is greater than stride

Marek Olšák mareko at kemper.freedesktop.org
Sun Jun 19 19:09:44 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun Jun 19 19:38:48 2011 +0200

u_vbuf_mgr: fix uploading if format size is greater than stride

---

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

diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 0414952..fdfa9fc 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -537,6 +537,11 @@ static void u_vbuf_upload_buffers(struct u_vbuf_mgr_priv *mgr,
          } else if (vb->stride) {
             first = vb->stride * min_index;
             size = vb->stride * count;
+
+            /* Unusual case when stride is smaller than the format size.
+             * XXX This won't work with interleaved arrays. */
+            if (mgr->ve->native_format_size[i] > vb->stride)
+               size += mgr->ve->native_format_size[i] - vb->stride;
          } else {
             first = 0;
             size = mgr->ve->native_format_size[i];




More information about the mesa-commit mailing list