[Bf-blender-cvs] [87fe1e5af23] greasepencil-object: Cleanup: Remove intermediate variable for Wsize

Antonio Vazquez noreply at git.blender.org
Sun Dec 10 09:24:25 CET 2017


Commit: 87fe1e5af233d33e0187590cf0a6307f2a19e934
Author: Antonio Vazquez
Date:   Sun Dec 10 09:24:14 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB87fe1e5af233d33e0187590cf0a6307f2a19e934

Cleanup: Remove intermediate variable for Wsize

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index b40562c5f57..740a81bac6a 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -95,17 +95,14 @@ typedef struct GPencilVFXWave {
 	float amplitude;
 	float period;
 	float phase;
-	float wsize[2];
 } GPencilVFXWave;
 
 typedef struct GPencilVFXFlip {
 	float flipmode[2]; /* use float to pass to shader, but only will be 0 or 1 */
-	float wsize[2];
 } GPencilVFXFlip;
 
 typedef struct GPencilVFXLight {
 	float loc[4];
-	float wsize[2];
 	float energy;
 	float ambient;
 	float specular;
diff --git a/source/blender/draw/engines/gpencil/gpencil_vfx.c b/source/blender/draw/engines/gpencil/gpencil_vfx.c
index 28c33310854..35f60aa47f7 100644
--- a/source/blender/draw/engines/gpencil/gpencil_vfx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_vfx.c
@@ -133,9 +133,6 @@ static void DRW_gpencil_vfx_wave(
 	stl->vfx[ob_idx].vfx_wave.phase = mmd->phase;
 	stl->vfx[ob_idx].vfx_wave.orientation = mmd->orientation;
 
-	const float *viewport_size = DRW_viewport_size_get();
-	copy_v2_v2(stl->vfx[ob_idx].vfx_wave.wsize, viewport_size);
-
 	struct Gwn_Batch *vfxquad = DRW_cache_fullscreen_quad_get();
 
 	DRWShadingGroup *vfx_shgrp = DRW_shgroup_create(e_data->gpencil_vfx_wave_sh, psl->vfx_wave_pass);
@@ -148,7 +145,7 @@ static void DRW_gpencil_vfx_wave(
 	DRW_shgroup_uniform_float(vfx_shgrp, "period", &stl->vfx[ob_idx].vfx_wave.period, 1);
 	DRW_shgroup_uniform_float(vfx_shgrp, "phase", &stl->vfx[ob_idx].vfx_wave.phase, 1);
 	DRW_shgroup_uniform_int(vfx_shgrp, "orientation", &stl->vfx[ob_idx].vfx_wave.orientation, 1);
-	DRW_shgroup_uniform_vec2(vfx_shgrp, "wsize", stl->vfx[ob_idx].vfx_wave.wsize, 1);
+	DRW_shgroup_uniform_vec2(vfx_shgrp, "wsize", DRW_viewport_size_get(), 1);
 
 	/* set first effect sh */
 	if (cache->init_vfx_wave_sh == NULL) {
@@ -383,9 +380,7 @@ static void DRW_gpencil_vfx_flip(
 	DRW_shgroup_uniform_buffer(vfx_shgrp, "strokeDepth", &e_data->vfx_fbcolor_depth_tx_a);
 	DRW_shgroup_uniform_vec2(vfx_shgrp, "mode", &stl->vfx[ob_idx].vfx_flip.flipmode[0], 1);
 
-	const float *viewport_size = DRW_viewport_size_get();
-	copy_v2_v2(stl->vfx[ob_idx].vfx_flip.wsize, viewport_size);
-	DRW_shgroup_uniform_vec2(vfx_shgrp, "wsize", stl->vfx[ob_idx].vfx_flip.wsize, 1);
+	DRW_shgroup_uniform_vec2(vfx_shgrp, "wsize", DRW_viewport_size_get(), 1);
 
 	/* set first effect sh */
 	if (cache->init_vfx_flip_sh == NULL) {
@@ -449,9 +444,7 @@ static void DRW_gpencil_vfx_light(
 	DRW_shgroup_uniform_buffer(vfx_shgrp, "strokeColor", &e_data->vfx_fbcolor_color_tx_a);
 	DRW_shgroup_uniform_buffer(vfx_shgrp, "strokeDepth", &e_data->vfx_fbcolor_depth_tx_a);
 
-	const float *viewport_size = DRW_viewport_size_get();
-	copy_v2_v2(stl->vfx[ob_idx].vfx_light.wsize, viewport_size);
-	DRW_shgroup_uniform_vec2(vfx_shgrp, "Viewport", stl->vfx[ob_idx].vfx_light.wsize, 1);
+	DRW_shgroup_uniform_vec2(vfx_shgrp, "Viewport", DRW_viewport_size_get(), 1);
 
 	/* location of the light using obj location as origin */
 	copy_v3_v3(stl->vfx[ob_idx].vfx_light.loc, &mmd->object->loc[0]);



More information about the Bf-blender-cvs mailing list