Mesa (nvc0): nvc0: reference the vertex buffers

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Mon Dec 27 20:01:40 UTC 2010


Module: Mesa
Branch: nvc0
Commit: 0cb6d1a4eb2dd682b499f54a82505bc3bd318bbc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cb6d1a4eb2dd682b499f54a82505bc3bd318bbc

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Mon Dec 27 20:57:54 2010 +0100

nvc0: reference the vertex buffers

---

 src/gallium/drivers/nvc0/nvc0_state.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index e77e956..5a9b1c2 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -771,6 +771,12 @@ nvc0_set_vertex_buffers(struct pipe_context *pipe,
                         const struct pipe_vertex_buffer *vb)
 {
     struct nvc0_context *nvc0 = nvc0_context(pipe);
+    unsigned i;
+
+    for (i = 0; i < count; ++i)
+       pipe_resource_reference(&nvc0->vtxbuf[i].buffer, vb[i].buffer);
+    for (; i < nvc0->num_vtxbufs; ++i)
+       pipe_resource_reference(&nvc0->vtxbuf[i].buffer, NULL);
 
     memcpy(nvc0->vtxbuf, vb, sizeof(*vb) * count);
     nvc0->num_vtxbufs = count;




More information about the mesa-commit mailing list