mesa: add KHR_no_error support to glDrawBuffer()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Jul 2017 09:14:48 +0000 (11:14 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:39 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/buffers.c
src/mesa/main/buffers.h

index 95c448d2364bad08a62be0552627a19ab767dcc7..4d0211a33c75363f44d0cff0624b34061c19b7b0 100644 (file)
         <glx rop="125"/>
     </function>
 
-    <function name="DrawBuffer">
+    <function name="DrawBuffer" no_error="true">
         <param name="mode" type="GLenum"/>
         <glx rop="126"/>
     </function>
index a37b39cf525fa49bfee16347548fd7fcc1bec162..02596b7f68925d3fb1a3bccb318a75b7634e2536 100644 (file)
@@ -319,6 +319,22 @@ draw_buffer_error(struct gl_context *ctx, struct gl_framebuffer *fb,
 }
 
 
+static void
+draw_buffer_no_error(struct gl_context *ctx, struct gl_framebuffer *fb,
+                     GLenum buffer, const char *caller)
+{
+   draw_buffer(ctx, fb, buffer, caller, true);
+}
+
+
+void GLAPIENTRY
+_mesa_DrawBuffer_no_error(GLenum buffer)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   draw_buffer_no_error(ctx, ctx->DrawBuffer, buffer, "glDrawBuffer");
+}
+
+
 void GLAPIENTRY
 _mesa_DrawBuffer(GLenum buffer)
 {
index ba06138017e983082d3f0f3a4739b79d1ee208ec..630b0dce5466a007c8a7865d990f626ba59c0e87 100644 (file)
@@ -40,6 +40,9 @@ struct gl_context;
 struct gl_framebuffer;
 
 
+void GLAPIENTRY
+_mesa_DrawBuffer_no_error(GLenum mode);
+
 extern void GLAPIENTRY
 _mesa_DrawBuffer( GLenum mode );