[Bf-blender-cvs] [7507432ccfa] greasepencil-object: Cleanup: Remove unused total shaders fields

Antonio Vazquez noreply at git.blender.org
Sat May 12 17:28:32 CEST 2018


Commit: 7507432ccfaa7e4faa37d52e4c95dc6881cd6e57
Author: Antonio Vazquez
Date:   Sat May 12 17:28:23 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB7507432ccfaa7e4faa37d52e4c95dc6881cd6e57

Cleanup: Remove unused total shaders fields

These fields were added to debug the nuber of shading groups created and to be sure all was removed.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index f03128cdd46..45ad52c3afa 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -259,8 +259,6 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data,
 
 	/* e_data.gpencil_fill_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	stl->g_data->tot_sh++;
-	stl->g_data->tot_sh_fill++;
 
 	DRW_shgroup_uniform_vec4(grp, "color2", gp_style->scolor, 1);
 	stl->shgroups[id].fill_style = gp_style->fill_style;
@@ -328,10 +326,6 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_e_data *e_data, GPENC
 
 	/* e_data.gpencil_stroke_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	stl->g_data->tot_sh++;
-	if (id != -1) {
-		stl->g_data->tot_sh_stroke++;
-	}
 
 	DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
 
@@ -423,8 +417,6 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_e_data *e_data,
 
 	/* e_data.gpencil_stroke_sh */
 	DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-	stl->g_data->tot_sh++;
-	stl->g_data->tot_sh_point++;
 
 	DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
 	DRW_shgroup_uniform_float(grp, "pixsize", stl->storage->pixsize, 1);
@@ -800,13 +792,11 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
 		if ((src_gps) && (!playing) && (!is_render)) {
 			if (!stl->g_data->shgrps_edit_line) {
 				stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
-				stl->g_data->tot_sh++;
 			}
 			if (!stl->g_data->shgrps_edit_point) {
 				stl->g_data->shgrps_edit_point = DRW_shgroup_create(e_data->gpencil_edit_point_sh, psl->edit_pass);
 				const float *viewport_size = DRW_viewport_size_get();
 				DRW_shgroup_uniform_vec2(stl->g_data->shgrps_edit_point, "Viewport", viewport_size, 1);
-				stl->g_data->tot_sh++;
 			}
 
 			gpencil_add_editpoints_shgroup(stl, cache, ts, ob, gpd, gpl, derived_gpf, src_gps);
@@ -878,7 +868,6 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
 						gpd->sfill[3] = 0.5f;
 					}
 					stl->g_data->shgrps_drawing_fill = DRW_shgroup_create(e_data->gpencil_drawing_fill_sh, psl->drawing_pass);
-					stl->g_data->tot_sh++;
 					stl->g_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd);
 					DRW_shgroup_call_add(stl->g_data->shgrps_drawing_fill, stl->g_data->batch_buffer_fill, stl->storage->unit_matrix);
 				}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index a7b2dfc7e1c..24aa29bc712 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -216,7 +216,6 @@ void GPENCIL_cache_init(void *vedata)
 	Scene *scene = draw_ctx->scene;
 	ToolSettings *ts = scene->toolsettings;
 	View3D *v3d = draw_ctx->v3d;
-	// RegionView3D *rv3d = draw_ctx->rv3d;
 
 	/* Special handling for when active object is GP object (e.g. for draw mode) */
 	Object *obact = draw_ctx->obact;
@@ -234,11 +233,6 @@ void GPENCIL_cache_init(void *vedata)
 		stl->storage->xray = GP_XRAY_FRONT; /* used for drawing */
 		stl->storage->stroke_style = GP_STYLE_STROKE_STYLE_SOLID; /* used for drawing */
 	}
-	/* reset total shading groups */
-	stl->g_data->tot_sh = 0;
-	stl->g_data->tot_sh_stroke = 0;
-	stl->g_data->tot_sh_fill = 0;
-	stl->g_data->tot_sh_point = 0;
 	stl->storage->tonemapping = 0;
 
 	stl->g_data->shgrps_edit_line = NULL;
@@ -339,7 +333,6 @@ void GPENCIL_cache_init(void *vedata)
 		struct Gwn_Batch *quad = DRW_cache_fullscreen_quad_get();
 		psl->mix_pass = DRW_pass_create("GPencil Mix Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
 		DRWShadingGroup *mix_shgrp = DRW_shgroup_create(e_data.gpencil_fullscreen_sh, psl->mix_pass);
-		stl->g_data->tot_sh++;
 		DRW_shgroup_call_add(mix_shgrp, quad, NULL);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp, "strokeColor", &e_data.input_color_tx);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp, "strokeDepth", &e_data.input_depth_tx);
@@ -348,7 +341,6 @@ void GPENCIL_cache_init(void *vedata)
 		/* mix pass no blend */
 		psl->mix_pass_noblend = DRW_pass_create("GPencil Mix Pass no blend", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
 		DRWShadingGroup *mix_shgrp_noblend = DRW_shgroup_create(e_data.gpencil_fullscreen_sh, psl->mix_pass_noblend);
-		stl->g_data->tot_sh++;
 		DRW_shgroup_call_add(mix_shgrp_noblend, quad, NULL);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp_noblend, "strokeColor", &e_data.temp_color_tx_a);
 		DRW_shgroup_uniform_texture_ref(mix_shgrp_noblend, "strokeDepth", &e_data.temp_depth_tx_a);
@@ -357,7 +349,6 @@ void GPENCIL_cache_init(void *vedata)
 		/* Painting session pass (used only to speedup while the user is drawing ) */
 		psl->painting_pass = DRW_pass_create("GPencil Painting Session Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS);
 		DRWShadingGroup *painting_shgrp = DRW_shgroup_create(e_data.gpencil_painting_sh, psl->painting_pass);
-		stl->g_data->tot_sh++;
 		DRW_shgroup_call_add(painting_shgrp, quad, NULL);
 		DRW_shgroup_uniform_texture_ref(painting_shgrp, "strokeColor", &e_data.painting_color_tx);
 		DRW_shgroup_uniform_texture_ref(painting_shgrp, "strokeDepth", &e_data.painting_depth_tx);
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 6c8b12ecc91..e522a7daf18 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -171,11 +171,6 @@ typedef struct g_data {
 
 	int session_flag;
 
-	/* number of shading groups */
-	int tot_sh;         /* total shading groups */
-	int tot_sh_stroke;  /* total strokes groups */
-	int tot_sh_fill;    /* total fill groups */
-	int tot_sh_point;   /* total point groups */
 } g_data; /* Transient data */
 
 /* flags for fast drawing support */



More information about the Bf-blender-cvs mailing list