diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-03-25 16:43:28 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-03-25 16:43:28 +0300 |
commit | 1a866d55acce90406e6430f85f3d88335c4f686d (patch) | |
tree | 4c495f1ceb169ae9d98d4afe54d9939d92216bf4 /source | |
parent | 1c329af74cb2720fbb2e24a58ae15046d5c5c957 (diff) |
Fix crash with computers not supporting high quality depth of field.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_compositing.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 6a7805bb614..f850b6fcc55 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 */ |