From: Christoph Bumiller Date: Tue, 22 May 2012 10:44:38 +0000 (+0200) Subject: nv50: make unaligned index buffer offsets work again X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a054fd8268876048a7ce45a2ebfc40a3dd1e8540;p=mesa.git nv50: make unaligned index buffer offsets work again Messed up in ef7bb281292c17b762b57779306e874704c87328. --- diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 4cecdea3bfb..1875d4d6092 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));