[Bf-blender-cvs] [15038975a3f] master: Cleanup: GPU PBVH naming

Campbell Barton noreply at git.blender.org
Thu May 11 14:04:54 CEST 2017


Commit: 15038975a3fb9f2232a53745ea7ed08a2145479f
Author: Campbell Barton
Date:   Thu May 11 22:03:50 2017 +1000
Branches: master
https://developer.blender.org/rB15038975a3fb9f2232a53745ea7ed08a2145479f

Cleanup: GPU PBVH naming

Use GPU_pbvh prefix.

===================================================================

M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/intern/gpu_buffers.c

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 4fe4d6e75a6..dacaad8d703 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -620,7 +620,7 @@ void BKE_pbvh_free(PBVH *bvh)
 
 		if (node->flag & PBVH_Leaf) {
 			if (node->draw_buffers)
-				GPU_free_pbvh_buffers(node->draw_buffers);
+				GPU_pbvh_buffers_free(node->draw_buffers);
 			if (node->vert_indices)
 				MEM_freeN((void *)node->vert_indices);
 			if (node->face_vert_indices)
@@ -635,7 +635,7 @@ void BKE_pbvh_free(PBVH *bvh)
 				BLI_gset_free(node->bm_other_verts, NULL);
 		}
 	}
-	GPU_free_pbvh_buffer_multires(&bvh->grid_common_gpu_buffer);
+	GPU_pbvh_multires_buffers_free(&bvh->grid_common_gpu_buffer);
 
 	if (bvh->deformed) {
 		if (bvh->verts) {
@@ -1090,11 +1090,11 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
 		PBVHNode *node = nodes[n];
 
 		if (node->flag & PBVH_RebuildDrawBuffers) {
-			GPU_free_pbvh_buffers(node->draw_buffers);
+			GPU_pbvh_buffers_free(node->draw_buffers);
 			switch (bvh->type) {
 				case PBVH_GRIDS:
 					node->draw_buffers =
-						GPU_build_grid_pbvh_buffers(node->prim_indices,
+						GPU_pbvh_grid_buffers_build(node->prim_indices,
 					                           node->totprim,
 					                           bvh->grid_hidden,
 					                           bvh->gridkey.grid_size,
@@ -1102,7 +1102,7 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
 					break;
 				case PBVH_FACES:
 					node->draw_buffers =
-						GPU_build_mesh_pbvh_buffers(node->face_vert_indices,
+						GPU_pbvh_mesh_buffers_build(node->face_vert_indices,
 					                           bvh->mpoly, bvh->mloop, bvh->looptri,
 					                           bvh->verts,
 					                           node->prim_indices,
@@ -1110,7 +1110,7 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
 					break;
 				case PBVH_BMESH:
 					node->draw_buffers =
-						GPU_build_bmesh_pbvh_buffers(bvh->flags & PBVH_DYNTOPO_SMOOTH_SHADING);
+						GPU_pbvh_bmesh_buffers_build(bvh->flags & PBVH_DYNTOPO_SMOOTH_SHADING);
 					break;
 			}
  
@@ -1120,32 +1120,34 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
 		if (node->flag & PBVH_UpdateDrawBuffers) {
 			switch (bvh->type) {
 				case PBVH_GRIDS:
-					GPU_update_grid_pbvh_buffers(node->draw_buffers,
-					                        bvh->grids,
-					                        bvh->grid_flag_mats,
-					                        node->prim_indices,
-					                        node->totprim,
-					                        &bvh->gridkey,
-					                        bvh->show_diffuse_color);
+					GPU_pbvh_grid_buffers_update(
+					        node->draw_buffers,
+					        bvh->grids,
+					        bvh->grid_flag_mats,
+					        node->prim_indices,
+					        node->totprim,
+					        &bvh->gridkey,
+					        bvh->show_diffuse_color);
 					break;
 				case PBVH_FACES:
-					GPU_update_mesh_pbvh_buffers(node->draw_buffers,
-					                        bvh->verts,
-					                        node->vert_indices,
-					                        node->uniq_verts +
-					                        node->face_verts,
-					                        CustomData_get_layer(bvh->vdata,
-					                                             CD_PAINT_MASK),
-					                        node->face_vert_indices,
-					                        bvh->show_diffuse_color);
+					GPU_pbvh_mesh_buffers_update(
+					        node->draw_buffers,
+					        bvh->verts,
+					        node->vert_indices,
+					        node->uniq_verts +
+					        node->face_verts,
+					        CustomData_get_layer(bvh->vdata, CD_PAINT_MASK),
+					        node->face_vert_indices,
+					        bvh->show_diffuse_color);
 					break;
 				case PBVH_BMESH:
-					GPU_update_bmesh_pbvh_buffers(node->draw_buffers,
-					                         bvh->bm,
-					                         node->bm_faces,
-					                         node->bm_unique_verts,
-					                         node->bm_other_verts,
-					                         bvh->show_diffuse_color);
+					GPU_pbvh_bmesh_buffers_update(
+					        node->draw_buffers,
+					        bvh->bm,
+					        node->bm_faces,
+					        node->bm_unique_verts,
+					        node->bm_other_verts,
+					        bvh->show_diffuse_color);
 					break;
 			}
 
@@ -1156,15 +1158,15 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
 
 static void pbvh_draw_BB(PBVH *bvh)
 {
-	GPU_init_draw_pbvh_BB();
+	GPU_pbvh_BB_draw_init();
 
 	for (int a = 0; a < bvh->totnode; a++) {
 		PBVHNode *node = &bvh->nodes[a];
 
-		GPU_draw_pbvh_BB(node->vb.bmin, node->vb.bmax, ((node->flag & PBVH_Leaf) != 0));
+		GPU_pbvh_BB_draw(node->vb.bmin, node->vb.bmax, ((node->flag & PBVH_Leaf) != 0));
 	}
 
-	GPU_end_draw_pbvh_BB();
+	GPU_pbvh_BB_draw_end();
 }
 
 static int pbvh_flush_bb(PBVH *bvh, PBVHNode *node, int flag)
@@ -1756,7 +1758,7 @@ void BKE_pbvh_node_draw(PBVHNode *node, void *data_v)
 #endif
 
 	if (!(node->flag & PBVH_FullyHidden)) {
-		GPU_draw_pbvh_buffers(node->draw_buffers,
+		GPU_pbvh_buffers_draw(node->draw_buffers,
 		                 data->setMaterial,
 		                 data->wireframe,
 		                 data->fast);
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index a821578db1a..c5e49883dc6 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -352,7 +352,7 @@ static void pbvh_bmesh_node_split(PBVH *bvh, const BBC *bbc_array, int node_inde
 	n->layer_disp = NULL;
 
 	if (n->draw_buffers) {
-		GPU_free_pbvh_buffers(n->draw_buffers);
+		GPU_pbvh_buffers_free(n->draw_buffers);
 		n->draw_buffers = NULL;
 	}
 	n->flag &= ~PBVH_Leaf;
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index b693d473bd8..e4a837d0a5f 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -222,50 +222,53 @@ void GPU_interleaved_attrib_unbind(void);
 typedef struct GPU_PBVH_Buffers GPU_PBVH_Buffers;
 
 /* build */
-GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(
+GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(
         const int (*face_vert_indices)[3],
         const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopTri *looptri,
         const struct MVert *verts,
         const int *face_indices,
         const int  face_indices_len);
 
-GPU_PBVH_Buffers *GPU_build_grid_pbvh_buffers(
+GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(
         int *grid_indices, int totgrid, unsigned int **grid_hidden, int gridsize, const struct CCGKey *key,
         struct GridCommonGPUBuffer **grid_common_gpu_buffer);
 
-GPU_PBVH_Buffers *GPU_build_bmesh_pbvh_buffers(bool smooth_shading);
+GPU_PBVH_Buffers *GPU_pbvh_bmesh_buffers_build(bool smooth_shading);
 
 /* update */
 
-void GPU_update_mesh_pbvh_buffers(
+void GPU_pbvh_mesh_buffers_update(
         GPU_PBVH_Buffers *buffers, const struct MVert *mvert,
         const int *vert_indices, int totvert, const float *vmask,
         const int (*face_vert_indices)[3], bool show_diffuse_color);
 
-void GPU_update_bmesh_pbvh_buffers(GPU_PBVH_Buffers *buffers,
-                              struct BMesh *bm,
-                              struct GSet *bm_faces,
-                              struct GSet *bm_unique_verts,
-                              struct GSet *bm_other_verts,
-                              bool show_diffuse_color);
+void GPU_pbvh_bmesh_buffers_update(
+        GPU_PBVH_Buffers *buffers,
+        struct BMesh *bm,
+        struct GSet *bm_faces,
+        struct GSet *bm_unique_verts,
+        struct GSet *bm_other_verts,
+        bool show_diffuse_color);
 
-void GPU_update_grid_pbvh_buffers(GPU_PBVH_Buffers *buffers, struct CCGElem **grids,
-                             const struct DMFlagMat *grid_flag_mats,
-                             int *grid_indices, int totgrid, const struct CCGKey *key,
-                             bool show_diffuse_color);
+void GPU_pbvh_grid_buffers_update(
+        GPU_PBVH_Buffers *buffers, struct CCGElem **grids,
+        const struct DMFlagMat *grid_flag_mats,
+        int *grid_indices, int totgrid, const struct CCGKey *key,
+        bool show_diffuse_color);
 
 /* draw */
-void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
-                           bool wireframe, bool fast);
+void GPU_pbvh_buffers_draw(
+        GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
+        bool wireframe, bool fast);
 
 /* debug PBVH draw*/
-void GPU_draw_pbvh_BB(float min[3], float max[3], bool leaf);
-void GPU_end_draw_pbvh_BB(void);
-void GPU_init_draw_pbvh_BB(void);
+void GPU_pbvh_BB_draw(float min[3], float max[3], bool leaf);
+void GPU_pbvh_BB_draw_init(void);
+void GPU_pbvh_BB_draw_end(void);
 
 bool GPU_pbvh_buffers_diffuse_changed(GPU_PBVH_Buffers *buffers, struct GSet *bm_faces, bool show_diffuse_color);
 
-void GPU_free_pbvh_buffers(GPU_PBVH_Buffers *buffers);
-void GPU_free_pbvh_buffer_multires(struct GridCommonGPUBuffer **grid_common_gpu_buffer);
+void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers);
+void GPU_pbvh_multires_buffers_free(struct GridCommonGPUBuffer **grid_common_gpu_buffer);
 
 #endif
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 6a2aa106f6a..9f1fe3a5a67 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1030,7 +1030,7 @@ static void gpu_color_from_mask_quad_copy(const CCGKey *key,
 	out[2] = diffuse_color[2] * mask_color;
 }
 
-void GPU_update_mesh_pbvh_buffers(
+void GPU_pbvh_mesh_buffers_update(
         GPU_PBVH_Buffers *buffers, const MVert *mvert,
         const int *vert_indices, int totvert, const float *vmask,
         const int (*face_vert_indices)[3], bool show_diffuse_color)
@@ -1152,7 +1152,7 @@ void GPU_update_mesh_pbvh_buffers(
 	buffers->mvert = mvert;
 }
 
-GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(
+GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list