[Mesa-dev] [PATCH 067/101] mesa: add KHR_no_error support to glDrawBuffers()

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 21 17:40:16 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mapi/glapi/gen/gl_API.xml |  2 +-
 src/mesa/main/buffers.c       | 16 ++++++++++++++++
 src/mesa/main/buffers.h       |  3 +++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 6f4d02d07d..53b234b2f9 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -5267,7 +5267,7 @@
         <glx rop="4228"/>
     </function>
 
-    <function name="DrawBuffers" es2="3.0">
+    <function name="DrawBuffers" es2="3.0" no_error="true">
         <param name="n" type="GLsizei" counter="true"/>
         <param name="bufs" type="const GLenum *" count="n"/>
         <glx rop="233" large="true"/>
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index a2a1a3a741..f9af7fcd57 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -598,6 +598,22 @@ draw_buffers_error(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n,
 }
 
 
+static void
+draw_buffers_no_error(struct gl_context *ctx, struct gl_framebuffer *fb,
+                      GLsizei n, const GLenum *buffers, const char *caller)
+{
+   draw_buffers(ctx, fb, n, buffers, caller, true);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawBuffers_no_error(GLsizei n, const GLenum *buffers)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   draw_buffers_no_error(ctx, ctx->DrawBuffer, n, buffers, "glDrawBuffers");
+}
+
+
 void GLAPIENTRY
 _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
 {
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index e86da341d6..e11b74f16f 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -52,6 +52,9 @@ _mesa_NamedFramebufferDrawBuffer_no_error(GLuint framebuffer, GLenum buf);
 extern void GLAPIENTRY
 _mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf);
 
+void GLAPIENTRY
+_mesa_DrawBuffers_no_error(GLsizei n, const GLenum *buffers);
+
 extern void GLAPIENTRY
 _mesa_DrawBuffers(GLsizei n, const GLenum *buffers);
 
-- 
2.13.3



More information about the mesa-dev mailing list