diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-07-22 21:32:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-07-22 21:32:17 +0300 |
commit | 676a2f690c3e3fffe2e515208d4d308e0a96e8e6 (patch) | |
tree | 1bd40c9540c5f3ca2631666ebd910fe0132fa2a2 /source/blender/draw/engines/eevee_next/eevee_film.cc | |
parent | 35843ddcd80e5957656b157650da950f228d2808 (diff) |
EEVEE-Next: Fix render not working
The swaps during accumulation were ignored because of the way the
`SwapChain<>` implementation works.
Using external references and updating them fixes the issue.
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_film.cc')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_film.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_film.cc b/source/blender/draw/engines/eevee_next/eevee_film.cc index d3b09beedaa..486413a0834 100644 --- a/source/blender/draw/engines/eevee_next/eevee_film.cc +++ b/source/blender/draw/engines/eevee_next/eevee_film.cc @@ -393,10 +393,10 @@ void Film::sync() /* NOTE(@fclem): 16 is the max number of sampled texture in many implementations. * If we need more, we need to pack more of the similar passes in the same textures as arrays or * use image binding instead. */ - DRW_shgroup_uniform_image_ref(grp, "in_weight_img", &weight_tx_.current()); - DRW_shgroup_uniform_image_ref(grp, "out_weight_img", &weight_tx_.next()); - DRW_shgroup_uniform_texture_ref_ex(grp, "in_combined_tx", &combined_tx_.current(), filter); - DRW_shgroup_uniform_image_ref(grp, "out_combined_img", &combined_tx_.next()); + DRW_shgroup_uniform_image_ref(grp, "in_weight_img", &weight_src_tx_); + DRW_shgroup_uniform_image_ref(grp, "out_weight_img", &weight_dst_tx_); + DRW_shgroup_uniform_texture_ref_ex(grp, "in_combined_tx", &combined_src_tx_, filter); + DRW_shgroup_uniform_image_ref(grp, "out_combined_img", &combined_dst_tx_); DRW_shgroup_uniform_image_ref(grp, "depth_img", &depth_tx_); DRW_shgroup_uniform_image_ref(grp, "color_accum_img", &color_accum_tx_); DRW_shgroup_uniform_image_ref(grp, "value_accum_img", &value_accum_tx_); @@ -541,6 +541,12 @@ void Film::accumulate(const DRWView *view) update_sample_table(); + /* Need to update the static references as there could have change from a previous swap. */ + weight_src_tx_ = weight_tx_.current(); + weight_dst_tx_ = weight_tx_.next(); + combined_src_tx_ = combined_tx_.current(); + combined_dst_tx_ = combined_tx_.next(); + data_.display_only = false; data_.push_update(); @@ -567,6 +573,12 @@ void Film::display() GPU_framebuffer_bind(dfbl->default_fb); GPU_framebuffer_viewport_set(dfbl->default_fb, UNPACK2(data_.offset), UNPACK2(data_.extent)); + /* Need to update the static references as there could have change from a previous swap. */ + weight_src_tx_ = weight_tx_.current(); + weight_dst_tx_ = weight_tx_.next(); + combined_src_tx_ = combined_tx_.current(); + combined_dst_tx_ = combined_tx_.next(); + data_.display_only = true; data_.push_update(); |