[Bf-blender-cvs] [429bb7a4fd4] tmp-workbench-rewrite2: Always pass DrawConfig by referece

Miguel Pozo noreply at git.blender.org
Mon Oct 31 16:29:51 CET 2022


Commit: 429bb7a4fd49fba0b521fdfe8a82a28d2dc74585
Author: Miguel Pozo
Date:   Mon Oct 31 12:28:49 2022 +0100
Branches: tmp-workbench-rewrite2
https://developer.blender.org/rB429bb7a4fd49fba0b521fdfe8a82a28d2dc74585

Always pass DrawConfig by referece

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

M	source/blender/draw/engines/workbench/workbench_mesh_passes.cc
M	source/blender/draw/engines/workbench/workbench_private.hh

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

diff --git a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc
index f45cb2a5132..6e27e8df94e 100644
--- a/source/blender/draw/engines/workbench/workbench_mesh_passes.cc
+++ b/source/blender/draw/engines/workbench/workbench_mesh_passes.cc
@@ -86,7 +86,7 @@ PassMain::Sub &MeshPass::sub_pass_get(ObjectRef &ref,
   return *passes_[static_cast<int>(geometry_type)][static_cast<int>(eColorType::MATERIAL)];
 }
 
-void OpaquePass::sync(const DrawConfig config, SceneResources &resources)
+void OpaquePass::sync(const DrawConfig &config, SceneResources &resources)
 {
   DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
                    config.cull_state | config.clip_state;
@@ -164,7 +164,7 @@ bool OpaquePass::is_empty() const
   return gbuffer_ps_.is_empty() && gbuffer_in_front_ps_.is_empty();
 }
 
-void TransparentPass::sync(const DrawConfig config, SceneResources &resources)
+void TransparentPass::sync(const DrawConfig &config, SceneResources &resources)
 {
   DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_OIT |
                    config.cull_state | config.clip_state;
@@ -232,7 +232,7 @@ bool TransparentPass::is_empty() const
   return accumulation_ps_.is_empty() && accumulation_in_front_ps_.is_empty();
 }
 
-void TransparentDepthPass::sync(const DrawConfig config, SceneResources &resources)
+void TransparentDepthPass::sync(const DrawConfig &config, SceneResources &resources)
 {
   DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
                    config.cull_state | config.clip_state;
diff --git a/source/blender/draw/engines/workbench/workbench_private.hh b/source/blender/draw/engines/workbench/workbench_private.hh
index c8d3e433c72..7fc5222edeb 100644
--- a/source/blender/draw/engines/workbench/workbench_private.hh
+++ b/source/blender/draw/engines/workbench/workbench_private.hh
@@ -187,7 +187,7 @@ class OpaquePass {
   MeshPass gbuffer_in_front_ps_ = {"Opaque.GbufferInFront"};
   PassSimple deferred_ps_ = {"Opaque.Deferred"};
 
-  void sync(const DrawConfig config, SceneResources &resources);
+  void sync(const DrawConfig &config, SceneResources &resources);
 
   void draw(Manager &manager, View &view, SceneResources &resources, int2 resolution);
 
@@ -205,7 +205,7 @@ class TransparentPass {
   PassSimple resolve_ps_ = {"Transparent.Resolve"};
   Framebuffer resolve_fb;
 
-  void sync(const DrawConfig config, SceneResources &resources);
+  void sync(const DrawConfig &config, SceneResources &resources);
 
   void draw(Manager &manager, View &view, SceneResources &resources, int2 resolution);
 
@@ -221,7 +221,7 @@ class TransparentDepthPass {
   PassSimple merge_ps_ = {"TransparentDepth.Merge"};
   Framebuffer merge_fb = {"TransparentDepth.Merge"};
 
-  void sync(const DrawConfig config, SceneResources &resources);
+  void sync(const DrawConfig &config, SceneResources &resources);
 
   void draw(Manager &manager, View &view, SceneResources &resources, int2 resolution);



More information about the Bf-blender-cvs mailing list