diff options
author | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-01-27 19:22:25 +0900 |
---|---|---|
committer | José Fonseca <jrfonseca@tungstengraphics.com> | 2008-01-27 19:22:25 +0900 |
commit | dac124081d4bbc9d7527661e4a96aa78077b9f52 (patch) | |
tree | c46964d41ea1aba37eb6745d5b7588e4af5fd100 /src/mesa/pipe/pipebuffer/pb_buffer_fenced.c | |
parent | e6c8278c04518b8b8b0960a9e21b48b6816fcc20 (diff) |
Do refcounting trhoughout all buffer objects, since it is now a base requirement.
Diffstat (limited to 'src/mesa/pipe/pipebuffer/pb_buffer_fenced.c')
-rw-r--r-- | src/mesa/pipe/pipebuffer/pb_buffer_fenced.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c index b2edc321ef..349647fe6e 100644 --- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c +++ b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c @@ -80,7 +80,6 @@ struct fenced_buffer struct pb_buffer *buffer; - unsigned refcount; struct pipe_fence_handle *fence; struct list_head head; @@ -145,7 +144,7 @@ _fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list, /* Do the delayed destroy: */ - pb_destroy(fenced_buf->buffer); + pb_reference(&fenced_buf->buffer, NULL); free(fenced_buf); } } @@ -162,7 +161,7 @@ fenced_buffer_destroy(struct pb_buffer *buf) fenced_list->numDelayed++; } else { - pb_destroy(fenced_buf->buffer); + pb_reference(&fenced_buf->buffer, NULL); free(fenced_buf); } @@ -220,9 +219,13 @@ fenced_buffer_create(struct fenced_buffer_list *fenced_list, if(!buf) return NULL; + buf->base.base.refcount = 1; + buf->base.base.alignment = buffer->base.alignment; + buf->base.base.usage = buffer->base.usage; + buf->base.base.size = buffer->base.size; + buf->base.vtbl = &fenced_buffer_vtbl; buf->buffer = buffer; - buf->refcount = 1; buf->list = fenced_list; return &buf->base; |