From 9de7a81626304dae5ced4e202a820e353f8fc1e9 Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Mon, 9 Feb 2015 14:08:00 -0800 Subject: [PATCH] main: Add entry point for NamedFramebufferDrawBuffers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Fredrik Höglund Signed-off-by: Fredrik Höglund --- .../glapi/gen/ARB_direct_state_access.xml | 6 ++++++ src/mesa/main/buffers.c | 20 +++++++++++++++++++ src/mesa/main/buffers.h | 4 ++++ src/mesa/main/tests/dispatch_sanity.cpp | 1 + 4 files changed, 31 insertions(+) diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 6e5c4d30462..bb9baf5a3d0 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -192,6 +192,12 @@ + + + + + + diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 0c6d379309f..0536266d756 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -506,6 +506,26 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers) } +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 * actual change. diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index 66871d70a09..5aa79fda54b 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 dcbb0c69e4c..77dc1401d19 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -986,6 +986,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.30.2