<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 4:18 PM, Fredrik Höglund <span dir="ltr"><<a href="mailto:fredrik@kde.org" target="_blank">fredrik@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  5 ++++<br>
 src/mesa/main/arrayobj.c                       | 34 ++++++++++++++++++++++++++<br>
 src/mesa/main/arrayobj.h                       |  2 ++<br>
 src/mesa/main/tests/dispatch_sanity.cpp        |  1 +<br>
 4 files changed, 42 insertions(+)<br>
<br>
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
index f92734d..a6ff206 100644<br>
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
@@ -396,5 +396,10 @@<br>
       <param name="index" type="GLuint" /><br>
    </function><br>
<br>
+   <function name="VertexArrayElementBuffer" offset="assign"><br>
+      <param name="vaobj" type="GLuint" /><br>
+      <param name="buffer" type="GLuint" /><br>
+   </function><br>
+<br>
 </category><br>
 </OpenGLAPI><br>
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c<br>
index 862bbb7..decdc51 100644<br>
--- a/src/mesa/main/arrayobj.c<br>
+++ b/src/mesa/main/arrayobj.c<br>
@@ -637,3 +637,37 @@ _mesa_IsVertexArray( GLuint id )<br>
<br>
    return obj->EverBound;<br>
 }<br>
+<br></blockquote><div>Since this looks like an entirely new function, it would be nice to have a comment here saying something to the effect of "This is the ARB_direct_state_access equivalent of BindBuffer(GL_ELEMENT_ARRAY_BUFFER...)."  It took me a while to figure that out. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+void GLAPIENTRY<br>
+_mesa_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   struct gl_vertex_array_object *vao;<br>
+   struct gl_buffer_object *bufObj;<br>
+<br>
+   ASSERT_OUTSIDE_BEGIN_END(ctx);<br>
+<br>
+   /* The GL_ARB_direct_state_access specification says:<br>
+    *<br>
+    *    "An INVALID_OPERATION error is generated by VertexArrayElementBuffer<br>
+    *     if <vaobj> is not [compatibility profile: zero or] the name of an<br>
+    *     existing vertex array object."<br>
+    */<br>
+   vao =_mesa_lookup_vao_err(ctx, vaobj, "glVertexArrayElementBuffer");<br>
+   if (!vao)<br>
+      return;<br>
+<br>
+   /* The GL_ARB_direct_state_access specification says:<br>
+    *<br>
+    *    "An INVALID_OPERATION error is generated if <buffer> is not zero or<br>
+    *     the name of an existing buffer object."<br>
+    */<br>
+   if (buffer != 0)<br>
+      bufObj = _mesa_lookup_bufferobj_err(ctx, buffer,<br>
+                                          "glVertexArrayElementBuffer");<br>
+   else<br>
+      bufObj = ctx->Shared->NullBufferObj;<br>
+<br>
+   if (bufObj)<br>
+      _mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);<br>
+}<br>
diff --git a/src/mesa/main/arrayobj.h b/src/mesa/main/arrayobj.h<br>
index 1e7436b..748eaf5 100644<br>
--- a/src/mesa/main/arrayobj.h<br>
+++ b/src/mesa/main/arrayobj.h<br>
@@ -100,4 +100,6 @@ void GLAPIENTRY _mesa_CreateVertexArrays(GLsizei n, GLuint *arrays);<br>
<br>
 GLboolean GLAPIENTRY _mesa_IsVertexArray( GLuint id );<br>
<br>
+void GLAPIENTRY _mesa_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer);<br>
+<br>
 #endif /* ARRAYOBJ_H */<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index 2b7d4cb..5926061 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -973,6 +973,7 @@ const struct function gl_core_functions_possible[] = {<br>
    { "glCreateVertexArrays", 45, -1 },<br>
    { "glDisableVertexArrayAttrib", 45, -1 },<br>
    { "glEnableVertexArrayAttrib", 45, -1 },<br>
+   { "glVertexArrayElementBuffer", 45, -1 },<br>
<br>
    /* GL_EXT_polygon_offset_clamp */<br>
    { "glPolygonOffsetClampEXT", 11, -1 },<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.5.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>