From 0605c6d861d0e59baadf725f3530319b32b2a344 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Mar 2012 07:20:16 -0700 Subject: Revert "st/mesa: don't unreference user attribs up front." This reverts commit 72931ca4b9fb1002f5b62b74f7f7f32e94e80fde. This commit caused a few piglit regressions (quad-invariance, draw-batch, etc) with the vmware svga driver. --- src/mesa/state_tracker/st_draw.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index e4bc36ed5f8..eb187519ffe 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -905,7 +905,6 @@ 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; @@ -914,7 +913,9 @@ st_validate_varrays(struct gl_context *ctx, memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs); /* Unreference any user vertex buffers. */ - old_num_user_attribs = st->num_user_attribs; + for (i = 0; i < st->num_user_attribs; i++) { + pipe_resource_reference(&st->user_attrib[i].buffer, NULL); + } st->num_user_attribs = 0; /* @@ -953,10 +954,6 @@ 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; } -- cgit v1.2.3