diff options
author | Marek Olšák <[email protected]> | 2011-11-04 18:06:04 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-11-04 18:11:01 +0100 |
commit | 85c151f3d9baca0bb8384a5083e9997dbb4da364 (patch) | |
tree | 0211870e7823474b383fea2452b2067ff933bb72 /src | |
parent | f800a29ee2e331740de8fbc409efa9f0593900fc (diff) |
u_vbuf_mgr: avoid one call to pipe_resource_reference in most cases
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf_mgr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c index 6c2d1ed6400..ca4f795f034 100644 --- a/src/gallium/auxiliary/util/u_vbuf_mgr.c +++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c @@ -471,7 +471,6 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf_mgr *mgrb, const struct pipe_vertex_buffer *vb = &bufs[i]; pipe_resource_reference(&mgr->b.vertex_buffer[i].buffer, vb->buffer); - pipe_resource_reference(&mgr->b.real_vertex_buffer[i].buffer, NULL); mgr->b.real_vertex_buffer[i].buffer_offset = mgr->b.vertex_buffer[i].buffer_offset = vb->buffer_offset; @@ -480,10 +479,12 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf_mgr *mgrb, mgr->b.vertex_buffer[i].stride = vb->stride; if (!vb->buffer) { + pipe_resource_reference(&mgr->b.real_vertex_buffer[i].buffer, NULL); continue; } if (u_vbuf_resource(vb->buffer)->user_ptr) { + pipe_resource_reference(&mgr->b.real_vertex_buffer[i].buffer, NULL); mgr->any_user_vbs = TRUE; continue; } |