[Mesa-dev] [PATCH 03/10] mesa: add KHR_no_error support for glVertexArrayVertexBuffer()

Timothy Arceri tarceri at itsqueeze.com
Mon May 22 05:46:55 UTC 2017


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  2 +-
 src/mesa/main/varray.c                         | 13 +++++++++++++
 src/mesa/main/varray.h                         |  4 ++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index b8780f7..f13a144 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -592,21 +592,21 @@
    <function name="EnableVertexArrayAttrib">
       <param name="vaobj" type="GLuint" />
       <param name="index" type="GLuint" />
    </function>
 
    <function name="VertexArrayElementBuffer">
       <param name="vaobj" type="GLuint" />
       <param name="buffer" type="GLuint" />
    </function>
 
-   <function name="VertexArrayVertexBuffer">
+   <function name="VertexArrayVertexBuffer" no_error="true">
       <param name="vaobj" type="GLuint" />
       <param name="bindingindex" type="GLuint" />
       <param name="buffer" type="GLuint" />
       <param name="offset" type="GLintptr" />
       <param name="stride" type="GLsizei" />
    </function>
 
    <function name="VertexArrayVertexBuffers">
       <param name="vaobj" type="GLuint" />
       <param name="first" type="GLuint" />
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index df14a8b..47528ba 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -2076,20 +2076,33 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
       return;
    }
 
    vertex_array_vertex_buffer_err(ctx, ctx->Array.VAO, bindingIndex,
                                   buffer, offset, stride,
                                   "glBindVertexBuffer");
 }
 
 
 void GLAPIENTRY
+_mesa_VertexArrayVertexBuffer_no_error(GLuint vaobj, GLuint bindingIndex,
+                                       GLuint buffer, GLintptr offset,
+                                       GLsizei stride)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_vertex_array_object *vao = _mesa_lookup_vao(ctx, vaobj);
+   vertex_array_vertex_buffer(ctx, vao, bindingIndex, buffer, offset,
+                              stride, true, "glVertexArrayVertexBuffer");
+}
+
+
+void GLAPIENTRY
 _mesa_VertexArrayVertexBuffer(GLuint vaobj, GLuint bindingIndex, GLuint buffer,
                               GLintptr offset, GLsizei stride)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_vertex_array_object *vao;
 
    /* The ARB_direct_state_access specification says:
     *
     *   "An INVALID_OPERATION error is generated by VertexArrayVertexBuffer
     *    if <vaobj> is not [compatibility profile: zero or] the name of an
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index c3cd5d2..24e37a9 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -360,20 +360,24 @@ _mesa_primitive_restart_index(const struct gl_context *ctx,
    return ctx->Array.RestartIndex;
 }
 
 extern void GLAPIENTRY
 _mesa_BindVertexBuffer_no_error(GLuint bindingIndex, GLuint buffer,
                                 GLintptr offset, GLsizei stride);
 extern void GLAPIENTRY
 _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
                        GLsizei stride);
 
+void GLAPIENTRY
+_mesa_VertexArrayVertexBuffer_no_error(GLuint vaobj, GLuint bindingIndex,
+                                       GLuint buffer, GLintptr offset,
+                                       GLsizei stride);
 extern void GLAPIENTRY
 _mesa_VertexArrayVertexBuffer(GLuint vaobj, GLuint bindingIndex, GLuint buffer,
                               GLintptr offset, GLsizei stride);
 
 extern void GLAPIENTRY
 _mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
                         const GLintptr *offsets, const GLsizei *strides);
 
 extern void GLAPIENTRY
 _mesa_VertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count,
-- 
2.9.4



More information about the mesa-dev mailing list