summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-05-16 20:54:23 +0200
committerChristoph Bumiller <[email protected]>2012-05-17 15:24:58 +0200
commitef7bb281292c17b762b57779306e874704c87328 (patch)
tree11bc7aedaceedb06087cc49621fdd2f80f6384c0 /src/gallium/drivers/nv50/nv50_state.c
parentfcb28682101dfa127486373411043d5d97a0ff8f (diff)
nv50,nvc0: handle user index buffers
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index eea3ffd5270..1e7d17a7197 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -911,12 +911,15 @@ nv50_set_index_buffer(struct pipe_context *pipe,
if (nv50->idxbuf.buffer)
nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_INDEX);
- if (ib && ib->buffer) {
+ if (ib) {
pipe_resource_reference(&nv50->idxbuf.buffer, ib->buffer);
- nv50->idxbuf.offset = ib->offset;
nv50->idxbuf.index_size = ib->index_size;
- if (nouveau_resource_mapped_by_gpu(ib->buffer))
+ if (ib->buffer) {
+ nv50->idxbuf.offset = ib->offset;
BCTX_REFN(nv50->bufctx_3d, INDEX, nv04_resource(ib->buffer), RD);
+ } else {
+ nv50->idxbuf.user_buffer = ib->user_buffer;
+ }
} else {
pipe_resource_reference(&nv50->idxbuf.buffer, NULL);
}