From fa350eadfbe892c21be30d945fa6d61f09541cae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fredrik=20H=C3=B6glund?= Date: Mon, 2 Mar 2015 18:41:09 +0100 Subject: [PATCH] mesa: Add a vao parameter to update_array_format This is needed to implement VertexArrayAttrib*Format. Reviewed-by: Laura Ekstrand --- src/mesa/main/varray.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index f583f482dc1..4b506ea39c4 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -265,6 +265,7 @@ get_legal_types_mask(const struct gl_context *ctx) 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, @@ -379,7 +380,7 @@ update_array_format(struct gl_context *ctx, 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; @@ -389,7 +390,7 @@ update_array_format(struct gl_context *ctx, array->RelativeOffset = relativeOffset; array->_ElementSize = elementSize; - ctx->Array.VAO->NewArrays |= VERT_BIT(attrib); + vao->NewArrays |= VERT_BIT(attrib); ctx->NewState |= _NEW_ARRAY; return true; @@ -472,8 +473,9 @@ update_array(struct gl_context *ctx, 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; } @@ -1836,9 +1838,10 @@ vertex_attrib_format(GLuint attribIndex, GLint size, GLenum type, 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); } -- 2.30.2