summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-19 21:33:37 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-12-19 21:33:37 +0100
commit99f9a9727ca315e4ee4371fc05be4798ffb46214 (patch)
treeed93bd3e04c7d87096852da7322773886e16005e /src
parent5138ac033ad3708e2b82f2beebc887f65a77309e (diff)
nvc0: add the index buffer offset where missing
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_push.c2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_push2.c2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_vbo.c1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_push.c b/src/gallium/drivers/nvc0/nvc0_push.c
index 1bdc8e88a7..8cb05cdd09 100644
--- a/src/gallium/drivers/nvc0/nvc0_push.c
+++ b/src/gallium/drivers/nvc0/nvc0_push.c
@@ -227,6 +227,8 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
PIPE_TRANSFER_READ, &transfer);
if (!ctx.idxbuf)
return;
+ ctx.idxbuf = (uint8_t *)ctx.idxbuf + nvc0->idxbuf.offset;
+
index_size = nvc0->idxbuf.index_size;
ctx.primitive_restart = info->primitive_restart;
ctx.restart_index = info->restart_index;
diff --git a/src/gallium/drivers/nvc0/nvc0_push2.c b/src/gallium/drivers/nvc0/nvc0_push2.c
index 3f9359cf25..07dd7b56b9 100644
--- a/src/gallium/drivers/nvc0/nvc0_push2.c
+++ b/src/gallium/drivers/nvc0/nvc0_push2.c
@@ -298,7 +298,7 @@ nvc0_push_vbo2(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
struct nvc0_resource *res = nvc0_resource(nvc0->idxbuf.buffer);
if (!res || nouveau_bo_map(res->bo, NOUVEAU_BO_RD))
return;
- ctx.idxbuf = res->bo->map;
+ ctx.idxbuf = (uint8_t *)res->bo->map + nvc0->idxbuf.offset + res->offset;
nouveau_bo_unmap(res->bo);
ctx.idxsize = nvc0->idxbuf.index_size;
} else {
diff --git a/src/gallium/drivers/nvc0/nvc0_vbo.c b/src/gallium/drivers/nvc0/nvc0_vbo.c
index 84951ed945..f1d5910e3d 100644
--- a/src/gallium/drivers/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nvc0/nvc0_vbo.c
@@ -459,6 +459,7 @@ nvc0_draw_elements(struct nvc0_context *nvc0, boolean shorten,
PIPE_TRANSFER_READ, &transfer);
if (!data)
return;
+ data = (uint8_t *)data + nvc0->idxbuf.offset;
while (instance_count--) {
BEGIN_RING(chan, RING_3D(VERTEX_BEGIN_GL), 1);