* Sets the BufferBindingIndex field for the vertex attribute given by
* attribIndex.
*/
-static void
-vertex_attrib_binding(struct gl_context *ctx,
- struct gl_vertex_array_object *vao,
- gl_vert_attrib attribIndex,
- GLuint bindingIndex)
+void
+_mesa_vertex_attrib_binding(struct gl_context *ctx,
+ struct gl_vertex_array_object *vao,
+ gl_vert_attrib attribIndex,
+ GLuint bindingIndex, bool flush_vertices)
{
struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
else
vao->VertexAttribBufferMask &= ~array_bit;
- FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ if (flush_vertices) {
+ FLUSH_VERTICES(ctx, _NEW_ARRAY);
+ }
vao->BufferBinding[array->BufferBindingIndex]._BoundArrays &= ~array_bit;
vao->BufferBinding[bindingIndex]._BoundArrays |= array_bit;
normalized, integer, doubles, 0);
/* Reset the vertex attrib binding */
- vertex_attrib_binding(ctx, vao, attrib, attrib);
+ _mesa_vertex_attrib_binding(ctx, vao, attrib, attrib, true);
/* The Stride and Ptr fields are not set by update_array_format() */
struct gl_array_attributes *array = &vao->VertexAttrib[attrib];
* VertexAttribBinding(index, index);
* VertexBindingDivisor(index, divisor);"
*/
- vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
+ _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex, true);
vertex_binding_divisor(ctx, vao, genericIndex, divisor);
}
* VertexAttribBinding(index, index);
* VertexBindingDivisor(index, divisor);"
*/
- vertex_attrib_binding(ctx, vao, genericIndex, genericIndex);
+ _mesa_vertex_attrib_binding(ctx, vao, genericIndex, genericIndex, true);
vertex_binding_divisor(ctx, vao, genericIndex, divisor);
}
assert(VERT_ATTRIB_GENERIC(attribIndex) < ARRAY_SIZE(vao->VertexAttrib));
- vertex_attrib_binding(ctx, vao,
- VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex));
+ _mesa_vertex_attrib_binding(ctx, vao,
+ VERT_ATTRIB_GENERIC(attribIndex),
+ VERT_ATTRIB_GENERIC(bindingIndex), true);
}
_mesa_VertexAttribBinding_no_error(GLuint attribIndex, GLuint bindingIndex)
{
GET_CURRENT_CONTEXT(ctx);
- vertex_attrib_binding(ctx, ctx->Array.VAO,
- VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex));
+ _mesa_vertex_attrib_binding(ctx, ctx->Array.VAO,
+ VERT_ATTRIB_GENERIC(attribIndex),
+ VERT_ATTRIB_GENERIC(bindingIndex), true);
}
GET_CURRENT_CONTEXT(ctx);
struct gl_vertex_array_object *vao = _mesa_lookup_vao(ctx, vaobj);
- vertex_attrib_binding(ctx, vao,
- VERT_ATTRIB_GENERIC(attribIndex),
- VERT_ATTRIB_GENERIC(bindingIndex));
+ _mesa_vertex_attrib_binding(ctx, vao,
+ VERT_ATTRIB_GENERIC(attribIndex),
+ VERT_ATTRIB_GENERIC(bindingIndex), true);
}