unsigned num_vbuffers, num_velements;
GLuint attr;
unsigned i;
+ unsigned old_num_user_attribs;
/* must get these after state validation! */
vp = st->vp;
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;
/*
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;
}