diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-03-31 20:27:32 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2022-04-05 18:23:52 +0300 |
commit | f60cffad38d12bdfefe503924e93c33a7c89f671 (patch) | |
tree | e741cf808bd41be36f5e5dde6bdd2aa96fcb8eae /intern/cycles | |
parent | 190334b47df46f0e912c873077163e6129e4cbae (diff) |
Cycles: Use USD dependencies when building Hydra render delegate
Adds support for linking with some of the dependencies of a USD
build instead of the precompiled libraries from Blender, specifically
OpenSubdiv, OpenVDB and TBB. Other dependencies keep using the
precompiled libraries from Blender, since they are linked statically
anyway so it does't matter as much. Plus they have interdependencies
that are difficult to resolve when only using selected libraries from
the USD build and can't simply assume that USD was built with all
of them.
This patch also makes building the Hydra render delegate via the
standalone repository work and fixes various small issues I ran into
in general on Windows (e.g. the use of both fixed paths and
`find_package` did not seem to work correctly). Building both the
standalone Cycles application and the Hydra render delegate at the
same time is supported now as well (the paths in the USD plugin JSON
file are updated accordingly).
All that needs to be done now to build is to specify a `PXR_ROOT`
or `USD_ROOT` CMake variable pointing to the USD installation,
everything else is taken care of automatically (CMake targets are
loaded from the `pxrTargets.cmake` of USD and linked into the
render delegate and OpenSubdiv, OpenVDB and TBB are replaced
with those from USD when they exist).
Differential Revision: https://developer.blender.org/D14523
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 33 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 440 | ||||
-rw-r--r-- | intern/cycles/cmake/macros.cmake | 4 | ||||
-rw-r--r-- | intern/cycles/hydra/CMakeLists.txt | 39 | ||||
-rw-r--r-- | intern/cycles/hydra/camera.cpp | 15 | ||||
-rw-r--r-- | intern/cycles/hydra/config.h | 1 | ||||
-rw-r--r-- | intern/cycles/hydra/field.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/hydra/material.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/hydra/material.h | 7 | ||||
-rw-r--r-- | intern/cycles/hydra/node_util.cpp | 2 |
10 files changed, 309 insertions, 243 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 1cc3dccf426..911e1cf214c 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -3,11 +3,7 @@ # Standalone or with Blender if(NOT WITH_BLENDER) - if(WITH_CYCLES_STANDALONE OR NOT WITH_CYCLES_HYDRA_RENDER_DELEGATE) - set(CYCLES_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}) - else() - set(CYCLES_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/hdCycles/resources) - endif() + set(CYCLES_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}) else() set(WITH_CYCLES_BLENDER ON) # WINDOWS_PYTHON_DEBUG needs to write into the user addons folder since it will @@ -219,6 +215,15 @@ add_definitions( -DCCL_NAMESPACE_END=} ) +include_directories( + SYSTEM + ${BOOST_INCLUDE_DIR} + ${OPENIMAGEIO_INCLUDE_DIRS} + ${OPENEXR_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIR} + ${TBB_INCLUDE_DIRS} +) + if(WITH_CYCLES_DEBUG) add_definitions(-DWITH_CYCLES_DEBUG) endif() @@ -259,7 +264,6 @@ endif() if(WITH_CYCLES_EMBREE) add_definitions(-DWITH_EMBREE) - add_definitions(-DEMBREE_STATIC_LIB) include_directories( SYSTEM ${EMBREE_INCLUDE_DIRS} @@ -284,7 +288,6 @@ endif() if(WITH_OPENIMAGEDENOISE) add_definitions(-DWITH_OPENIMAGEDENOISE) - add_definitions(-DOIDN_STATIC_LIB) include_directories( SYSTEM ${OPENIMAGEDENOISE_INCLUDE_DIRS} @@ -312,17 +315,6 @@ if(NOT OPENIMAGEIO_PUGIXML_FOUND) add_definitions(-DWITH_SYSTEM_PUGIXML) endif() -include_directories( - SYSTEM - ${BOOST_INCLUDE_DIR} - ${OPENIMAGEIO_INCLUDE_DIRS} - ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO - ${OPENEXR_INCLUDE_DIR} - ${OPENEXR_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${TBB_INCLUDE_DIRS} -) - if(CYCLES_STANDALONE_REPOSITORY) include_directories(../third_party/atomic) else() @@ -339,10 +331,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang") unset(_has_no_error_unused_macros) endif() -if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND NOT WITH_USD) +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND (NOT WITH_USD)) message(STATUS "USD not found, disabling WITH_CYCLES_HYDRA_RENDER_DELEGATE") set(WITH_CYCLES_HYDRA_RENDER_DELEGATE OFF) endif() +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND (NOT WITH_BLENDER) AND (NOT WITH_CYCLES_STANDALONE)) + set(CYCLES_INSTALL_PATH ${CYCLES_INSTALL_PATH}/hdCycles/resources) +endif() if(WITH_CYCLES_CUDA_BINARIES AND (NOT WITH_CYCLES_CUBIN_COMPILER)) if(MSVC) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 6ad64d684c0..3ee92b7be88 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -69,6 +69,7 @@ if(CYCLES_STANDALONE_REPOSITORY) _set_default(OPENVDB_ROOT_DIR "${_cycles_lib_dir}/openvdb") _set_default(OSL_ROOT_DIR "${_cycles_lib_dir}/osl") _set_default(PNG_ROOT "${_cycles_lib_dir}/png") + _set_default(PUGIXML_ROOT_DIR "${_cycles_lib_dir}/pugixml") _set_default(TBB_ROOT_DIR "${_cycles_lib_dir}/tbb") _set_default(TIFF_ROOT "${_cycles_lib_dir}/tiff") _set_default(ZLIB_ROOT "${_cycles_lib_dir}/zlib") @@ -81,6 +82,23 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() ########################################################################### +# USD +########################################################################### + +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_HYDRA_RENDER_DELEGATE) + set(WITH_USD ON) +endif() +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE) + find_package(pxr CONFIG REQUIRED PATHS ${PXR_ROOT} ${USD_ROOT} NO_DEFAULT_PATH) + if(pxr_FOUND) + set(PXR_LIBRARY_DIR ${PXR_CMAKE_DIR}/lib) + set(USD_INCLUDE_DIRS ${PXR_INCLUDE_DIRS}) + else() + set(WITH_USD OFF) + endif() +endif() + +########################################################################### # Zlib ########################################################################### @@ -126,31 +144,40 @@ if(CYCLES_STANDALONE_REPOSITORY) -DOIIO_STATIC_DEFINE ) + set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO_ROOT_DIR}/include) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR} ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO) # Special exceptions for libraries which needs explicit debug version - set(OPENIMAGEIO_LIBRARY + set(OPENIMAGEIO_LIBRARIES optimized ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO.lib optimized ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_Util.lib debug ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_d.lib debug ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_Util_d.lib ) - endif() - find_package(OpenImageIO REQUIRED) - if(OPENIMAGEIO_PUGIXML_FOUND) - set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}") - set(PUGIXML_LIBRARIES "") + set(PUGIXML_INCLUDE_DIR ${PUGIXML_ROOT_DIR}/include) + set(PUGIXML_LIBRARIES + optimized ${PUGIXML_ROOT_DIR}/lib/pugixml.lib + debug ${PUGIXML_ROOT_DIR}/lib/pugixml_d.lib + ) else() - find_package(PugiXML REQUIRED) + find_package(OpenImageIO REQUIRED) + if(OPENIMAGEIO_PUGIXML_FOUND) + set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO") + set(PUGIXML_LIBRARIES "") + else() + find_package(PugiXML REQUIRED) + endif() endif() # Dependencies if(MSVC AND EXISTS ${_cycles_lib_dir}) set(OPENJPEG_INCLUDE_DIR ${OPENJPEG}/include/openjpeg-2.3) - set(OPENJPEG_LIBRARY ${_cycles_lib_dir}/openjpeg/lib/openjp2${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(OPENJPEG_LIBRARIES ${_cycles_lib_dir}/openjpeg/lib/openjp2${CMAKE_STATIC_LIBRARY_SUFFIX}) + else() + find_package(OpenJPEG REQUIRED) endif() find_package(JPEG REQUIRED) - find_package(OpenJPEG REQUIRED) find_package(TIFF REQUIRED) find_package(PNG REQUIRED) endif() @@ -161,76 +188,70 @@ endif() if(CYCLES_STANDALONE_REPOSITORY) if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(OPENEXR_IEX_LIBRARY + set(OPENEXR_INCLUDE_DIR ${OPENEXR_ROOT_DIR}/include) + set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_ROOT_DIR}/include/OpenEXR) + set(OPENEXR_LIBRARIES optimized ${OPENEXR_ROOT_DIR}/lib/Iex_s.lib - debug ${OPENEXR_ROOT_DIR}/lib/Iex_s_d.lib - ) - set(OPENEXR_HALF_LIBRARY optimized ${OPENEXR_ROOT_DIR}/lib/Half_s.lib - debug ${OPENEXR_ROOT_DIR}/lib/Half_s_d.lib - ) - set(OPENEXR_ILMIMF_LIBRARY optimized ${OPENEXR_ROOT_DIR}/lib/IlmImf_s.lib - debug ${OPENEXR_ROOT_DIR}/lib/IlmImf_s_d.lib - ) - set(OPENEXR_IMATH_LIBRARY optimized ${OPENEXR_ROOT_DIR}/lib/Imath_s.lib - debug ${OPENEXR_ROOT_DIR}/lib/Imath_s_d.lib - ) - set(OPENEXR_ILMTHREAD_LIBRARY optimized ${OPENEXR_ROOT_DIR}/lib/IlmThread_s.lib + debug ${OPENEXR_ROOT_DIR}/lib/Iex_s_d.lib + debug ${OPENEXR_ROOT_DIR}/lib/Half_s_d.lib + debug ${OPENEXR_ROOT_DIR}/lib/IlmImf_s_d.lib + debug ${OPENEXR_ROOT_DIR}/lib/Imath_s_d.lib debug ${OPENEXR_ROOT_DIR}/lib/IlmThread_s_d.lib ) + else() + find_package(OpenEXR REQUIRED) endif() - - find_package(OpenEXR REQUIRED) endif() ########################################################################### # OpenShadingLanguage & LLVM ########################################################################### -if(WITH_CYCLES_OSL) - if(CYCLES_STANDALONE_REPOSITORY) - if(EXISTS ${_cycles_lib_dir}) - set(LLVM_STATIC ON) - endif() +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_OSL) + if(EXISTS ${_cycles_lib_dir}) + set(LLVM_STATIC ON) + endif() + if(MSVC AND EXISTS ${_cycles_lib_dir}) + # TODO(sergey): On Windows llvm-config doesn't give proper results for the + # library names, use hardcoded libraries for now. + file(GLOB _llvm_libs_release ${LLVM_ROOT_DIR}/lib/*.lib) + file(GLOB _llvm_libs_debug ${LLVM_ROOT_DIR}/debug/lib/*.lib) + set(_llvm_libs) + foreach(_llvm_lib_path ${_llvm_libs_release}) + get_filename_component(_llvm_lib_name ${_llvm_lib_path} ABSOLUTE) + list(APPEND _llvm_libs optimized ${_llvm_lib_name}) + endforeach() + foreach(_llvm_lib_path ${_llvm_libs_debug}) + get_filename_component(_llvm_lib_name ${_llvm_lib_path} ABSOLUTE) + list(APPEND _llvm_libs debug ${_llvm_lib_name}) + endforeach() + set(LLVM_LIBRARY ${_llvm_libs}) + unset(_llvm_lib_name) + unset(_llvm_lib_path) + unset(_llvm_libs) + unset(_llvm_libs_debug) + unset(_llvm_libs_release) + + set(OSL_INCLUDE_DIR ${OSL_ROOT_DIR}/include) + set(OSL_LIBRARIES + optimized ${OSL_ROOT_DIR}/lib/oslcomp.lib + optimized ${OSL_ROOT_DIR}/lib/oslexec.lib + optimized ${OSL_ROOT_DIR}/lib/oslquery.lib + debug ${OSL_ROOT_DIR}/lib/oslcomp_d.lib + debug ${OSL_ROOT_DIR}/lib/oslexec_d.lib + debug ${OSL_ROOT_DIR}/lib/oslquery_d.lib + ${PUGIXML_LIBRARIES} + ) + + find_program(OSL_COMPILER NAMES oslc PATHS ${OSL_ROOT_DIR}/bin) + else() find_package(OSL REQUIRED) find_package(LLVM REQUIRED) - - if(MSVC AND EXISTS ${_cycles_lib_dir}) - # TODO(sergey): On Windows llvm-config doesn't give proper results for the - # library names, use hardcoded libraries for now. - file(GLOB _llvm_libs_release ${LLVM_ROOT_DIR}/lib/*.lib) - file(GLOB _llvm_libs_debug ${LLVM_ROOT_DIR}/debug/lib/*.lib) - set(_llvm_libs) - foreach(_llvm_lib_path ${_llvm_libs_release}) - get_filename_component(_llvm_lib_name ${_llvm_lib_path} ABSOLUTE) - list(APPEND _llvm_libs optimized ${_llvm_lib_name}) - endforeach() - foreach(_llvm_lib_path ${_llvm_libs_debug}) - get_filename_component(_llvm_lib_name ${_llvm_lib_path} ABSOLUTE) - list(APPEND _llvm_libs debug ${_llvm_lib_name}) - endforeach() - set(LLVM_LIBRARY ${_llvm_libs}) - unset(_llvm_lib_name) - unset(_llvm_lib_path) - unset(_llvm_libs) - unset(_llvm_libs_debug) - unset(_llvm_libs_release) - - set(OSL_LIBRARIES - optimized ${OSL_ROOT_DIR}/lib/oslcomp.lib - optimized ${OSL_ROOT_DIR}/lib/oslexec.lib - optimized ${OSL_ROOT_DIR}/lib/oslquery.lib - optimized ${OSL_ROOT_DIR}/lib/pugixml.lib - debug ${OSL_ROOT_DIR}/lib/oslcomp_d.lib - debug ${OSL_ROOT_DIR}/lib/oslexec_d.lib - debug ${OSL_ROOT_DIR}/lib/oslquery_d.lib - debug ${OSL_ROOT_DIR}/lib/pugixml_d.lib - ) - endif() endif() endif() @@ -238,22 +259,23 @@ endif() # OpenColorIO ########################################################################### -if(WITH_CYCLES_OPENCOLORIO) - if(CYCLES_STANDALONE_REPOSITORY) - find_package(OpenColorIO REQUIRED) - set(WITH_OPENCOLORIO ON) +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_OPENCOLORIO) + set(WITH_OPENCOLORIO ON) - if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(OPENCOLORIO_LIBPATH ${_cycles_lib_dir}/opencolorio/lib) - set(OPENCOLORIO_LIBRARIES - optimized ${OPENCOLORIO_LIBPATH}/OpenColorIO.lib - optimized ${OPENCOLORIO_LIBPATH}/tinyxml.lib - optimized ${OPENCOLORIO_LIBPATH}/libyaml-cpp.lib - debug ${OPENCOLORIO_LIBPATH}/OpencolorIO_d.lib - debug ${OPENCOLORIO_LIBPATH}/tinyxml_d.lib - debug ${OPENCOLORIO_LIBPATH}/libyaml-cpp_d.lib - ) - endif() + if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_ROOT_DIR}/include) + set(OPENCOLORIO_LIBRARIES + optimized ${OPENCOLORIO_ROOT_DIR}/lib/OpenColorIO.lib + optimized ${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.lib + optimized ${OPENCOLORIO_ROOT_DIR}/lib/libexpatMD.lib + optimized ${OPENCOLORIO_ROOT_DIR}/lib/pystring.lib + debug ${OPENCOLORIO_ROOT_DIR}/lib/OpencolorIO_d.lib + debug ${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp_d.lib + debug ${OPENCOLORIO_ROOT_DIR}/lib/libexpatdMD.lib + debug ${OPENCOLORIO_ROOT_DIR}/lib/pystring_d.lib + ) + else() + find_package(OpenColorIO REQUIRED) endif() endif() @@ -274,22 +296,59 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() endif() - set(__boost_packages filesystem regex system thread date_time) - if(WITH_CYCLES_OSL) - list(APPEND __boost_packages wave) - endif() - find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED) - if(NOT Boost_FOUND) - # Try to find non-multithreaded if -mt not found, this flag - # doesn't matter for us, it has nothing to do with thread - # safety, but keep it to not disturb build setups. - set(Boost_USE_MULTITHREADED OFF) - find_package(Boost 1.48 COMPONENTS ${__boost_packages}) + if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(BOOST_INCLUDE_DIR ${BOOST_ROOT}/include) + set(BOOST_VERSION_HEADER ${BOOST_INCLUDE_DIR}/boost/version.hpp) + if(EXISTS ${BOOST_VERSION_HEADER}) + file(STRINGS "${BOOST_VERSION_HEADER}" BOOST_LIB_VERSION REGEX "#define BOOST_LIB_VERSION ") + if(BOOST_LIB_VERSION MATCHES "#define BOOST_LIB_VERSION \"([0-9_]+)\"") + set(BOOST_VERSION "${CMAKE_MATCH_1}") + endif() + endif() + if(NOT BOOST_VERSION) + message(FATAL_ERROR "Unable to determine Boost version") + endif() + set(BOOST_POSTFIX "vc141-mt-x64-${BOOST_VERSION}.lib") + set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-${BOOST_VERSION}.lib") + set(BOOST_LIBRARIES + optimized ${BOOST_ROOT}/lib/libboost_date_time-${BOOST_POSTFIX} + optimized ${BOOST_ROOT}/lib/libboost_filesystem-${BOOST_POSTFIX} + optimized ${BOOST_ROOT}/lib/libboost_regex-${BOOST_POSTFIX} + optimized ${BOOST_ROOT}/lib/libboost_system-${BOOST_POSTFIX} + optimized ${BOOST_ROOT}/lib/libboost_thread-${BOOST_POSTFIX} + optimized ${BOOST_ROOT}/lib/libboost_chrono-${BOOST_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_date_time-${BOOST_DEBUG_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_filesystem-${BOOST_DEBUG_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_regex-${BOOST_DEBUG_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_system-${BOOST_DEBUG_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_thread-${BOOST_DEBUG_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_chrono-${BOOST_DEBUG_POSTFIX} + ) + if(WITH_CYCLES_OSL) + set(BOOST_LIBRARIES ${BOOST_LIBRARIES} + optimized ${BOOST_ROOT}/lib/libboost_wave-${BOOST_POSTFIX} + debug ${BOOST_ROOT}/lib/libboost_wave-${BOOST_DEBUG_POSTFIX}) + endif() + else() + set(__boost_packages filesystem regex system thread date_time) + if(WITH_CYCLES_OSL) + list(APPEND __boost_packages wave) + endif() + find_package(Boost 1.48 COMPONENTS ${__boost_packages} REQUIRED) + if(NOT Boost_FOUND) + # Try to find non-multithreaded if -mt not found, this flag + # doesn't matter for us, it has nothing to do with thread + # safety, but keep it to not disturb build setups. + set(Boost_USE_MULTITHREADED OFF) + find_package(Boost 1.48 COMPONENTS ${__boost_packages}) + endif() + unset(__boost_packages) + + set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) endif() - unset(__boost_packages) - set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) - set(BOOST_LIBRARIES ${Boost_LIBRARIES}) - set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") endif() @@ -297,47 +356,30 @@ endif() # Embree ########################################################################### -if(WITH_CYCLES_EMBREE) - if(CYCLES_STANDALONE_REPOSITORY) - if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(EMBREE_TASKING_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/tasking.lib - debug ${EMBREE_ROOT_DIR}/lib/tasking_d.lib - ) - set(EMBREE_EMBREE3_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/embree3.lib - debug ${EMBREE_ROOT_DIR}/lib/embree3_d.lib - ) - set(EMBREE_EMBREE_AVX_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/embree_avx.lib - debug ${EMBREE_ROOT_DIR}/lib/embree_avx_d.lib - ) - set(EMBREE_EMBREE_AVX2_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/embree_avx2.lib - debug ${EMBREE_ROOT_DIR}/lib/embree_avx2_d.lib - ) - set(EMBREE_EMBREE_SSE42_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/embree_sse42.lib - debug ${EMBREE_ROOT_DIR}/lib/embree_sse42_d.lib - ) - set(EMBREE_LEXERS_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/lexers.lib - debug ${EMBREE_ROOT_DIR}/lib/lexers_d.lib - ) - set(EMBREE_MATH_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/math.lib - debug ${EMBREE_ROOT_DIR}/lib/math_d.lib - ) - set(EMBREE_SIMD_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/simd.lib - debug ${EMBREE_ROOT_DIR}/lib/simd_d.lib - ) - set(EMBREE_SYS_LIBRARY - optimized ${EMBREE_ROOT_DIR}/lib/sys.lib - debug ${EMBREE_ROOT_DIR}/lib/sys_d.lib - ) - endif() - +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_EMBREE) + if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/include) + set(EMBREE_LIBRARIES + optimized ${EMBREE_ROOT_DIR}/lib/embree3.lib + optimized ${EMBREE_ROOT_DIR}/lib/embree_avx2.lib + optimized ${EMBREE_ROOT_DIR}/lib/embree_avx.lib + optimized ${EMBREE_ROOT_DIR}/lib/embree_sse42.lib + optimized ${EMBREE_ROOT_DIR}/lib/lexers.lib + optimized ${EMBREE_ROOT_DIR}/lib/math.lib + optimized ${EMBREE_ROOT_DIR}/lib/simd.lib + optimized ${EMBREE_ROOT_DIR}/lib/tasking.lib + optimized ${EMBREE_ROOT_DIR}/lib/sys.lib + debug ${EMBREE_ROOT_DIR}/lib/embree3_d.lib + debug ${EMBREE_ROOT_DIR}/lib/embree_avx2_d.lib + debug ${EMBREE_ROOT_DIR}/lib/embree_avx_d.lib + debug ${EMBREE_ROOT_DIR}/lib/embree_sse42_d.lib + debug ${EMBREE_ROOT_DIR}/lib/lexers_d.lib + debug ${EMBREE_ROOT_DIR}/lib/math_d.lib + debug ${EMBREE_ROOT_DIR}/lib/simd_d.lib + debug ${EMBREE_ROOT_DIR}/lib/sys_d.lib + debug ${EMBREE_ROOT_DIR}/lib/tasking_d.lib + ) + else() find_package(Embree 3.8.0 REQUIRED) endif() endif() @@ -346,29 +388,45 @@ endif() # Logging ########################################################################### -if(WITH_CYCLES_LOGGING) - if(CYCLES_STANDALONE_REPOSITORY) - find_package(Glog REQUIRED) - find_package(Gflags REQUIRED) - endif() +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_LOGGING) + find_package(Glog REQUIRED) + find_package(Gflags REQUIRED) endif() ########################################################################### # OpenSubdiv ########################################################################### -if(WITH_CYCLES_OPENSUBDIV) - if(CYCLES_STANDALONE_REPOSITORY) - find_package(OpenSubdiv REQUIRED) - set(WITH_OPENSUBDIV ON) +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND PXR_LIBRARY_DIR AND (WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)) + find_library(OPENSUBDIV_LIBRARY_CPU_DEBUG_PXR NAMES osdCPU_d osdCPU PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + find_library(OPENSUBDIV_LIBRARY_GPU_DEBUG_PXR NAMES osdGPU_d osdGPU PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + find_library(OPENSUBDIV_LIBRARY_CPU_RELEASE_PXR NAMES osdCPU PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + find_library(OPENSUBDIV_LIBRARY_GPU_RELEASE_PXR NAMES osdGPU PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + if(OPENSUBDIV_LIBRARY_CPU_RELEASE_PXR AND OPENSUBDIV_LIBRARY_GPU_RELEASE_PXR) + set(OPENSUBDIV_INCLUDE_DIRS ${PXR_INCLUDE_DIRS}) + set(OPENSUBDIV_LIBRARIES + optimized ${OPENSUBDIV_LIBRARY_CPU_RELEASE_PXR} + optimized ${OPENSUBDIV_LIBRARY_GPU_RELEASE_PXR} + debug ${OPENSUBDIV_LIBRARY_CPU_DEBUG_PXR} + debug ${OPENSUBDIV_LIBRARY_GPU_DEBUG_PXR} + ) + endif() +endif() + +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_OPENSUBDIV) + set(WITH_OPENSUBDIV ON) + if(NOT OPENSUBDIV_LIBRARY_CPU_RELEASE_PXR OR NOT OPENSUBDIV_LIBRARY_GPU_RELEASE_PXR) if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_ROOT_DIR}/include) set(OPENSUBDIV_LIBRARIES optimized ${OPENSUBDIV_ROOT_DIR}/lib/osdCPU.lib optimized ${OPENSUBDIV_ROOT_DIR}/lib/osdGPU.lib debug ${OPENSUBDIV_ROOT_DIR}/lib/osdCPU_d.lib debug ${OPENSUBDIV_ROOT_DIR}/lib/osdGPU_d.lib ) + else() + find_package(OpenSubdiv REQUIRED) endif() endif() endif() @@ -377,18 +435,29 @@ endif() # OpenVDB ########################################################################### -if(WITH_CYCLES_OPENVDB) - if(CYCLES_STANDALONE_REPOSITORY) +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND PXR_LIBRARY_DIR AND (WITH_OPENVDB OR WITH_CYCLES_OPENVDB)) + find_library(OPENVDB_LIBRARY_PXR NAMES openvdb PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + if(OPENVDB_LIBRARY_PXR) + set(OPENVDB_INCLUDE_DIRS ${PXR_INCLUDE_DIRS}) + set(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY_PXR}) + endif() +endif() + +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_OPENVDB) + set(WITH_OPENVDB ON) + set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES) + + if(NOT OPENVDB_LIBRARY_PXR) + find_package(OpenVDB REQUIRED) + if(MSVC AND EXISTS ${_cycles_lib_dir}) set(BLOSC_LIBRARY - optimized ${BLOSC_ROOT_DIR}/lib/libblosc.lib - debug ${BLOSC_ROOT_DIR}/lib/libblosc_d.lib) + optimized ${BLOSC_ROOT_DIR}/lib/libblosc.lib + debug ${BLOSC_ROOT_DIR}/lib/libblosc_d.lib + ) + else() + find_package(Blosc REQUIRED) endif() - - find_package(OpenVDB REQUIRED) - find_package(Blosc REQUIRED) - set(WITH_OPENVDB ON) - set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES) endif() endif() @@ -396,21 +465,21 @@ endif() # OpenImageDenoise ########################################################################### -if(WITH_CYCLES_OPENIMAGEDENOISE) - if(CYCLES_STANDALONE_REPOSITORY) - find_package(OpenImageDenoise REQUIRED) - set(WITH_OPENIMAGEDENOISE ON) - - if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(OPENIMAGEDENOISE_LIBRARIES - optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/OpenImageDenoise.lib - optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/common.lib - optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/dnnl.lib - debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/OpenImageDenoise_d.lib - debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/common_d.lib - debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/dnnl_d.lib) - endif() +if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_OPENIMAGEDENOISE) + set(WITH_OPENIMAGEDENOISE ON) + if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE_ROOT_DIR}/include) + set(OPENIMAGEDENOISE_LIBRARIES + optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/OpenImageDenoise.lib + optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/common.lib + optimized ${OPENIMAGEDENOISE_ROOT_DIR}/lib/dnnl.lib + debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/OpenImageDenoise_d.lib + debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/common_d.lib + debug ${OPENIMAGEDENOISE_ROOT_DIR}/lib/dnnl_d.lib + ) + else() + find_package(OpenImageDenoise REQUIRED) endif() endif() @@ -418,15 +487,30 @@ endif() # TBB ########################################################################### -if(CYCLES_STANDALONE_REPOSITORY) - if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(TBB_LIBRARY - optimized ${TBB_ROOT_DIR}/lib/tbb.lib - debug ${TBB_ROOT_DIR}/lib/debug/tbb_debug.lib +if(WITH_CYCLES_HYDRA_RENDER_DELEGATE AND PXR_LIBRARY_DIR) + find_library(TBB_LIBRARY_DEBUG_PXR NAMES tbb_debug tbb PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + find_library(TBB_LIBRARY_RELEASE_PXR NAMES tbb PATHS ${PXR_LIBRARY_DIR} NO_CACHE NO_DEFAULT_PATH) + if(TBB_LIBRARY_RELEASE_PXR) + set(TBB_INCLUDE_DIRS ${PXR_INCLUDE_DIRS}) + set(TBB_LIBRARIES + optimized ${TBB_LIBRARY_RELEASE_PXR} + debug ${TBB_LIBRARY_DEBUG_PXR} ) endif() +endif() - find_package(TBB REQUIRED) +if(CYCLES_STANDALONE_REPOSITORY) + if(NOT TBB_LIBRARY_RELEASE_PXR) + if(MSVC AND EXISTS ${_cycles_lib_dir}) + set(TBB_INCLUDE_DIRS ${TBB_ROOT_DIR}/include) + set(TBB_LIBRARIES + optimized ${TBB_ROOT_DIR}/lib/tbb.lib + debug ${TBB_ROOT_DIR}/lib/tbb_debug.lib + ) + else() + find_package(TBB REQUIRED) + endif() + endif() endif() ########################################################################### @@ -438,9 +522,9 @@ if(CYCLES_STANDALONE_REPOSITORY) set(GLEW_LIBRARY "${_cycles_lib_dir}/opengl/lib/glew.lib") set(GLEW_INCLUDE_DIR "${_cycles_lib_dir}/opengl/include") add_definitions(-DGLEW_STATIC) + else() + find_package(GLEW REQUIRED) endif() - - find_package(GLEW REQUIRED) else() # Workaround for unconventional variable name use in Blender. set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_PATH}") @@ -466,11 +550,11 @@ if(CYCLES_STANDALONE_REPOSITORY) find_package(OpenGL REQUIRED) - set(CYCLES_GL_LIBRARIES - ${OPENGL_gl_LIBRARY} - ${OPENGL_glu_LIBRARY} - ${GLEW_LIBRARY} - ) + set(CYCLES_GL_LIBRARIES + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + ${GLEW_LIBRARY} + ) else() set(CYCLES_GL_LIBRARIES bf_intern_glew_mx diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake index e69e31f8e52..7c14fd87518 100644 --- a/intern/cycles/cmake/macros.cmake +++ b/intern/cycles/cmake/macros.cmake @@ -144,13 +144,13 @@ macro(cycles_install_libraries target) if(CMAKE_BUILD_TYPE STREQUAL "Debug") install( FILES - ${TBB_ROOT_DIR}/lib/debug/tbb_debug${CMAKE_SHARED_LIBRARY_SUFFIX} + ${TBB_ROOT_DIR}/bin/tbb_debug${CMAKE_SHARED_LIBRARY_SUFFIX} ${OPENVDB_ROOT_DIR}/bin/openvdb_d${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION $<TARGET_FILE_DIR:${target}>) else() install( FILES - ${TBB_ROOT_DIR}/lib/tbb${CMAKE_SHARED_LIBRARY_SUFFIX} + ${TBB_ROOT_DIR}/bin/tbb${CMAKE_SHARED_LIBRARY_SUFFIX} ${OPENVDB_ROOT_DIR}/bin/openvdb${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION $<TARGET_FILE_DIR:${target}>) endif() diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index 703bd955135..d632cd01a02 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -91,35 +91,15 @@ target_compile_definitions(hdCyclesStatic ) target_link_libraries(hdCyclesStatic + PUBLIC + hd + hgi PRIVATE - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}hd${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}plug${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}tf${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}trace${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}vt${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}work${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}sdf${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}cameraUtil${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}hf${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}pxOsd${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}gf${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}arch${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}hgi${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}glf${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}hdx${CMAKE_LINK_LIBRARY_SUFFIX} - ${USD_LIBRARY_DIR}/${PXR_LIB_PREFIX}usdGeom${CMAKE_LINK_LIBRARY_SUFFIX} cycles_scene cycles_session cycles_graph ) -if(USD_PYTHON_LIBRARIES) - target_link_libraries(hdCyclesStatic - PRIVATE - ${USD_PYTHON_LIBRARIES} - ) -endif() - set(HdCyclesPluginName hdCycles) add_library(${HdCyclesPluginName} SHARED plugin.h @@ -144,12 +124,6 @@ target_link_libraries(${HdCyclesPluginName} hdCyclesStatic ) -target_link_directories(${HdCyclesPluginName} - BEFORE - PRIVATE - ${USD_LIBRARY_DIR} -) - cycles_target_link_libraries(${HdCyclesPluginName}) if(WITH_CYCLES_BLENDER) @@ -162,9 +136,10 @@ endif() delayed_install("" $<TARGET_FILE:${HdCyclesPluginName}> ${CYCLES_HYDRA_INSTALL_PATH}) -set(PLUG_INFO_ROOT "..") -set(PLUG_INFO_LIBRARY_PATH "../${HdCyclesPluginName}${CMAKE_SHARED_LIBRARY_SUFFIX}") -set(PLUG_INFO_RESOURCE_PATH "resources") +set(PLUG_INFO_ROOT "..") + +file(RELATIVE_PATH PLUG_INFO_LIBRARY_PATH "${CYCLES_HYDRA_INSTALL_PATH}/${HdCyclesPluginName}" "${CYCLES_HYDRA_INSTALL_PATH}/${HdCyclesPluginName}${CMAKE_SHARED_LIBRARY_SUFFIX}") +file(RELATIVE_PATH PLUG_INFO_RESOURCE_PATH "${CYCLES_HYDRA_INSTALL_PATH}/${HdCyclesPluginName}" "${CYCLES_INSTALL_PATH}") configure_file(resources/plugInfo.json ${CMAKE_CURRENT_BINARY_DIR}/resources/plugInfo.json diff --git a/intern/cycles/hydra/camera.cpp b/intern/cycles/hydra/camera.cpp index 05f1c32d3c4..5d961a6a090 100644 --- a/intern/cycles/hydra/camera.cpp +++ b/intern/cycles/hydra/camera.cpp @@ -13,6 +13,15 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE extern Transform convert_transform(const GfMatrix4d &matrix); +#if PXR_VERSION < 2102 +// clang-format off +TF_DEFINE_PRIVATE_TOKENS(_tokens, + (projection) + (orthographic) +); +// clang-format on +#endif + HdCyclesCamera::HdCyclesCamera(const SdfPath &sprimId) : HdCamera(sprimId) { #if PXR_VERSION >= 2102 @@ -73,6 +82,7 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, } #endif +#if PXR_VERSION < 2111 if (*dirtyBits & DirtyBits::DirtyProjMatrix) { value = sceneDelegate->GetCameraParamValue(id, HdCameraTokens->projectionMatrix); if (!value.IsEmpty()) { @@ -113,6 +123,7 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, #endif } } +#endif if (*dirtyBits & DirtyBits::DirtyWindowPolicy) { value = sceneDelegate->GetCameraParamValue(id, HdCameraTokens->windowPolicy); @@ -137,9 +148,9 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, GfCamera::Orthographic); } #else - value = sceneDelegate->GetCameraParamValue(id, UsdGeomTokens->projection); + value = sceneDelegate->GetCameraParamValue(id, _tokens->projection); if (!value.IsEmpty()) { - _data.SetProjection(value.Get<TfToken>() != UsdGeomTokens->orthographic ? + _data.SetProjection(value.Get<TfToken>() != _tokens->orthographic ? GfCamera::Perspective : GfCamera::Orthographic); } diff --git a/intern/cycles/hydra/config.h b/intern/cycles/hydra/config.h index 034be302d9f..479980e0c11 100644 --- a/intern/cycles/hydra/config.h +++ b/intern/cycles/hydra/config.h @@ -40,5 +40,6 @@ class Session; class SessionParams; class Shader; class ShaderGraph; +class ShaderNode; class Volume; } // namespace CCL_NS diff --git a/intern/cycles/hydra/field.cpp b/intern/cycles/hydra/field.cpp index 8b92ddb6f1f..67945be9d52 100644 --- a/intern/cycles/hydra/field.cpp +++ b/intern/cycles/hydra/field.cpp @@ -12,11 +12,13 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE +#if PXR_VERSION < 2108 // clang-format off TF_DEFINE_PRIVATE_TOKENS(_tokens, (fieldName) ); // clang-format on +#endif #ifdef WITH_OPENVDB class HdCyclesVolumeLoader : public VDBImageLoader { diff --git a/intern/cycles/hydra/material.cpp b/intern/cycles/hydra/material.cpp index a595102a605..b296d9f3751 100644 --- a/intern/cycles/hydra/material.cpp +++ b/intern/cycles/hydra/material.cpp @@ -40,8 +40,6 @@ TF_DEFINE_PRIVATE_TOKENS(CyclesMaterialTokens, ); // clang-format on -namespace { - // Simple class to handle remapping of USDPreviewSurface nodes and parameters to Cycles equivalents class UsdToCyclesMapping { using ParamMap = std::unordered_map<TfToken, ustring, TfToken::HashFunctor>; @@ -130,6 +128,8 @@ class UsdToCyclesTexture : public UsdToCyclesMapping { } }; +namespace { + class UsdToCycles { const UsdToCyclesMapping UsdPreviewSurface = { "principled_bsdf", @@ -183,11 +183,6 @@ TfStaticData<UsdToCycles> sUsdToCyles; } // namespace -struct HdCyclesMaterial::NodeDesc { - ShaderNode *node; - const UsdToCyclesMapping *mapping; -}; - HdCyclesMaterial::HdCyclesMaterial(const SdfPath &sprimId) : HdMaterial(sprimId) { } diff --git a/intern/cycles/hydra/material.h b/intern/cycles/hydra/material.h index 15925671bb8..5e08fd5c99e 100644 --- a/intern/cycles/hydra/material.h +++ b/intern/cycles/hydra/material.h @@ -34,9 +34,12 @@ class HdCyclesMaterial final : public PXR_NS::HdMaterial { return _shader; } - struct NodeDesc; - private: + struct NodeDesc { + CCL_NS::ShaderNode *node; + const class UsdToCyclesMapping *mapping; + }; + void Initialize(PXR_NS::HdRenderParam *renderParam); void UpdateParameters(NodeDesc &nodeDesc, diff --git a/intern/cycles/hydra/node_util.cpp b/intern/cycles/hydra/node_util.cpp index c7e49688f5c..bdf5786ed75 100644 --- a/intern/cycles/hydra/node_util.cpp +++ b/intern/cycles/hydra/node_util.cpp @@ -273,7 +273,7 @@ template<typename MatrixArray> array<Transform> convertToCyclesTransformArray(co array<Transform> cyclesArray; cyclesArray.reserve(valueData.size()); for (const auto &element : valueData) { - cyclesArray.push_back_reserved(convertMatrixToCycles<MatrixArray::value_type>(element)); + cyclesArray.push_back_reserved(convertMatrixToCycles<typename MatrixArray::value_type>(element)); } return cyclesArray; } |