From 23eab47bbe998b95d5da889b85b7b0ca6e14385b Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Tue, 20 Jan 2015 15:24:53 -0800 Subject: [PATCH] main: Add entry point for GetNamedBufferSubData. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Fredrik Höglund --- .../glapi/gen/ARB_direct_state_access.xml | 7 ++++++ src/mesa/main/bufferobj.c | 22 +++++++++++++++++++ src/mesa/main/bufferobj.h | 4 ++++ src/mesa/main/tests/dispatch_sanity.cpp | 1 + 4 files changed, 34 insertions(+) diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 8bcbb08f49c..641e68f71f0 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -104,6 +104,13 @@ + + + + + + + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 49d6d329e6b..7aac1c62f65 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1700,6 +1700,28 @@ _mesa_GetBufferSubData(GLenum target, GLintptr offset, ctx->Driver.GetBufferSubData( ctx, offset, size, data, bufObj ); } +void GLAPIENTRY +_mesa_GetNamedBufferSubData(GLuint buffer, GLintptr offset, + GLsizeiptr size, GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj; + + bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, + "glGetNamedBufferSubData"); + if (!bufObj) + return; + + if (!buffer_object_subdata_range_good(ctx, bufObj, offset, size, false, + "glGetNamedBufferSubData")) { + return; + } + + assert(ctx->Driver.GetBufferSubData); + ctx->Driver.GetBufferSubData(ctx, offset, size, data, bufObj); +} + + /** * \param subdata true if caller is *SubData, false if *Data */ diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index eee04fe86e9..feeaa8b058e 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -233,6 +233,10 @@ void GLAPIENTRY _mesa_GetBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); +void GLAPIENTRY +_mesa_GetNamedBufferSubData(GLuint buffer, GLintptr offset, + GLsizeiptr size, GLvoid *data); + void GLAPIENTRY _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 01b73a6acca..5d849d4ddb0 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -967,6 +967,7 @@ const struct function gl_core_functions_possible[] = { { "glGetNamedBufferParameteriv", 45, -1 }, { "glGetNamedBufferParameteri64v", 45, -1 }, { "glGetNamedBufferPointerv", 45, -1 }, + { "glGetNamedBufferSubData", 45, -1 }, { "glCreateTextures", 45, -1 }, { "glTextureStorage1D", 45, -1 }, { "glTextureStorage2D", 45, -1 }, -- 2.30.2