aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c b/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 6c2d1ed64..ca4f795f0 100644
--- a/mesalib/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/mesalib/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;
}