[Mesa-dev] [PATCH 38/38] main: Add entry point for NamedFramebufferDrawBuffers.

Laura Ekstrand laura at jlekstrand.net
Tue Mar 3 17:32:30 PST 2015


---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  6 ++++++
 src/mesa/main/buffers.c                        | 19 +++++++++++++++++++
 src/mesa/main/buffers.h                        |  4 ++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  1 +
 4 files changed, 30 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 1bdb29c..87483a0 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -151,6 +151,12 @@
       <param name="mode" type="GLenum" />
    </function>
 
+   <function name="NamedFramebufferDrawBuffers" offset="assign">
+      <param name="framebuffer" type="GLuint" />
+      <param name="n" type="GLsizei" />
+      <param name="bufs" type="const GLenum *" />
+   </function>
+
    <function name="NamedFramebufferReadBuffer" offset="assign">
       <param name="framebuffer" type="GLuint" />
       <param name="mode" type="GLenum" />
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 32986f5..6305cdf 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -504,6 +504,25 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
    _mesa_draw_buffers(ctx, ctx->DrawBuffer, n, buffers, "glDrawBuffers");
 }
 
+void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n,
+                                  const GLenum *bufs)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_framebuffer *fb;
+
+   if (framebuffer) {
+      fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+                                        "glNamedFramebufferDrawBuffers");
+      if (!fb)
+         return;
+   }
+   else
+      fb = ctx->WinSysDrawBuffer;
+
+   _mesa_draw_buffers(ctx, fb, n, bufs, "glNamedFramebufferDrawBuffers");
+}
+
 
 /**
  * Performs necessary state updates when _mesa_drawbuffers makes an
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 66871d7..5aa79fd 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -55,6 +55,10 @@ _mesa_draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
 extern void GLAPIENTRY
 _mesa_DrawBuffers(GLsizei n, const GLenum *buffers);
 
+extern void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n,
+                                  const GLenum *bufs);
+
 extern void
 _mesa_drawbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
                   GLuint n, const GLenum *buffers,
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 0afb650..e9a26ca 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -976,6 +976,7 @@ const struct function gl_core_functions_possible[] = {
    { "glNamedFramebufferTexture", 45, -1 },
    { "glNamedFramebufferTextureLayer", 45, -1 },
    { "glNamedFramebufferDrawBuffer", 45, -1 },
+   { "glNamedFramebufferDrawBuffers", 45, -1 },
    { "glNamedFramebufferReadBuffer", 45, -1 },
    { "glInvalidateNamedFramebufferSubData", 45, -1 },
    { "glInvalidateNamedFramebufferData", 45, -1 },
-- 
2.1.0



More information about the mesa-dev mailing list