GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(0),
- *buf_obj, 0, sizeof(struct vertex));
+ *buf_obj, 0, sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_GENERIC(0), true);
if (texcoord_size > 0) {
GL_FALSE, GL_FALSE, GL_FALSE,
offsetof(struct vertex, tex));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(1),
- *buf_obj, 0, sizeof(struct vertex));
+ *buf_obj, 0, sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_GENERIC(1), true);
}
GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
- *buf_obj, 0, sizeof(struct vertex));
+ *buf_obj, 0, sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_POS, true);
GL_FALSE, GL_FALSE,
offsetof(struct vertex, tex));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(0),
- *buf_obj, 0, sizeof(struct vertex));
+ *buf_obj, 0, sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_TEX(0), true);
}
GL_FALSE, GL_FALSE,
offsetof(struct vertex, r));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_COLOR0,
- *buf_obj, 0, sizeof(struct vertex));
+ *buf_obj, 0, sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_COLOR0, true);
}
GL_FALSE, GL_FALSE,
offsetof(struct vertex, x));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
- drawtex->buf_obj, 0, sizeof(struct vertex));
+ drawtex->buf_obj, 0,
+ sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS, true);
GL_FALSE, GL_FALSE,
offsetof(struct vertex, st[i]));
_mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(i),
- drawtex->buf_obj, 0, sizeof(struct vertex));
+ drawtex->buf_obj, 0,
+ sizeof(struct vertex), true);
_mesa_enable_vertex_array_attrib(ctx, array_obj,
VERT_ATTRIB_TEX(i), true);
}
struct gl_vertex_array_object *vao,
GLuint index,
struct gl_buffer_object *vbo,
- GLintptr offset, GLsizei stride)
+ GLintptr offset, GLsizei stride, bool flush_vertices)
{
assert(index < ARRAY_SIZE(vao->BufferBinding));
struct gl_vertex_buffer_binding *binding = &vao->BufferBinding[index];
if (binding->BufferObj != vbo ||
binding->Offset != offset ||
binding->Stride != stride) {
-
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ if (flush_vertices) {
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ }
_mesa_reference_buffer_object(ctx, &binding->BufferObj, vbo);
GLsizei effectiveStride = stride != 0 ? stride : array->_ElementSize;
_mesa_bind_vertex_buffer(ctx, vao, attrib,
ctx->Array.ArrayBufferObj, (GLintptr) ptr,
- effectiveStride);
+ effectiveStride, true);
}
void GLAPIENTRY
}
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(bindingIndex),
- vbo, offset, stride);
+ vbo, offset, stride, true);
}
for (i = 0; i < count; i++)
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
- vbo, 0, 16);
+ vbo, 0, 16, true);
return;
}
}
_mesa_bind_vertex_buffer(ctx, vao, VERT_ATTRIB_GENERIC(first + i),
- vbo, offsets[i], strides[i]);
+ vbo, offsets[i], strides[i], true);
}
_mesa_HashUnlockMutex(ctx->Shared->BufferObjects);