#include "glformats.h"
#include "texstore.h"
#include "transformfeedback.h"
+#include "varray.h"
/* Debug flags */
*/
static void
unbind(struct gl_context *ctx,
- struct gl_buffer_object **ptr,
+ struct gl_vertex_array_object *vao, unsigned index,
struct gl_buffer_object *obj)
{
- if (*ptr == obj) {
- _mesa_reference_buffer_object(ctx, ptr, ctx->Shared->NullBufferObj);
+ if (vao->VertexBinding[index].BufferObj == obj) {
+ _mesa_bind_vertex_buffer(ctx, vao, index, ctx->Shared->NullBufferObj,
+ vao->VertexBinding[index].Offset,
+ vao->VertexBinding[index].Stride);
}
}
/* unbind any vertex pointers bound to this buffer */
for (j = 0; j < ARRAY_SIZE(vao->VertexBinding); j++) {
- unbind(ctx, &vao->VertexBinding[j].BufferObj, bufObj);
+ unbind(ctx, vao, j, bufObj);
}
if (ctx->Array.ArrayBufferObj == bufObj) {