From: Fredrik Höglund Date: Mon, 2 Mar 2015 17:58:36 +0000 (+0100) Subject: mesa: Add a vao parameter to get_vertex_array_attrib X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f5160300dd143de8860e4e42d3dbfc7b534cfe2;p=mesa.git mesa: Add a vao parameter to get_vertex_array_attrib This is needed to implement glGetVertexArrayIndexediv and glGetVertexArrayIndexed64iv. v2: Make the vao parameter const. Reviewed-by: Laura Ekstrand --- diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 3afbea8ae06..7f14ffb2970 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -851,10 +851,11 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index) * not handle the 4-element GL_CURRENT_VERTEX_ATTRIB_ARB query. */ static GLuint -get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname, - const char *caller) +get_vertex_array_attrib(struct gl_context *ctx, + const struct gl_vertex_array_object *vao, + GLuint index, GLenum pname, + const char *caller) { - const struct gl_vertex_array_object *vao = ctx->Array.VAO; const struct gl_vertex_attrib_array *array; if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { @@ -945,7 +946,8 @@ _mesa_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params) } } else { - params[0] = (GLfloat) get_vertex_array_attrib(ctx, index, pname, + params[0] = (GLfloat) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribfv"); } } @@ -966,7 +968,8 @@ _mesa_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params) } } else { - params[0] = (GLdouble) get_vertex_array_attrib(ctx, index, pname, + params[0] = (GLdouble) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribdv"); } } @@ -986,7 +989,8 @@ _mesa_GetVertexAttribLdv(GLuint index, GLenum pname, GLdouble *params) } } else { - params[0] = (GLdouble) get_vertex_array_attrib(ctx, index, pname, + params[0] = (GLdouble) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribLdv"); } } @@ -1007,7 +1011,8 @@ _mesa_GetVertexAttribiv(GLuint index, GLenum pname, GLint *params) } } else { - params[0] = (GLint) get_vertex_array_attrib(ctx, index, pname, + params[0] = (GLint) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribiv"); } } @@ -1027,7 +1032,8 @@ _mesa_GetVertexAttribIiv(GLuint index, GLenum pname, GLint *params) } } else { - params[0] = (GLint) get_vertex_array_attrib(ctx, index, pname, + params[0] = (GLint) get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribIiv"); } } @@ -1047,7 +1053,8 @@ _mesa_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params) } } else { - params[0] = get_vertex_array_attrib(ctx, index, pname, + params[0] = get_vertex_array_attrib(ctx, ctx->Array.VAO, + index, pname, "glGetVertexAttribIuiv"); } }