nv50: make unaligned index buffer offsets work again
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 22 May 2012 10:44:38 +0000 (12:44 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 22 May 2012 10:50:12 +0000 (12:50 +0200)
Messed up in ef7bb281292c17b762b57779306e874704c87328.

src/gallium/drivers/nv50/nv50_vbo.c

index 4cecdea3bfba8bf7832c15fb4009774038d78fd7..1875d4d60924c0c1269b47619129e07ec9bef2b8 100644 (file)
@@ -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));