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

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


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mapi/glapi/gen/ARB_direct_state_access.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/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 54276ea59d..d859021f0c 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -186,7 +186,7 @@
       <param name="layer" type="GLint" />
    </function>
 
-   <function name="NamedFramebufferDrawBuffer">
+   <function name="NamedFramebufferDrawBuffer" no_error="true">
       <param name="framebuffer" type="GLuint" />
       <param name="buf" type="GLenum" />
    </function>
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 02596b7f68..9a049e94c7 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -344,6 +344,22 @@ _mesa_DrawBuffer(GLenum buffer)
 
 
 void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffer_no_error(GLuint framebuffer, GLenum buf)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_framebuffer *fb;
+
+   if (framebuffer) {
+      fb = _mesa_lookup_framebuffer(ctx, framebuffer);
+   } else {
+      fb = ctx->WinSysDrawBuffer;
+   }
+
+   draw_buffer_no_error(ctx, fb, buf, "glNamedFramebufferDrawBuffer");
+}
+
+
+void GLAPIENTRY
 _mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
 {
    GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 630b0dce54..e86da341d6 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -46,6 +46,9 @@ _mesa_DrawBuffer_no_error(GLenum mode);
 extern void GLAPIENTRY
 _mesa_DrawBuffer( GLenum mode );
 
+void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffer_no_error(GLuint framebuffer, GLenum buf);
+
 extern void GLAPIENTRY
 _mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf);
 
-- 
2.13.3



More information about the mesa-dev mailing list