diff options
author | Laura Ekstrand <laura@jlekstrand.net> | 2015-01-20 14:32:35 -0800 |
---|---|---|
committer | Laura Ekstrand <laura@jlekstrand.net> | 2015-03-17 10:18:34 -0700 |
commit | 105ddc6aea397bd5d39b8ffcd25278ed12102e3c (patch) | |
tree | 1be0fbf41319524e203cae0dcbe1b451850ca567 | |
parent | 1e45752aaf4ac7d2324d71bda4d2ac34f3abf8bd (diff) |
main: Add entry point for GetNamedBufferPointerv.
v3: Review from Fredrik Hoglund
-Split cosmetic refactor of GetBufferPointerv out into a separate commit
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
-rw-r--r-- | src/mapi/glapi/gen/ARB_direct_state_access.xml | 6 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.c | 20 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.h | 4 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 1 |
4 files changed, 31 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 cb9f285fe83..8bcbb08f49c 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -98,6 +98,12 @@ <param name="params" type="GLint64 *" /> </function> + <function name="GetNamedBufferPointerv" offset="assign"> + <param name="buffer" type="GLuint" /> + <param name="pname" type="GLenum" /> + <param name="params" type="GLvoid **" /> + </function> + <!-- Texture object functions --> <function name="CreateTextures" offset="assign"> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 4c2cdf491f4..2811604b115 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2066,6 +2066,26 @@ _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params) *params = bufObj->Mappings[MAP_USER].Pointer; } +void GLAPIENTRY +_mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj; + + if (pname != GL_BUFFER_MAP_POINTER) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetNamedBufferPointerv(pname != " + "GL_BUFFER_MAP_POINTER)"); + return; + } + + bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, + "glGetNamedBufferPointerv"); + if (!bufObj) + return; + + *params = bufObj->Mappings[MAP_USER].Pointer; +} + void _mesa_copy_buffer_sub_data(struct gl_context *ctx, diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 6b29ce7a707..eee04fe86e9 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -278,6 +278,10 @@ void GLAPIENTRY _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params); void GLAPIENTRY +_mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params); + + +void GLAPIENTRY _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 336c41c1095..01b73a6acca 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -966,6 +966,7 @@ const struct function gl_core_functions_possible[] = { { "glFlushMappedNamedBufferRange", 45, -1 }, { "glGetNamedBufferParameteriv", 45, -1 }, { "glGetNamedBufferParameteri64v", 45, -1 }, + { "glGetNamedBufferPointerv", 45, -1 }, { "glCreateTextures", 45, -1 }, { "glTextureStorage1D", 45, -1 }, { "glTextureStorage2D", 45, -1 }, |