From a054fd8268876048a7ce45a2ebfc40a3dd1e8540 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Tue, 22 May 2012 12:44:38 +0200 Subject: [PATCH] nv50: make unaligned index buffer offsets work again Messed up in ef7bb281292c17b762b57779306e874704c87328. --- src/gallium/drivers/nv50/nv50_vbo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); -- 2.30.2