[Bf-blender-cvs] [eedd9b7] viewport_experiments: Comment out DOF initialization, its not used

Campbell Barton noreply at git.blender.org
Thu Feb 12 18:18:31 CET 2015


Commit: eedd9b70b6bf6e1c0ee7acc84aa247e60ef71954
Author: Campbell Barton
Date:   Fri Feb 13 04:17:50 2015 +1100
Branches: viewport_experiments
https://developer.blender.org/rBeedd9b70b6bf6e1c0ee7acc84aa247e60ef71954

Comment out DOF initialization, its not used

This is a special case

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

M	source/blender/blenkernel/BKE_screen.h
M	source/blender/blenkernel/intern/screen.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/makesdna/DNA_gpu_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index af8948e..29590c5 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -295,7 +295,7 @@ void BKE_screen_view3d_scene_sync(struct bScreen *sc);
 void BKE_screen_view3d_main_sync(ListBase *screen_lb, struct Scene *scene);
 void BKE_screen_view3d_twmode_remove(struct View3D *v3d, const int i);
 void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, struct Scene *scene, const int i);
-void BKE_screen_gpu_validate_fx(struct GPUFXSettings *fx_settings);
+void BKE_screen_gpu_fx_validate(struct GPUFXSettings *fx_settings);
 
 /* zoom factor conversion */
 float BKE_screen_view3d_zoom_to_fac(float camzoom);
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 2679bd1..7218625 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -599,15 +599,18 @@ float BKE_screen_view3d_zoom_from_fac(float zoomfac)
 	return ((sqrtf(4.0f * zoomfac) - (float)M_SQRT2) * 50.0f);
 }
 
-void BKE_screen_gpu_validate_fx(GPUFXSettings *fx_settings)
+void BKE_screen_gpu_fx_validate(GPUFXSettings *fx_settings)
 {
+	/* currently we use DOF from the camera _only_,
+	 * so we never allocate this, only copy from the Camera */
+#if 0
 	if ((fx_settings->dof == NULL) &&
 	    (fx_settings->fx_flag & GPU_FX_FLAG_DOF))
 	{
 		GPUDOFSettings *fx_dof;
 		fx_dof = fx_settings->dof = MEM_callocN(sizeof(GPUDOFSettings), __func__);
-		(void)fx_dof;
 	}
+#endif
 
 	if ((fx_settings->ssao == NULL) &&
 	    (fx_settings->fx_flag & GPU_FX_FLAG_SSAO))
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 49bd9c5..85d70ea 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3518,7 +3518,7 @@ static void view3d_main_area_draw_objects(const bContext *C, Scene *scene, View3
 	/* framebuffer fx needed, we need to draw offscreen first */
 	if (v3d->fx_settings.fx_flag) {
 		GPUFXSettings fx_settings;
-		BKE_screen_gpu_validate_fx(&v3d->fx_settings);
+		BKE_screen_gpu_fx_validate(&v3d->fx_settings);
 		fx_settings = v3d->fx_settings;
 		if (!rv3d->compositor)
 			rv3d->compositor = GPU_fx_compositor_create();
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 766a1fe..2b362dc 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -51,13 +51,12 @@ typedef struct GPUSSAOSettings {
 } GPUSSAOSettings;
 
 typedef struct GPUFXSettings {
-	GPUDOFSettings *dof;
+	GPUDOFSettings *dof;  /* note, currently not allocated, instead set from camera */
 	GPUSSAOSettings *ssao;
 	char fx_flag;  /* eGPUFXFlags */
 	char pad[7];
 } GPUFXSettings;
 
-
 /* shaderfx enables */
 typedef enum eGPUFXFlags {
 	GPU_FX_FLAG_DOF         = (1 << 0),
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 259546f..fbd27c3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1711,7 +1711,7 @@ static void rna_GPUFXSettings_fx_update(Main *UNUSED(bmain), Scene *UNUSED(scene
 {
 	GPUFXSettings *fx_settings = ptr->data;
 
-	BKE_screen_gpu_validate_fx(fx_settings);
+	BKE_screen_gpu_fx_validate(fx_settings);
 }
 
 #else




More information about the Bf-blender-cvs mailing list