[Bf-blender-cvs] [8f028ec8408] blender2.8: Cleanup: rename struct for private engine data

Campbell Barton noreply at git.blender.org
Sat Apr 29 08:48:09 CEST 2017


Commit: 8f028ec8408c35c2029e6a0caeb7eb27dc8e53f3
Author: Campbell Barton
Date:   Sat Apr 29 16:52:12 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB8f028ec8408c35c2029e6a0caeb7eb27dc8e53f3

Cleanup: rename struct for private engine data

Also remove from pass list (there were some duplicate unused entries).

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

M	source/blender/draw/engines/basic/basic_engine.c
M	source/blender/draw/engines/clay/clay_engine.c
M	source/blender/draw/engines/eevee/eevee_engine.c
M	source/blender/draw/engines/eevee/eevee_private.h
M	source/blender/draw/modes/edit_armature_mode.c
M	source/blender/draw/modes/edit_curve_mode.c
M	source/blender/draw/modes/edit_lattice_mode.c
M	source/blender/draw/modes/edit_mesh_mode.c
M	source/blender/draw/modes/edit_metaball_mode.c
M	source/blender/draw/modes/edit_surface_mode.c
M	source/blender/draw/modes/edit_text_mode.c
M	source/blender/draw/modes/object_mode.c
M	source/blender/draw/modes/paint_texture_mode.c
M	source/blender/draw/modes/paint_vertex_mode.c
M	source/blender/draw/modes/paint_weight_mode.c
M	source/blender/draw/modes/particle_mode.c
M	source/blender/draw/modes/pose_mode.c
M	source/blender/draw/modes/sculpt_mode.c

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

diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c
index 17028e3ac2a..6a81d7d5e51 100644
--- a/source/blender/draw/engines/basic/basic_engine.c
+++ b/source/blender/draw/engines/basic/basic_engine.c
@@ -52,7 +52,7 @@ typedef struct BASIC_Storage {
 
 typedef struct BASIC_StorageList {
 	struct BASIC_Storage *storage;
-	struct g_data *g_data;
+	struct BASIC_PrivateData *g_data;
 } BASIC_StorageList;
 
 typedef struct BASIC_FramebufferList {
@@ -80,7 +80,6 @@ typedef struct BASIC_PassList {
 	struct DRWPass *depth_pass_cull;
 #endif
 	struct DRWPass *color_pass;
-	struct g_data *g_data;
 } BASIC_PassList;
 
 typedef struct BASIC_Data {
@@ -102,13 +101,13 @@ static struct {
 	struct GPUShader *color_sh;
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct BASIC_PrivateData {
 #ifdef USE_DEPTH
 	DRWShadingGroup *depth_shgrp;
 	DRWShadingGroup *depth_shgrp_cull;
 #endif
 	DRWShadingGroup *color_shgrp;
-} g_data; /* Transient data */
+} BASIC_PrivateData; /* Transient data */
 
 /* Functions */
 
@@ -152,7 +151,7 @@ static void BASIC_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 #ifdef USE_DEPTH
diff --git a/source/blender/draw/engines/clay/clay_engine.c b/source/blender/draw/engines/clay/clay_engine.c
index d387adb9054..7266df2500d 100644
--- a/source/blender/draw/engines/clay/clay_engine.c
+++ b/source/blender/draw/engines/clay/clay_engine.c
@@ -76,7 +76,7 @@ typedef struct CLAY_Storage {
 typedef struct CLAY_StorageList {
 	struct CLAY_Storage *storage;
 	struct GPUUniformBuffer *mat_ubo;
-	struct g_data *g_data;
+	struct CLAY_PrivateData *g_data;
 } CLAY_StorageList;
 
 typedef struct CLAY_FramebufferList {
@@ -98,7 +98,6 @@ typedef struct CLAY_PassList {
 	struct DRWPass *depth_pass;
 	struct DRWPass *depth_pass_cull;
 	struct DRWPass *clay_pass;
-	struct g_data *g_data;
 } CLAY_PassList;
 
 typedef struct CLAY_Data {
@@ -133,14 +132,14 @@ static struct {
 	int ubo_mat_idxs[MAX_CLAY_MAT];
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct CLAY_PrivateData {
 	DRWShadingGroup *depth_shgrp;
 	DRWShadingGroup *depth_shgrp_select;
 	DRWShadingGroup *depth_shgrp_active;
 	DRWShadingGroup *depth_shgrp_cull;
 	DRWShadingGroup *depth_shgrp_cull_select;
 	DRWShadingGroup *depth_shgrp_cull_active;
-} g_data; /* Transient data */
+} CLAY_PrivateData; /* Transient data */
 
 /* Functions */
 
@@ -541,7 +540,7 @@ static void CLAY_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	/* Depth Pass */
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index 6868a2be36c..6fa99b37ced 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -351,7 +351,7 @@ static void EEVEE_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	{
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index 02dc32ddd9a..ee8e8598725 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -89,7 +89,7 @@ typedef struct EEVEE_StorageList {
 	struct EEVEE_ProbesInfo *probes;
 	struct GPUUniformBuffer *probe_ubo;
 
-	struct g_data *g_data;
+	struct EEVEE_PrivateData *g_data;
 } EEVEE_StorageList;
 
 /* ************ LIGHT UBO ************* */
@@ -173,7 +173,7 @@ typedef struct EEVEE_LampEngineData {
 	void *pad;
 } EEVEE_LampEngineData;
 
-typedef struct g_data{
+typedef struct EEVEE_PrivateData {
 	struct DRWShadingGroup *default_lit_grp;
 	struct DRWShadingGroup *material_lit_grp;
 	struct DRWShadingGroup *shadow_shgrp;
@@ -181,7 +181,7 @@ typedef struct g_data{
 	struct DRWShadingGroup *depth_shgrp_cull;
 
 	struct ListBase lamps; /* Lamps gathered during cache iteration */
-} g_data; /* Transient data */
+} EEVEE_PrivateData; /* Transient data */
 
 /* eevee_lights.c */
 void EEVEE_lights_init(EEVEE_StorageList *stl);
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index 68e3112f03b..19b8262a74e 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -42,7 +42,7 @@ typedef struct EDIT_ARMATURE_PassList {
 } EDIT_ARMATURE_PassList;
 
 typedef struct EDIT_ARMATURE_StorageList {
-	struct g_data *g_data;
+	struct EDIT_ARMATURE_PrivateData *g_data;
 } EDIT_ARMATURE_StorageList;
 
 typedef struct EDIT_ARMATURE_Data {
@@ -55,9 +55,9 @@ typedef struct EDIT_ARMATURE_Data {
 
 /* *********** STATIC *********** */
 
-typedef struct g_data {
+typedef struct EDIT_ARMATURE_PrivateData {
 	DRWShadingGroup *relationship_lines;
-} g_data; /* Transient data */
+} EDIT_ARMATURE_PrivateData; /* Transient data */
 
 /* *********** FUNCTIONS *********** */
 
@@ -68,7 +68,7 @@ static void EDIT_ARMATURE_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	{
diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c
index f2834bfb0ec..7cdaf7c50e6 100644
--- a/source/blender/draw/modes/edit_curve_mode.c
+++ b/source/blender/draw/modes/edit_curve_mode.c
@@ -85,7 +85,7 @@ typedef struct EDIT_CURVE_StorageList {
 	 * free with MEM_freeN() when viewport is freed.
 	 * (not per object) */
 	struct CustomStruct *block;
-	struct g_data *g_data;
+	struct EDIT_CURVE_PrivateData *g_data;
 } EDIT_CURVE_StorageList;
 
 typedef struct EDIT_CURVE_Data {
@@ -114,7 +114,7 @@ static struct {
 
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct EDIT_CURVE_PrivateData {
 	/* This keeps the references of the shading groups for
 	 * easy access in EDIT_CURVE_cache_populate() */
 
@@ -123,7 +123,7 @@ typedef struct g_data {
 
 	DRWShadingGroup *overlay_edge_shgrp;
 	DRWShadingGroup *overlay_vert_shgrp;
-} g_data; /* Transient data */
+} EDIT_CURVE_PrivateData; /* Transient data */
 
 /* *********** FUNCTIONS *********** */
 
@@ -178,7 +178,7 @@ static void EDIT_CURVE_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	{
diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c
index 61c01fb3f48..32411ea470d 100644
--- a/source/blender/draw/modes/edit_lattice_mode.c
+++ b/source/blender/draw/modes/edit_lattice_mode.c
@@ -81,7 +81,7 @@ typedef struct EDIT_LATTICE_StorageList {
 	 * free with MEM_freeN() when viewport is freed.
 	 * (not per object) */
 	struct CustomStruct *block;
-	struct g_data *g_data;
+	struct EDIT_LATTICE_PrivateData *g_data;
 } EDIT_LATTICE_StorageList;
 
 typedef struct EDIT_LATTICE_Data {
@@ -108,12 +108,12 @@ static struct {
 
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct EDIT_LATTICE_PrivateData {
 	/* This keeps the references of the shading groups for
 	 * easy access in EDIT_LATTICE_cache_populate() */
 	DRWShadingGroup *wire_shgrp;
 	DRWShadingGroup *vert_shgrp;
-} g_data; /* Transient data */
+} EDIT_LATTICE_PrivateData; /* Transient data */
 
 /* *********** FUNCTIONS *********** */
 
@@ -164,7 +164,7 @@ static void EDIT_LATTICE_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	{
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c
index 9fe9eef0682..4b5c9009b72 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -73,7 +73,7 @@ typedef struct EDIT_MESH_TextureList {
 } EDIT_MESH_TextureList;
 
 typedef struct EDIT_MESH_StorageList {
-	struct g_data *g_data;
+	struct EDIT_MESH_PrivateData *g_data;
 } EDIT_MESH_StorageList;
 
 typedef struct EDIT_MESH_Data {
@@ -102,7 +102,7 @@ static struct {
 	GPUShader *depth_sh;
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct EDIT_MESH_PrivateData {
 	DRWShadingGroup *depth_shgrp_hidden_wire;
 
 	DRWShadingGroup *fnormals_shgrp;
@@ -120,7 +120,7 @@ typedef struct g_data {
 	DRWShadingGroup *facedot_occluded_shgrp;
 	DRWShadingGroup *facefill_occluded_shgrp;
 
-} g_data; /* Transient data */
+} EDIT_MESH_PrivateData; /* Transient data */
 
 /* *********** FUNCTIONS *********** */
 
@@ -298,7 +298,7 @@ static void EDIT_MESH_cache_init(void *vedata)
 
 	if (!stl->g_data) {
 		/* Alloc transient pointers */
-		stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
+		stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
 	}
 
 	{
diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c
index b432d610d1b..3bf26ae7adf 100644
--- a/source/blender/draw/modes/edit_metaball_mode.c
+++ b/source/blender/draw/modes/edit_metaball_mode.c
@@ -72,7 +72,7 @@ typedef struct EDIT_METABALL_StorageList {
 	 * free with MEM_freeN() when viewport is freed.
 	 * (not per object) */
 	struct CustomStruct *block;
-	struct g_data *g_data;
+	struct EDIT_METABALL_PrivateData *g_data;
 } EDIT_METABALL_StorageList;
 
 typedef struct EDIT_METABALL_Data {
@@ -96,11 +96,11 @@ static struct {
 	struct GPUShader *custom_shader;
 } e_data = {NULL}; /* Engine data */
 
-typedef struct g_data {
+typedef struct EDIT_METABALL_PrivateData {
 	/* This keeps the references of the shading groups for
 	 * easy access in EDIT_METABALL_cache_populate() */
 	DRWS

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list