[Bf-blender-cvs] [1a866d5] master: Fix crash with computers not supporting high quality depth of field.

Antony Riakiotakis noreply at git.blender.org
Wed Mar 25 14:43:42 CET 2015


Commit: 1a866d55acce90406e6430f85f3d88335c4f686d
Author: Antony Riakiotakis
Date:   Wed Mar 25 14:43:28 2015 +0100
Branches: master
https://developer.blender.org/rB1a866d55acce90406e6430f85f3d88335c4f686d

Fix crash with computers not supporting high quality depth of field.

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

M	source/blender/gpu/intern/gpu_compositing.c

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

diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 6a7805b..f850b6f 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -390,7 +390,12 @@ bool GPU_fx_compositor_initialize_passes(
 
 	/* create textures for dof effect */
 	if (fx_flag & GPU_FX_FLAG_DOF) {
-		bool dof_high_quality = (fx_settings->dof->high_quality != 0);
+		bool dof_high_quality = (fx_settings->dof->high_quality != 0) &&
+								GPU_geometry_shader_support() && GPU_instanced_drawing_support();
+
+		/* cleanup buffers if quality setting has changed (no need to keep more buffers around than necessary ) */
+		if (dof_high_quality != fx->dof_high_quality)
+			cleanup_fx_dof_buffers(fx);
 
 		if (dof_high_quality) {
 			fx->dof_downsampled_w = w / 2;
@@ -469,7 +474,7 @@ bool GPU_fx_compositor_initialize_passes(
 			}
 		}
 
-		fx->dof_high_quality = dof_high_quality && GPU_geometry_shader_support() && GPU_instanced_drawing_support();
+		fx->dof_high_quality = dof_high_quality;
 	}
 	else {
 		/* cleanup unnecessary buffers */




More information about the Bf-blender-cvs mailing list