summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arrayobj.c
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2015-03-02 18:56:31 +0100
committerFredrik Höglund <[email protected]>2015-05-08 15:31:03 +0200
commit1085c0112128e6bbb6cdc7ef3ae40e5e69499098 (patch)
tree4159ca981e9f3110f88980467064ca7d896f350c /src/mesa/main/arrayobj.c
parent0a895c379e649b64efd5c0978fb6252dabf9d285 (diff)
mesa: Implement GetVertexArrayiv
Reviewed-by: Laura Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/arrayobj.c')
-rw-r--r--src/mesa/main/arrayobj.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 5ce33a082f8..7c4004043de 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -685,3 +685,37 @@ _mesa_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
if (bufObj)
_mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);
}
+
+
+void GLAPIENTRY
+_mesa_GetVertexArrayiv(GLuint vaobj, GLenum pname, GLint *param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_vertex_array_object *vao;
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ /* The GL_ARB_direct_state_access specification says:
+ *
+ * "An INVALID_OPERATION error is generated if <vaobj> is not
+ * [compatibility profile: zero or] the name of an existing
+ * vertex array object."
+ */
+ vao =_mesa_lookup_vao_err(ctx, vaobj, "glGetVertexArrayiv");
+ if (!vao)
+ return;
+
+ /* The GL_ARB_direct_state_access specification says:
+ *
+ * "An INVALID_ENUM error is generated if <pname> is not
+ * ELEMENT_ARRAY_BUFFER_BINDING."
+ */
+ if (pname != GL_ELEMENT_ARRAY_BUFFER_BINDING) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetVertexArrayiv(pname != "
+ "GL_ELEMENT_ARRAY_BUFFER_BINDING)");
+ return;
+ }
+
+ param[0] = vao->IndexBufferObj->Name;
+}