summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2015-02-06 14:44:43 -0800
committerFredrik Höglund <[email protected]>2015-05-14 15:48:15 +0200
commit642fb71277b6e4c5d57ad7a7d6f2d5aae9b746ef (patch)
tree4b10c520876aaaef7731e0411052a1affc870b66
parent2f32e4847d154a9d16869cf03ce66f719d37ec4a (diff)
main: Add entry point for NamedFramebufferDrawBuffer.
[Fredrik: Fix the name of the buf parameter in the XML file] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
-rw-r--r--src/mapi/glapi/gen/ARB_direct_state_access.xml5
-rw-r--r--src/mesa/main/buffers.c19
-rw-r--r--src/mesa/main/buffers.h3
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp1
4 files changed, 28 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 3617e48a19c..32e3c0afbeb 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -187,6 +187,11 @@
<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" />
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 8b52a5392a8..9b66e38b1e1 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -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.
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 4192afd3f13..12d57430a39 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -46,6 +46,9 @@ 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);
extern void
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 23ddabd169d..931eeceb212 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -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 },