main: Add entry point for GetNamedBufferPointerv.
authorLaura Ekstrand <laura@jlekstrand.net>
Tue, 20 Jan 2015 22:32:35 +0000 (14:32 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Mar 2015 17:18:34 +0000 (10:18 -0700)
v3: Review from Fredrik Hoglund
   -Split cosmetic refactor of GetBufferPointerv out into a separate commit

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index cb9f285fe83a34b0b8da8e6b98b4d9f9d02e9e43..8bcbb08f49c0260977bb423ee0badf99edfe7127 100644 (file)
       <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">
index 4c2cdf491f42821b721cd94ad29df7f1988d96a8..2811604b1151f264cd53d26d5e8bc8a5ecfdf3f3 100644 (file)
@@ -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,
index 6b29ce7a707267583f1ef1c0e68023bb6687faf9..eee04fe86e930122fb318031f932df9809a7bc42 100644 (file)
@@ -277,6 +277,10 @@ _mesa_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname,
 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,
index 336c41c1095f918bb58e7450843bbcb5fc0048f5..01b73a6acca2786bed7ccaaaba8c7eedd774b713 100644 (file)
@@ -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 },