From 642fb71277b6e4c5d57ad7a7d6f2d5aae9b746ef Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Fri, 6 Feb 2015 14:44:43 -0800 Subject: main: Add entry point for NamedFramebufferDrawBuffer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Fredrik: Fix the name of the buf parameter in the XML file] Reviewed-by: Fredrik Höglund Signed-off-by: Fredrik Höglund --- src/mapi/glapi/gen/ARB_direct_state_access.xml | 5 +++++ src/mesa/main/buffers.c | 19 +++++++++++++++++++ src/mesa/main/buffers.h | 3 +++ src/mesa/main/tests/dispatch_sanity.cpp | 1 + 4 files changed, 28 insertions(+) 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 @@ + + + + + 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 @@ -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); 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 }, -- cgit v1.2.3