mesa: add KHR_no_error support for gl*ReadBuffer()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 26 Jun 2017 15:12:18 +0000 (17:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 28 Jun 2017 08:25:13 +0000 (10:25 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/buffers.c
src/mesa/main/buffers.h

index 6226aa0b9d27dcf0456d91dc7c56122af1c65a03..d848f78d62d92142e9e47cbbf87ccc51595fda0b 100644 (file)
       <param name="bufs" type="const GLenum *" />
    </function>
 
-   <function name="NamedFramebufferReadBuffer">
+   <function name="NamedFramebufferReadBuffer" no_error="true">
       <param name="framebuffer" type="GLuint" />
       <param name="buf" type="GLenum" />
    </function>
index 4833d520103334acb9d327c579fc29bc2fe25ffb..d28109525012cc7d5b00c4e6cc28ccf9b7766ba1 100644 (file)
         <glx rop="170" large="true"/>
     </function>
 
-    <function name="ReadBuffer" es2="3.0">
+    <function name="ReadBuffer" es2="3.0" no_error="true">
         <param name="mode" type="GLenum"/>
         <glx rop="171"/>
     </function>
index 18e46adf84e69549bb312853d7c770f66211cc45..6359e1b51fd7eeaabda543a0f62cb2508d52101a 100644 (file)
@@ -801,6 +801,22 @@ read_buffer_err(struct gl_context *ctx, struct gl_framebuffer *fb,
 }
 
 
+static void
+read_buffer_no_error(struct gl_context *ctx, struct gl_framebuffer *fb,
+                     GLenum buffer, const char *caller)
+{
+   read_buffer(ctx, fb, buffer, caller, true);
+}
+
+
+void GLAPIENTRY
+_mesa_ReadBuffer_no_error(GLenum buffer)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   read_buffer_no_error(ctx, ctx->ReadBuffer, buffer, "glReadBuffer");
+}
+
+
 void GLAPIENTRY
 _mesa_ReadBuffer(GLenum buffer)
 {
@@ -809,6 +825,23 @@ _mesa_ReadBuffer(GLenum buffer)
 }
 
 
+void GLAPIENTRY
+_mesa_NamedFramebufferReadBuffer_no_error(GLuint framebuffer, GLenum src)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_framebuffer *fb;
+
+   if (framebuffer) {
+      fb = _mesa_lookup_framebuffer(ctx, framebuffer);
+   } else {
+      fb = ctx->WinSysReadBuffer;
+   }
+
+   read_buffer_no_error(ctx, fb, src, "glNamedFramebufferReadBuffer");
+}
+
+
 void GLAPIENTRY
 _mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src)
 {
index 9df0815468806a06c87fe0a89e1dd71bf88ffd21..ba06138017e983082d3f0f3a4739b79d1ee208ec 100644 (file)
@@ -65,10 +65,15 @@ _mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
 extern void
 _mesa_update_draw_buffers(struct gl_context *ctx);
 
+void GLAPIENTRY
+_mesa_ReadBuffer_no_error(GLenum mode);
 
 extern void GLAPIENTRY
 _mesa_ReadBuffer( GLenum mode );
 
+void GLAPIENTRY
+_mesa_NamedFramebufferReadBuffer_no_error(GLuint framebuffer, GLenum src);
+
 extern void GLAPIENTRY
 _mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src);