summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2015-03-02 18:27:18 +0100
committerFredrik Höglund <[email protected]>2015-05-08 15:31:02 +0200
commit96b646346372ec0e2b9336ef26e0d2a084b69400 (patch)
tree8be143b8da018db453228b6fdff9c9a7aa63dd9c /src/mesa/main
parent6c37acfbedb88b460d2997f8b2d7b0e04a8782df (diff)
mesa: Implement DisableVertexArrayAttrib
Reviewed-by: Laura Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp1
-rw-r--r--src/mesa/main/varray.c45
-rw-r--r--src/mesa/main/varray.h4
3 files changed, 41 insertions, 9 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index a4a0644937e..7909d388fb2 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1018,6 +1018,7 @@ const struct function gl_core_functions_possible[] = {
{ "glTextureBuffer", 45, -1 },
{ "glTextureBufferRange", 45, -1 },
{ "glCreateVertexArrays", 45, -1 },
+ { "glDisableVertexArrayAttrib", 45, -1 },
{ "glCreateSamplers", 45, -1 },
{ "glCreateProgramPipelines", 45, -1 },
{ "glCreateQueries", 45, -1 },
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index d003c6dd840..b5370a819fa 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -744,20 +744,17 @@ _mesa_EnableVertexAttribArray(GLuint index)
}
-void GLAPIENTRY
-_mesa_DisableVertexAttribArray(GLuint index)
+static void
+disable_vertex_array_attrib(struct gl_context *ctx,
+ struct gl_vertex_array_object *vao,
+ GLuint index,
+ const char *func)
{
- struct gl_vertex_array_object *vao;
- GET_CURRENT_CONTEXT(ctx);
-
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glDisableVertexAttribArrayARB(index)");
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
return;
}
- vao = ctx->Array.VAO;
-
assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(vao->VertexAttrib));
if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) {
@@ -770,6 +767,36 @@ _mesa_DisableVertexAttribArray(GLuint index)
}
+void GLAPIENTRY
+_mesa_DisableVertexAttribArray(GLuint index)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ disable_vertex_array_attrib(ctx, ctx->Array.VAO, index,
+ "glDisableVertexAttribArray");
+}
+
+
+void GLAPIENTRY
+_mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_vertex_array_object *vao;
+
+ /* The ARB_direct_state_access specification says:
+ *
+ * "An INVALID_OPERATION error is generated by EnableVertexArrayAttrib
+ * and DisableVertexArrayAttrib if <vaobj> is not
+ * [compatibility profile: zero or] the name of an existing vertex
+ * array object."
+ */
+ vao = _mesa_lookup_vao_err(ctx, vaobj, "glDisableVertexArrayAttrib");
+ if (!vao)
+ return;
+
+ disable_vertex_array_attrib(ctx, vao, index, "glDisableVertexArrayAttrib");
+}
+
+
/**
* Return info for a vertex attribute array (no alias with legacy
* vertex attributes (pos, normal, color, etc)). This function does
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index c70545a2f5b..f783f888553 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -180,6 +180,10 @@ _mesa_DisableVertexAttribArray(GLuint index);
extern void GLAPIENTRY
+_mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index);
+
+
+extern void GLAPIENTRY
_mesa_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble *params);
extern void GLAPIENTRY