diff options
author | Christoph Bumiller <[email protected]> | 2012-05-22 15:33:12 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-05-25 22:42:54 +0200 |
commit | 384ef28cb376eb53c43167f0e8f0f7c3fec7d288 (patch) | |
tree | 2ae55147544d0333165e06ec92019a6fc0c1e4b4 /src/gallium/drivers/nv30/nv30_push.c | |
parent | 704eac09166aa6dc4c1aa82f8d0938c4060e51f4 (diff) |
nv30: handle user index buffers
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_push.c')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_push.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv30/nv30_push.c b/src/gallium/drivers/nv30/nv30_push.c index 16575ee2686..c5867bfa11a 100644 --- a/src/gallium/drivers/nv30/nv30_push.c +++ b/src/gallium/drivers/nv30/nv30_push.c @@ -37,7 +37,7 @@ struct push_context { struct nouveau_pushbuf *push; - void *idxbuf; + const void *idxbuf; float edgeflag; int edgeflag_attr; @@ -221,9 +221,12 @@ nv30_push_vbo(struct nv30_context *nv30, const struct pipe_draw_info *info) } if (info->indexed) { - ctx.idxbuf = nouveau_resource_map_offset(&nv30->base, - nv04_resource(nv30->idxbuf.buffer), - nv30->idxbuf.offset, NOUVEAU_BO_RD); + if (nv30->idxbuf.buffer) + ctx.idxbuf = nouveau_resource_map_offset(&nv30->base, + nv04_resource(nv30->idxbuf.buffer), nv30->idxbuf.offset, + NOUVEAU_BO_RD); + else + ctx.idxbuf = nv30->idxbuf.user_buffer; if (!ctx.idxbuf) { nv30_state_release(nv30); return; |