EEVEE-Next: Cleanup: Remove static references for swapchains

Those are no longer necessary.
This commit is contained in:
Clément Foucault
2022-07-30 17:47:53 +02:00
parent 335dbccc33
commit 2ea4754109
2 changed files with 7 additions and 24 deletions

View File

@@ -403,10 +403,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_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, "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, "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_);
@@ -563,12 +563,6 @@ void Film::accumulate(const DRWView *view, GPUTexture *combined_final_tx)
combined_final_tx_ = combined_final_tx;
/* 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();
@@ -597,12 +591,6 @@ void Film::display()
combined_final_tx_ = inst_.render_buffers.combined_tx;
/* 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();

View File

@@ -40,6 +40,9 @@ class Film {
private:
Instance &inst_;
/** Incomming combined buffer with post fx applied (motion blur + depth of field). */
GPUTexture *combined_final_tx_ = nullptr;
/** Main accumulation textures containing every render-pass except depth and combined. */
Texture color_accum_tx_;
Texture value_accum_tx_;
@@ -47,16 +50,8 @@ class Film {
Texture depth_tx_;
/** Combined "Color" buffer. Double buffered to allow re-projection. */
SwapChain<Texture, 2> combined_tx_;
/** Static reference as SwapChain does not actually move the objects when swapping. */
GPUTexture *combined_src_tx_ = nullptr;
GPUTexture *combined_dst_tx_ = nullptr;
/** Incomming combined buffer with post fx applied (motion blur + depth of field). */
GPUTexture *combined_final_tx_ = nullptr;
/** Weight buffers. Double buffered to allow updating it during accumulation. */
SwapChain<Texture, 2> weight_tx_;
/** Static reference as SwapChain does not actually move the objects when swapping. */
GPUTexture *weight_src_tx_ = nullptr;
GPUTexture *weight_dst_tx_ = nullptr;
/** User setting to disable reprojection. Useful for debugging or have a more precise render. */
bool force_disable_reprojection_ = false;