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/nvc0/nvc0_state.c | |
parent | fcb28682101dfa127486373411043d5d97a0ff8f (diff) |
nv50,nvc0: handle user index buffers
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_state.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_state.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c index cab238e7e06..5eee9d4bf88 100644 --- a/src/gallium/drivers/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nvc0/nvc0_state.c @@ -802,11 +802,16 @@ nvc0_set_index_buffer(struct pipe_context *pipe, if (nvc0->idxbuf.buffer) nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_IDX); - if (ib && ib->buffer) { - nvc0->dirty |= NVC0_NEW_IDXBUF; + if (ib) { pipe_resource_reference(&nvc0->idxbuf.buffer, ib->buffer); - nvc0->idxbuf.offset = ib->offset; nvc0->idxbuf.index_size = ib->index_size; + if (ib->buffer) { + nvc0->idxbuf.offset = ib->offset; + nvc0->dirty |= NVC0_NEW_IDXBUF; + } else { + nvc0->idxbuf.user_buffer = ib->user_buffer; + nvc0->dirty &= ~NVC0_NEW_IDXBUF; + } } else { nvc0->dirty &= ~NVC0_NEW_IDXBUF; pipe_resource_reference(&nvc0->idxbuf.buffer, NULL); |