diff options
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 9 |
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 3c497451d8b..db257159698 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -796,10 +796,13 @@ nv50_set_index_buffer(struct pipe_context *pipe, { struct nv50_context *nv50 = nv50_context(pipe); - if (ib) + if (ib) { + pipe_resource_reference(&nv50->idxbuf.buffer, ib->buffer); + memcpy(&nv50->idxbuf, ib, sizeof(nv50->idxbuf)); - else - nv50->idxbuf.buffer = NULL; + } else { + pipe_resource_reference(&nv50->idxbuf.buffer, NULL); + } } static void |