diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-08-04 18:17:58 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-08-05 15:45:09 +0300 |
commit | 897aa777c53439d67401b4ae3d567394a80f8be7 (patch) | |
tree | 27018cd87f514c8f4988068e1fb85866de89f6b7 /source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc | |
parent | 49d85dc8b5d8056b226a33dfe01b7af0e4067ee1 (diff) |
EEVEE-Next: Depth Of Field: Fix glitch on foreground scattered bokeh
This was caused by a missing synchronization.
The background gather pass was writting to the same occlusion texture
before the end of the scatter draw.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc b/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc index de99a83b993..e3db4a7f0ef 100644 --- a/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc +++ b/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc @@ -430,6 +430,10 @@ void DepthOfField::scatter_pass_sync() DRW_shgroup_uniform_texture_ref(grp, "bokeh_lut_tx", &bokeh_scatter_lut_tx_); DRW_shgroup_uniform_texture_ref(grp, "occlusion_tx", &occlusion_tx_); DRW_shgroup_call_procedural_indirect(grp, GPU_PRIM_TRI_STRIP, nullptr, scatter_buf); + if (pass == 0) { + /* Avoid background gather pass writing to the occlusion_tx mid pass. */ + DRW_shgroup_barrier(grp, GPU_BARRIER_SHADER_IMAGE_ACCESS); + } } } |