static bool
update_array_format(struct gl_context *ctx,
const char *func,
+ struct gl_vertex_array_object *vao,
GLuint attrib, GLbitfield legalTypesMask,
GLint sizeMin, GLint sizeMax,
GLint size, GLenum type,
elementSize = _mesa_bytes_per_vertex_attrib(size, type);
assert(elementSize != -1);
- array = &ctx->Array.VAO->VertexAttrib[attrib];
+ array = &vao->VertexAttrib[attrib];
array->Size = size;
array->Type = type;
array->Format = format;
array->RelativeOffset = relativeOffset;
array->_ElementSize = elementSize;
- ctx->Array.VAO->NewArrays |= VERT_BIT(attrib);
+ vao->NewArrays |= VERT_BIT(attrib);
ctx->NewState |= _NEW_ARRAY;
return true;
return;
}
- if (!update_array_format(ctx, func, attrib, legalTypesMask, sizeMin,
- sizeMax, size, type, normalized, integer, doubles, 0)) {
+ if (!update_array_format(ctx, func, ctx->Array.VAO, attrib,
+ legalTypesMask, sizeMin, sizeMax,
+ size, type, normalized, integer, doubles, 0)) {
return;
}
FLUSH_VERTICES(ctx, 0);
- update_array_format(ctx, func, VERT_ATTRIB_GENERIC(attribIndex),
- legalTypes, 1, maxSize, size, type, normalized,
- integer, doubles, relativeOffset);
+ update_array_format(ctx, func, ctx->Array.VAO,
+ VERT_ATTRIB_GENERIC(attribIndex),
+ legalTypes, 1, maxSize, size, type,
+ normalized, integer, doubles, relativeOffset);
}