summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2015-03-02 18:58:36 +0100
committerFredrik Höglund <[email protected]>2015-05-08 15:31:04 +0200
commit4f5160300dd143de8860e4e42d3dbfc7b534cfe2 (patch)
treec6ea9aa7434034db12ca9476a8fed47296cb018c /src/mesa
parent1085c0112128e6bbb6cdc7ef3ae40e5e69499098 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/varray.c25
1 files changed, 16 insertions, 9 deletions
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");
}
}