[Bf-blender-cvs] [5a6ec0f0035] master: Build: Enable unity build for `bf_compositor`

Aaron Carlisle noreply at git.blender.org
Tue Jan 11 22:55:51 CET 2022


Commit: 5a6ec0f0035b6bb8a75b18826f4d0f687ec5ec21
Author: Aaron Carlisle
Date:   Tue Jan 11 16:55:18 2022 -0500
Branches: master
https://developer.blender.org/rB5a6ec0f0035b6bb8a75b18826f4d0f687ec5ec21

Build: Enable unity build for `bf_compositor`

Blender's compositor code already makes extensive use of
namespace which makes it very simple to enable unity build.
There was one duplicated function that has since to be moved
to a common header.

I saw roughly a 3x speedup of bf_compositor using ninja on
linux using i5 8250u (1:34 down to 0:34).

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D13792

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

M	source/blender/compositor/CMakeLists.txt

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

diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt
index af8ba0a24a5..88ce9b88097 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -645,6 +645,11 @@ endif()
 
 blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
+if(WITH_UNITY_BUILD)
+  set_target_properties(bf_compositor PROPERTIES UNITY_BUILD ON)
+  set_target_properties(bf_compositor PROPERTIES UNITY_BUILD_BATCH_SIZE 10)
+endif()
+
 if(COMMAND target_precompile_headers)
   target_precompile_headers(bf_compositor PRIVATE COM_precomp.h)
 endif()



More information about the Bf-blender-cvs mailing list