From 1f0a5f32d328e54483dd623ad09bd3f6b119f7a6 Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Fri, 6 Feb 2015 15:36:52 -0800 Subject: main: Add entry point for NamedFramebufferReadBuffer. 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 32e3c0afbeb..6e5c4d30462 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -192,6 +192,11 @@ + + + + + diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index e1d1bafc367..d9979ad9ed5 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -697,3 +697,22 @@ _mesa_ReadBuffer(GLenum buffer) GET_CURRENT_CONTEXT(ctx); _mesa_read_buffer(ctx, ctx->ReadBuffer, buffer, "glReadBuffer"); } + + +void GLAPIENTRY +_mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_framebuffer *fb; + + if (framebuffer) { + fb = _mesa_lookup_framebuffer_err(ctx, framebuffer, + "glNamedFramebufferReadBuffer"); + if (!fb) + return; + } + else + fb = ctx->WinSysReadBuffer; + + _mesa_read_buffer(ctx, fb, src, "glNamedFramebufferReadBuffer"); +} diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index ca7ad19235b..52a23188194 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -71,5 +71,8 @@ _mesa_read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb, extern void GLAPIENTRY _mesa_ReadBuffer( GLenum mode ); +extern void GLAPIENTRY +_mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src); + #endif diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 931eeceb212..dcbb0c69e4c 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 }, + { "glNamedFramebufferReadBuffer", 45, -1 }, { "glInvalidateNamedFramebufferSubData", 45, -1 }, { "glInvalidateNamedFramebufferData", 45, -1 }, { "glClearNamedFramebufferiv", 45, -1 }, -- cgit v1.2.3