[Bf-blender-cvs] [6c4210b97ba] master: Draw: Add missing TBB define to draw module

Hans Goudey noreply at git.blender.org
Wed Oct 12 23:51:47 CEST 2022


Commit: 6c4210b97bab2c704e3586c67131d65b5b5a0c97
Author: Hans Goudey
Date:   Wed Oct 12 16:51:29 2022 -0500
Branches: master
https://developer.blender.org/rB6c4210b97bab2c704e3586c67131d65b5b5a0c97

Draw: Add missing TBB define to draw module

Allows improving performance with BLI_task.hh in draw extraction code.
Threading added in c15a63d21eae49ffd improved performance by 3-4x
for me, but didn't make a difference until now.

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

M	source/blender/draw/CMakeLists.txt

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

diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index bfccc22899d..a645bd6b6af 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -731,6 +731,21 @@ if(WITH_GTESTS)
   endif()
 endif()
 
+if(WITH_TBB)
+  add_definitions(-DWITH_TBB)
+  if(WIN32)
+    # TBB includes Windows.h which will define min/max macros
+    # that will collide with the stl versions.
+    add_definitions(-DNOMINMAX)
+  endif()
+  list(APPEND INC_SYS
+    ${TBB_INCLUDE_DIRS}
+  )
+
+  list(APPEND LIB
+    ${TBB_LIBRARIES}
+  )
+endif()
 
 blender_add_lib(bf_draw "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
@@ -756,3 +771,4 @@ if(WITH_GTESTS)
     blender_add_test_lib(bf_draw_tests "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}")
   endif()
 endif()
+



More information about the Bf-blender-cvs mailing list