[Mesa-dev] [PATCH 10/18] mesa: make _mesa_copy_buffer_sub_data() static

Timothy Arceri tarceri at itsqueeze.com
Thu May 4 07:41:35 UTC 2017


---
 src/mesa/main/bufferobj.c | 18 ++++++++----------
 src/mesa/main/bufferobj.h |  7 -------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 326e901..0a8f030 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2273,26 +2273,24 @@ _mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params)
 
    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,
-                           struct gl_buffer_object *src,
-                           struct gl_buffer_object *dst,
-                           GLintptr readOffset, GLintptr writeOffset,
-                           GLsizeiptr size, const char *func)
+static void
+copy_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *src,
+                     struct gl_buffer_object *dst, GLintptr readOffset,
+                     GLintptr writeOffset, GLsizeiptr size, const char *func)
 {
    if (_mesa_check_disallowed_mapping(src)) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "%s(readBuffer is mapped)", func);
       return;
    }
 
    if (_mesa_check_disallowed_mapping(dst)) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "%s(writeBuffer is mapped)", func);
@@ -2362,44 +2360,44 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
    src = get_buffer(ctx, "glCopyBufferSubData", readTarget,
                     GL_INVALID_OPERATION);
    if (!src)
       return;
 
    dst = get_buffer(ctx, "glCopyBufferSubData", writeTarget,
                     GL_INVALID_OPERATION);
    if (!dst)
       return;
 
-   _mesa_copy_buffer_sub_data(ctx, src, dst, readOffset, writeOffset, size,
-                              "glCopyBufferSubData");
+   copy_buffer_sub_data(ctx, src, dst, readOffset, writeOffset, size,
+                        "glCopyBufferSubData");
 }
 
 void GLAPIENTRY
 _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer,
                              GLintptr readOffset, GLintptr writeOffset,
                              GLsizeiptr size)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_buffer_object *src, *dst;
 
    src = _mesa_lookup_bufferobj_err(ctx, readBuffer,
                                     "glCopyNamedBufferSubData");
    if (!src)
       return;
 
    dst = _mesa_lookup_bufferobj_err(ctx, writeBuffer,
                                     "glCopyNamedBufferSubData");
    if (!dst)
       return;
 
-   _mesa_copy_buffer_sub_data(ctx, src, dst, readOffset, writeOffset, size,
-                              "glCopyNamedBufferSubData");
+   copy_buffer_sub_data(ctx, src, dst, readOffset, writeOffset, size,
+                        "glCopyNamedBufferSubData");
 }
 
 static bool
 validate_map_buffer_range(struct gl_context *ctx,
                           struct gl_buffer_object *bufObj, GLintptr offset,
                           GLsizeiptr length, GLbitfield access,
                           const char *func)
 {
    GLbitfield allowed_access;
 
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 3525a4b..fefb013 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -145,27 +145,20 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
 extern void
 _mesa_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
                       GLintptr offset, GLsizeiptr size, const GLvoid *data,
                       const char *func);
 
 extern void
 _mesa_buffer_unmap_all_mappings(struct gl_context *ctx,
                                 struct gl_buffer_object *bufObj);
 
 extern void
-_mesa_copy_buffer_sub_data(struct gl_context *ctx,
-                           struct gl_buffer_object *src,
-                           struct gl_buffer_object *dst,
-                           GLintptr readOffset, GLintptr writeOffset,
-                           GLsizeiptr size, const char *func);
-
-extern void
 _mesa_ClearBufferSubData_sw(struct gl_context *ctx,
                             GLintptr offset, GLsizeiptr size,
                             const GLvoid *clearValue,
                             GLsizeiptr clearValueSize,
                             struct gl_buffer_object *bufObj);
 
 /*
  * API functions
  */
 void GLAPIENTRY
-- 
2.9.3



More information about the mesa-dev mailing list