main: Add entry point for GetNamedBufferSubData.
authorLaura Ekstrand <laura@jlekstrand.net>
Tue, 20 Jan 2015 23:24:53 +0000 (15:24 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Mar 2015 17:18:34 +0000 (10:18 -0700)
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 8bcbb08f49c0260977bb423ee0badf99edfe7127..641e68f71f03fe5f1fc819b5338e6399150b3baf 100644 (file)
       <param name="params" type="GLvoid **" />
    </function>
 
+   <function name="GetNamedBufferSubData" offset="assign">
+      <param name="buffer" type="GLuint" />
+      <param name="offset" type="GLintptr" />
+      <param name="size" type="GLsizeiptr" />
+      <param name="data" type="GLvoid *" />
+   </function>
+
    <!-- Texture object functions -->
 
    <function name="CreateTextures" offset="assign">
index 49d6d329e6bf88c5168766c099aa9f1aa3701d5f..7aac1c62f65c5980769f976002841502563636c7 100644 (file)
@@ -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
  */
index eee04fe86e930122fb318031f932df9809a7bc42..feeaa8b058e9f30fc59027e5ebefb135d5c31aa2 100644 (file)
@@ -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,
index 01b73a6acca2786bed7ccaaaba8c7eedd774b713..5d849d4ddb03f76819e7217d78935447db19416b 100644 (file)
@@ -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 },