Mesa (master): nv50: make unaligned index buffer offsets work again

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Tue May 22 04:56:43 PDT 2012


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Tue May 22 12:44:38 2012 +0200

nv50: make unaligned index buffer offsets work again

Messed up in ef7bb281292c17b762b57779306e874704c87328.

---

 src/gallium/drivers/nv50/nv50_vbo.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index 4cecdea..1875d4d 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -568,7 +568,9 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten,
       struct nv04_resource *buf = nv04_resource(nv50->idxbuf.buffer);
       unsigned pb_start;
       unsigned pb_bytes;
-      const unsigned base = buf->offset + nv50->idxbuf.offset;
+      const unsigned base = (buf->offset + nv50->idxbuf.offset) & ~3;
+
+      start += ((buf->offset + nv50->idxbuf.offset) & 3) >> (index_size >> 1);
 
       assert(nouveau_resource_mapped_by_gpu(nv50->idxbuf.buffer));
 



More information about the mesa-commit mailing list