diff options
author | Christoph Bumiller <[email protected]> | 2012-05-16 20:54:23 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-05-17 15:24:58 +0200 |
commit | ef7bb281292c17b762b57779306e874704c87328 (patch) | |
tree | 11bc7aedaceedb06087cc49621fdd2f80f6384c0 /src/gallium/drivers/nv50/nv50_push.c | |
parent | fcb28682101dfa127486373411043d5d97a0ff8f (diff) |
nv50,nvc0: handle user index buffers
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_push.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_push.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_push.c b/src/gallium/drivers/nv50/nv50_push.c index 3abe189e7b5..1f7bc7679f0 100644 --- a/src/gallium/drivers/nv50/nv50_push.c +++ b/src/gallium/drivers/nv50/nv50_push.c @@ -13,7 +13,7 @@ struct push_context { struct nouveau_pushbuf *push; - void *idxbuf; + const void *idxbuf; float edgeflag; int edgeflag_attr; @@ -234,9 +234,13 @@ nv50_push_vbo(struct nv50_context *nv50, const struct pipe_draw_info *info) } if (info->indexed) { - ctx.idxbuf = nouveau_resource_map_offset(&nv50->base, - nv04_resource(nv50->idxbuf.buffer), - nv50->idxbuf.offset, NOUVEAU_BO_RD); + if (nv50->idxbuf.buffer) { + ctx.idxbuf = nouveau_resource_map_offset(&nv50->base, + nv04_resource(nv50->idxbuf.buffer), nv50->idxbuf.offset, + NOUVEAU_BO_RD); + } else { + ctx.idxbuf = nv50->idxbuf.user_buffer; + } if (!ctx.idxbuf) return; index_size = nv50->idxbuf.index_size; |