-static void
-_ae_update_state(struct gl_context *ctx)
-{
- AEcontext *actx = AE_CONTEXT(ctx);
- AEarray *aa = actx->arrays; /* non-indexed arrays (ex: glNormal) */
- AEattrib *at = actx->attribs; /* indexed arrays (ex: glMultiTexCoord) */
- GLuint i;
- struct gl_vertex_array_object *vao = ctx->Array.VAO;
-
- /* conventional vertex arrays */
- for (i = 1; i < VERT_ATTRIB_FF_MAX; i++) { /* skip zero! */
- if (vao->Enabled & VERT_BIT_FF(i)) {
- struct gl_array_attributes *attribArray =
- &vao->VertexAttrib[VERT_ATTRIB_FF(i)];
- /* NOTE: we use generic glVertexAttribNV functions here.
- * If we ever remove GL_NV_vertex_program this will have to change.
- */
- at->array = attribArray;
- at->binding = &vao->BufferBinding[attribArray->BufferBindingIndex];
- assert(!at->array->Format.Normalized);
- at->func = AttribFuncsNV[at->array->Format.Normalized]
- [at->array->Format.Size-1]
- [TYPE_IDX(at->array->Format.Type)];
- at->index = VERT_ATTRIB_FF(i);
- at++;
- }
- }
-
- /* generic vertex attribute arrays */
- for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */
- if (vao->Enabled & VERT_BIT_GENERIC(i)) {
- struct gl_array_attributes *attribArray =
- &vao->VertexAttrib[VERT_ATTRIB_GENERIC(i)];
- at->array = attribArray;
- at->binding = &vao->BufferBinding[attribArray->BufferBindingIndex];
- /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV
- * function pointer here (for float arrays) since the pointer may
- * change from one execution of _ae_ArrayElement() to
- * the next. Doing so caused UT to break.
- */
- at->func = AttribFuncsARB[vertex_format_to_index(&at->array->Format)]
- [at->array->Format.Size-1]
- [TYPE_IDX(at->array->Format.Type)];
-
- at->index = i;
- at++;
- }
- }
+static inline const void *
+attrib_src(const struct gl_vertex_array_object *vao,
+ const struct gl_array_attributes *array, GLint elt)
+{
+ const struct gl_vertex_buffer_binding *binding =
+ &vao->BufferBinding[array->BufferBindingIndex];
+ const GLubyte *src = _mesa_vertex_attrib_address(array, binding);