[Mesa-dev] [PATCH] vbo: Move vbo_rebase into its only caller module tnl.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Tue Feb 6 07:04:20 UTC 2018


From: Mathias Fröhlich <mathias.froehlich at web.de>

Hi all,

The change move vbo_rebase_prims into the tnl module.
The tnl module is the only user of this function.

please review

best

Mathias

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/Makefile.sources                     |  3 ++-
 src/mesa/meson.build                          |  2 +-
 src/mesa/tnl/t_draw.c                         |  7 ++---
 src/mesa/{vbo/vbo_rebase.c => tnl/t_rebase.c} | 18 ++++++-------
 src/mesa/tnl/t_rebase.h                       | 39 +++++++++++++++++++++++++++
 src/mesa/vbo/vbo.h                            | 11 --------
 6 files changed, 55 insertions(+), 25 deletions(-)
 rename src/mesa/{vbo/vbo_rebase.c => tnl/t_rebase.c} (94%)
 create mode 100644 src/mesa/tnl/t_rebase.h

diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index 880f379eb1..0a9aad52d0 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -370,6 +370,8 @@ TNL_FILES = \
 	tnl/tnl.h \
 	tnl/t_pipeline.c \
 	tnl/t_pipeline.h \
+	tnl/t_rebase.c \
+	tnl/t_rebase.h \
 	tnl/t_vb_cliptmp.h \
 	tnl/t_vb_fog.c \
 	tnl/t_vb_light.c \
@@ -405,7 +407,6 @@ VBO_FILES = \
 	vbo/vbo_noop.h \
 	vbo/vbo_primitive_restart.c \
 	vbo/vbo_private.h \
-	vbo/vbo_rebase.c \
 	vbo/vbo_save_api.c \
 	vbo/vbo_save.c \
 	vbo/vbo_save_draw.c \
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index a74c39d29e..aa27d59264 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -338,7 +338,6 @@ files_libmesa_common = files(
   'vbo/vbo_noop.c',
   'vbo/vbo_noop.h',
   'vbo/vbo_primitive_restart.c',
-  'vbo/vbo_rebase.c',
   'vbo/vbo_save_api.c',
   'vbo/vbo_save.c',
   'vbo/vbo_save_draw.c',
@@ -366,6 +365,7 @@ files_libmesa_classic = files(
   'tnl/tnl.h',
   'tnl/t_pipeline.c',
   'tnl/t_pipeline.h',
+  'tnl/t_rebase.c',
   'tnl/t_vb_cliptmp.h',
   'tnl/t_vb_fog.c',
   'tnl/t_vb_light.c',
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 9fca4da1f4..c19d77d641 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -38,6 +38,7 @@
 #include "util/half_float.h"
 
 #include "t_context.h"
+#include "t_rebase.h"
 #include "tnl.h"
 
 
@@ -461,9 +462,9 @@ void _tnl_draw_prims(struct gl_context *ctx,
    if (min_index) {
       /* We always translate away calls with min_index != 0. 
        */
-      vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, 
-			min_index, max_index,
-			_tnl_draw_prims );
+      t_rebase_prims( ctx, arrays, prim, nr_prims, ib,
+                      min_index, max_index,
+                      _tnl_draw_prims );
       return;
    }
    else if ((GLint)max_index + max_basevertex > max) {
diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/tnl/t_rebase.c
similarity index 94%
rename from src/mesa/vbo/vbo_rebase.c
rename to src/mesa/tnl/t_rebase.c
index 02dbc68dcb..b781781cb0 100644
--- a/src/mesa/vbo/vbo_rebase.c
+++ b/src/mesa/tnl/t_rebase.c
@@ -51,7 +51,7 @@
 #include "main/imports.h"
 #include "main/mtypes.h"
 
-#include "vbo.h"
+#include "t_rebase.h"
 
 
 #define REBASE(TYPE) 						\
@@ -100,14 +100,14 @@ REBASE(GLubyte)
  *    - can't save time by trying to upload half a vbo - typically it is
  *      all or nothing.
  */
-void vbo_rebase_prims( struct gl_context *ctx,
-		       const struct gl_vertex_array *arrays[],
-		       const struct _mesa_prim *prim,
-		       GLuint nr_prims,
-		       const struct _mesa_index_buffer *ib,
-		       GLuint min_index,
-		       GLuint max_index,
-		       vbo_draw_func draw )
+void t_rebase_prims( struct gl_context *ctx,
+                     const struct gl_vertex_array *arrays[],
+                     const struct _mesa_prim *prim,
+                     GLuint nr_prims,
+                     const struct _mesa_index_buffer *ib,
+                     GLuint min_index,
+                     GLuint max_index,
+                     vbo_draw_func draw )
 {
    struct gl_vertex_array tmp_arrays[VERT_ATTRIB_MAX];
    const struct gl_vertex_array *tmp_array_pointers[VERT_ATTRIB_MAX];
diff --git a/src/mesa/tnl/t_rebase.h b/src/mesa/tnl/t_rebase.h
new file mode 100644
index 0000000000..35175868d5
--- /dev/null
+++ b/src/mesa/tnl/t_rebase.h
@@ -0,0 +1,39 @@
+/*
+ * mesa 3-D graphics library
+ *
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _T_REBASE_H_
+#define _T_REBASE_H_
+
+#include "vbo/vbo.h"
+
+void t_rebase_prims( struct gl_context *ctx,
+                     const struct gl_vertex_array *arrays[],
+                     const struct _mesa_prim *prim,
+                     GLuint nr_prims,
+                     const struct _mesa_index_buffer *ib,
+                     GLuint min_index,
+                     GLuint max_index,
+                     vbo_draw_func draw );
+
+#endif
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 6ae6991cad..a04f9b849c 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -225,17 +225,6 @@ vbo_split_prims(struct gl_context *ctx,
                 const struct split_limits *limits);
 
 
-void
-vbo_rebase_prims(struct gl_context *ctx,
-                 const struct gl_vertex_array *arrays[],
-                 const struct _mesa_prim *prim,
-                 GLuint nr_prims,
-                 const struct _mesa_index_buffer *ib,
-                 GLuint min_index,
-                 GLuint max_index,
-                 vbo_draw_func draw);
-
-
 void
 vbo_delete_minmax_cache(struct gl_buffer_object *bufferObj);
 
-- 
2.14.3



More information about the mesa-dev mailing list