Mesa (master): mesa: add KHR_no_error support for glBindVertexBuffer()
Timothy Arceri
tarceri at kemper.freedesktop.org
Mon May 29 23:35:00 UTC 2017
Module: Mesa
Branch: master
Commit: 9d331739ae72c5678701c8b1b5d0f460c6e2c857
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d331739ae72c5678701c8b1b5d0f460c6e2c857
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Mon May 22 15:46:54 2017 +1000
mesa: add KHR_no_error support for glBindVertexBuffer()
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
---
src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml | 2 +-
src/mesa/main/varray.c | 17 ++++++++++++++---
src/mesa/main/varray.h | 3 +++
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml b/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml
index ba9ca57bb5..101c23c53b 100644
--- a/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml
+++ b/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml
@@ -7,7 +7,7 @@
<category name="GL_ARB_vertex_attrib_binding" number="125">
- <function name="BindVertexBuffer" es2="3.1">
+ <function name="BindVertexBuffer" es2="3.1" no_error="true">
<param name="bindingindex" type="GLuint"/>
<param name="buffer" type="GLuint"/>
<param name="offset" type="GLintptr"/>
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index f33f302206..df14a8b765 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1953,7 +1953,7 @@ static ALWAYS_INLINE void
vertex_array_vertex_buffer(struct gl_context *ctx,
struct gl_vertex_array_object *vao,
GLuint bindingIndex, GLuint buffer, GLintptr offset,
- GLsizei stride, const char *func)
+ GLsizei stride, bool no_error, const char *func)
{
struct gl_buffer_object *vbo;
if (buffer ==
@@ -1962,7 +1962,7 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
} else if (buffer != 0) {
vbo = _mesa_lookup_bufferobj(ctx, buffer);
- if (!vbo && _mesa_is_gles31(ctx)) {
+ if (!no_error && !vbo && _mesa_is_gles31(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", func);
return;
}
@@ -2043,7 +2043,18 @@ vertex_array_vertex_buffer_err(struct gl_context *ctx,
}
vertex_array_vertex_buffer(ctx, vao, bindingIndex, buffer, offset,
- stride, func);
+ stride, false, func);
+}
+
+
+void GLAPIENTRY
+_mesa_BindVertexBuffer_no_error(GLuint bindingIndex, GLuint buffer,
+ GLintptr offset, GLsizei stride)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ vertex_array_vertex_buffer(ctx, ctx->Array.VAO, bindingIndex,
+ buffer, offset, stride, true,
+ "glBindVertexBuffer");
}
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 2d184adf8b..c3cd5d207c 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -361,6 +361,9 @@ _mesa_primitive_restart_index(const struct gl_context *ctx,
}
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);
More information about the mesa-commit
mailing list