summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mapi/glapi/gen/ARB_direct_state_access.xml5
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp1
-rw-r--r--src/mesa/main/varray.c46
-rw-r--r--src/mesa/main/varray.h4
4 files changed, 47 insertions, 9 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 3592b1c963f..bffacc6dc13 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -460,6 +460,11 @@
<param name="index" type="GLuint" />
</function>
+ <function name="EnableVertexArrayAttrib" offset="assign">
+ <param name="vaobj" type="GLuint" />
+ <param name="index" type="GLuint" />
+ </function>
+
<!-- Sampler object functions -->
<function name="CreateSamplers" offset="assign">
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 7909d388fb2..db3ea39e74e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1019,6 +1019,7 @@ const struct function gl_core_functions_possible[] = {
{ "glTextureBufferRange", 45, -1 },
{ "glCreateVertexArrays", 45, -1 },
{ "glDisableVertexArrayAttrib", 45, -1 },
+ { "glEnableVertexArrayAttrib", 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 b5370a819fa..06b1cbb1d39 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -718,20 +718,18 @@ _mesa_VertexAttribLPointer(GLuint index, GLint size, GLenum type,
size, type, stride, GL_TRUE, GL_FALSE, GL_TRUE, ptr);
}
-void GLAPIENTRY
-_mesa_EnableVertexAttribArray(GLuint index)
-{
- struct gl_vertex_array_object *vao;
- GET_CURRENT_CONTEXT(ctx);
+static void
+enable_vertex_array_attrib(struct gl_context *ctx,
+ struct gl_vertex_array_object *vao,
+ GLuint index,
+ const char *func)
+{
if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
- _mesa_error(ctx, GL_INVALID_VALUE,
- "glEnableVertexAttribArrayARB(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) {
@@ -744,6 +742,36 @@ _mesa_EnableVertexAttribArray(GLuint index)
}
+void GLAPIENTRY
+_mesa_EnableVertexAttribArray(GLuint index)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ enable_vertex_array_attrib(ctx, ctx->Array.VAO, index,
+ "glEnableVertexAttribArray");
+}
+
+
+void GLAPIENTRY
+_mesa_EnableVertexArrayAttrib(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, "glEnableVertexArrayAttrib");
+ if (!vao)
+ return;
+
+ enable_vertex_array_attrib(ctx, vao, index, "glEnableVertexArrayAttrib");
+}
+
+
static void
disable_vertex_array_attrib(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index f783f888553..a86dc6512e7 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -176,6 +176,10 @@ _mesa_EnableVertexAttribArray(GLuint index);
extern void GLAPIENTRY
+_mesa_EnableVertexArrayAttrib(GLuint vaobj, GLuint index);
+
+
+extern void GLAPIENTRY
_mesa_DisableVertexAttribArray(GLuint index);