aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_draw.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index c4b2caccd..eb187519f 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/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;
}
@@ -1016,9 +1013,6 @@ st_draw_vbo(struct gl_context *ctx,
if (st->dirty.st) {
GLboolean vertDataEdgeFlags;
- /* sanity check for pointer arithmetic below */
- assert(sizeof(arrays[0]->Ptr[0]) == 1);
-
vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
if (vertDataEdgeFlags != st->vertdata_edgeflags) {