main: Add entry point for NamedFramebufferDrawBuffer.
authorLaura Ekstrand <laura@jlekstrand.net>
Fri, 6 Feb 2015 22:44:43 +0000 (14:44 -0800)
committerFredrik Höglund <fredrik@kde.org>
Thu, 14 May 2015 13:48:15 +0000 (15:48 +0200)
[Fredrik: Fix the name of the buf parameter in the XML file]

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/buffers.c
src/mesa/main/buffers.h
src/mesa/main/tests/dispatch_sanity.cpp

index 3617e48a19c5d400f69134eb9bb6336d4cb98ccb..32e3c0afbeb8d342fd9f36822958fc9dc377a2fe 100644 (file)
       <param name="layer" type="GLint" />
    </function>
 
+   <function name="NamedFramebufferDrawBuffer" offset="assign">
+      <param name="framebuffer" type="GLuint" />
+      <param name="buf" type="GLenum" />
+   </function>
+
    <function name="InvalidateNamedFramebufferData" offset="assign">
       <param name="framebuffer" type="GLuint" />
       <param name="numAttachments" type="GLsizei" />
index 8b52a5392a8b59bfb383f5bafd2fafe76be4a60f..9b66e38b1e1fb979b734beca722e2762356aac55 100644 (file)
@@ -297,6 +297,25 @@ _mesa_DrawBuffer(GLenum buffer)
 }
 
 
+void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_framebuffer *fb;
+
+   if (framebuffer) {
+      fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+                                        "glNamedFramebufferDrawBuffer");
+      if (!fb)
+         return;
+   }
+   else
+      fb = ctx->WinSysDrawBuffer;
+
+   _mesa_draw_buffer(ctx, fb, buf, "glNamedFramebufferDrawBuffer");
+}
+
+
 /**
  * Called by glDrawBuffersARB; specifies the destination color renderbuffers
  * for N fragment program color outputs.
index 4192afd3f134e1733972c4572a82deacb8dc09a4..12d57430a3917ed5f0e9f1da44dd554528d39446 100644 (file)
@@ -45,6 +45,9 @@ _mesa_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
 extern void GLAPIENTRY
 _mesa_DrawBuffer( GLenum mode );
 
+extern void GLAPIENTRY
+_mesa_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf);
+
 extern void GLAPIENTRY
 _mesa_DrawBuffers(GLsizei n, const GLenum *buffers);
 
index 23ddabd169d300a607964a3caaff0dcaf178ce1b..931eeceb212b5edbbb5df7e148525706579e6563 100644 (file)
@@ -985,6 +985,7 @@ const struct function gl_core_functions_possible[] = {
    { "glNamedFramebufferParameteri", 45, -1 },
    { "glNamedFramebufferTexture", 45, -1 },
    { "glNamedFramebufferTextureLayer", 45, -1 },
+   { "glNamedFramebufferDrawBuffer", 45, -1 },
    { "glInvalidateNamedFramebufferSubData", 45, -1 },
    { "glInvalidateNamedFramebufferData", 45, -1 },
    { "glClearNamedFramebufferiv", 45, -1 },