aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-29 13:47:34 +0100
committermarha <marha@users.sourceforge.net>2012-02-29 13:47:34 +0100
commitc14f2432d6bfb3de6c6289efd0471f038a289327 (patch)
tree8864ad1e5d0ae65dd665aa45245f2dab86c3f178 /mesalib/src/mesa/state_tracker/st_draw.c
parent8475e285d0146b123f0ac1a87294c42088af12b0 (diff)
parent15a500d3edb03668b43cc6898fafcda024d0f006 (diff)
downloadvcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.gz
vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.tar.bz2
vcxsrv-c14f2432d6bfb3de6c6289efd0471f038a289327.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_draw.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index c0554cfc7..c4b2caccd 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -905,6 +905,7 @@ st_validate_varrays(struct gl_context *ctx,
unsigned num_vbuffers, num_velements;
GLuint attr;
unsigned i;
+ unsigned old_num_user_attribs;
/* must get these after state validation! */
vp = st->vp;
@@ -913,9 +914,7 @@ st_validate_varrays(struct gl_context *ctx,
memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs);
/* Unreference any user vertex buffers. */
- for (i = 0; i < st->num_user_attribs; i++) {
- pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
- }
+ old_num_user_attribs = st->num_user_attribs;
st->num_user_attribs = 0;
/*
@@ -954,6 +953,10 @@ st_validate_varrays(struct gl_context *ctx,
assert(!vbuffer[attr].buffer);
}
+ for (i = old_num_user_attribs; i < st->num_user_attribs; i++) {
+ pipe_resource_reference(&st->user_attrib[i].buffer, NULL);
+ }
+
return GL_TRUE;
}