summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-03-13 13:06:42 +0100
committerChristoph Bumiller <[email protected]>2011-03-13 13:23:55 +0100
commit26a199efac43cc0509f174ca47ad0d2b0044eee0 (patch)
treed0c4f32958fe8ac5553767c30996a0597b069287 /src/gallium/drivers/nvc0/nvc0_state.c
parent259efc90e7a1a14bc1797707c8f05d5200f4d0b6 (diff)
nv50,nvc0: add some missing resource referencing
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_state.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index 1815fe88a9b..ab68abcfb5a 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -708,10 +708,13 @@ nvc0_set_index_buffer(struct pipe_context *pipe,
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
- if (ib)
- memcpy(&nvc0->idxbuf, ib, sizeof(nvc0->idxbuf));
- else
- nvc0->idxbuf.buffer = NULL;
+ if (ib) {
+ pipe_resource_reference(&nvc0->idxbuf.buffer, ib->buffer);
+
+ memcpy(&nvc0->idxbuf, ib, sizeof(nvc0->idxbuf));
+ } else {
+ pipe_resource_reference(&nvc0->idxbuf.buffer, NULL);
+ }
}
static void