Compare commits
154 Commits
nodes-upda
...
temp-attri
Author | SHA1 | Date | |
---|---|---|---|
206f3352dd | |||
dd92220f0b | |||
5639dcef62 | |||
a20e0fd1a5 | |||
448710996b | |||
3b41749245 | |||
00944353be | |||
623818f2d5 | |||
4b7eae5cd3 | |||
1172c0ae44 | |||
7f17d15125 | |||
b33fd7e89e | |||
10b78013eb | |||
3d057de976 | |||
3817b408e0 | |||
b8d3ad515a | |||
022b541cb3 | |||
e294e7a99c | |||
7928578f18 | |||
369aa3a8a0 | |||
243b5ac98c | |||
b63483baec | |||
4ee0e62986 | |||
b2184402ae | |||
028777bdba | |||
e43c171455 | |||
e433e4ae42 | |||
f22aa19845 | |||
3391649edd | |||
9e95222cb7 | |||
ef07d5a297 | |||
09ec88413b | |||
b9c8bb4254 | |||
64eb1df4b3 | |||
9a9b87d9c5 | |||
257b6bcc61 | |||
b53babaae7 | |||
aa9efbedf1 | |||
93a5fe3a37 | |||
90de4edc06 | |||
138a0c8109 | |||
3a06d098da | |||
10636857f8 | |||
e69f9fe0ca | |||
3b39482e2c | |||
82c72ccdbc | |||
6ea2f106a0 | |||
c9d4f5d625 | |||
22c7967205 | |||
56088650be | |||
14ec1f4e13 | |||
33d262a7c8 | |||
ec04ff8a33 | |||
c5c607bdaa | |||
f4392d1423 | |||
005f7318b2 | |||
93e08fdf90 | |||
92e16e35dc | |||
2abb09aa2b | |||
a371d4bb2b | |||
03f9dba616 | |||
![]() |
5f2ad6751c | ||
04e6656ff1 | |||
![]() |
0ed005d48a | ||
1f33e20f55 | |||
946f53d86e | |||
7ab79ac6ba | |||
![]() |
049924c240 | ||
6118cbb78e | |||
bb2e2ad3ff | |||
467f97fb57 | |||
236ff239bb | |||
5e0068f3f7 | |||
![]() |
dfcb4abd4c | ||
60bd05f920 | |||
688671b9d7 | |||
07961e5358 | |||
01f2dad596 | |||
ffa4c53d10 | |||
88c16c4e7a | |||
fed3c58f92 | |||
77f3b9ea9f | |||
1dd65919e5 | |||
bdada925e3 | |||
89602a8366 | |||
96a8189d74 | |||
8f18d076e9 | |||
1077c37f1b | |||
f54fc8ac6e | |||
a7e337957d | |||
d6a773345b | |||
ff0259de92 | |||
6dac1211b1 | |||
7568501934 | |||
2200c5f761 | |||
f11182b1be | |||
a069bd219c | |||
3d1a0f97f7 | |||
2d37e469a2 | |||
20b0de7db1 | |||
1b5288b87f | |||
e83d96753c | |||
de5e3ef8e5 | |||
91544db137 | |||
2cc7f32f18 | |||
9e16740ca1 | |||
fc94932596 | |||
97e363a06a | |||
7d47eea06d | |||
5dbe82f129 | |||
9bd5dff790 | |||
c3427196c2 | |||
21c61092f0 | |||
59ffc4945a | |||
07b7158c29 | |||
1b29d18790 | |||
f68eac3945 | |||
e99d523901 | |||
aa46b36a3f | |||
cf84056954 | |||
47d90d9a96 | |||
bbf78af3c5 | |||
3da0ad6bb2 | |||
002e75fa24 | |||
427ea6e4ec | |||
c1e587bc46 | |||
0a082f9ccd | |||
01321c7825 | |||
abbd01aff0 | |||
40cbdf56fd | |||
29e5a8b200 | |||
aa363a71cd | |||
d42a2cfef4 | |||
1564743475 | |||
d932728ac1 | |||
dcc7786f14 | |||
27fc7ca66c | |||
9807cb0eef | |||
1f25ab4bb9 | |||
cadfba7aad | |||
be5f911e2a | |||
c37de30fdb | |||
95d64038f4 | |||
7f32a3ddd3 | |||
fcba670314 | |||
4fe0ef5eab | |||
4a6a755afd | |||
64b4e66afb | |||
ec77f2d11d | |||
e36fe7b78f | |||
a795d243cb | |||
4c322f3fba | |||
03d31e568f | |||
1291e369f9 |
@@ -251,6 +251,16 @@ if(WITH_GHOST_X11)
|
||||
option(WITH_X11_ALPHA "Enable X11 transparent background" ON)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
|
||||
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
|
||||
else()
|
||||
# not an option for other OS's
|
||||
set(WITH_SYSTEM_GLEW OFF)
|
||||
set(WITH_SYSTEM_GLES OFF)
|
||||
endif()
|
||||
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
|
||||
endif()
|
||||
@@ -339,7 +349,7 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
|
||||
# Misc
|
||||
if(WIN32 OR APPLE)
|
||||
if(WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
||||
endif()
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
||||
@@ -393,14 +403,14 @@ set(CYCLES_TEST_DEVICES CPU CACHE STRING "Run regression tests on the specified
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
|
||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
|
||||
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
|
||||
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_KERNEL_ASAN)
|
||||
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||
mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
|
||||
mark_as_advanced(WITH_CYCLES_DEBUG)
|
||||
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
||||
|
||||
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
|
||||
@@ -475,32 +485,15 @@ endif()
|
||||
|
||||
# OpenGL
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# GLEW can only built with either GLX or EGL support and most binary
|
||||
# distributions are built with GLX support. So we always compile GLEW
|
||||
# with EGL support manually, and the options are no longer available.
|
||||
set(WITH_SYSTEM_GLEW OFF)
|
||||
set(WITH_SYSTEM_GLES ON)
|
||||
|
||||
# Always use EGL instead of GLX, for X11, Wayland and headless.
|
||||
set(WITH_GL_EGL ON)
|
||||
else()
|
||||
# System GLEW and GLES were never an option on other platforms.
|
||||
set(WITH_SYSTEM_GLEW OFF)
|
||||
set(WITH_SYSTEM_GLES OFF)
|
||||
|
||||
# Experimental EGL option.
|
||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL or WGL)" OFF)
|
||||
mark_as_advanced(WITH_GL_EGL)
|
||||
endif()
|
||||
|
||||
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
|
||||
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
|
||||
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
|
||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||
|
||||
mark_as_advanced(
|
||||
WITH_OPENGL
|
||||
WITH_GLEW_ES
|
||||
WITH_GL_EGL
|
||||
WITH_GL_PROFILE_ES20
|
||||
)
|
||||
|
||||
@@ -1712,18 +1705,22 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Select C++17 as the standard for C++ projects.
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
# If C++17 is not available, downgrading to an earlier standard is NOT OK.
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
# Do not enable compiler specific language extentions.
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above.
|
||||
if(MSVC AND MSVC_VERSION GREATER 1913)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /std:c++17")
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above
|
||||
if(MSVC_VERSION GREATER 1913)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
|
||||
endif()
|
||||
elseif(
|
||||
CMAKE_COMPILER_IS_GNUCC OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Intel"
|
||||
)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -std=c++17")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
|
||||
endif()
|
||||
|
||||
# Visual Studio has all standards it supports available by default
|
||||
@@ -1918,7 +1915,6 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
info_cfg_option(WITH_IK_SOLVER)
|
||||
info_cfg_option(WITH_INPUT_NDOF)
|
||||
info_cfg_option(WITH_INPUT_IME)
|
||||
info_cfg_option(WITH_INTERNATIONAL)
|
||||
info_cfg_option(WITH_OPENCOLLADA)
|
||||
info_cfg_option(WITH_OPENCOLORIO)
|
||||
|
@@ -56,7 +56,6 @@ else()
|
||||
endif()
|
||||
|
||||
include(cmake/zlib.cmake)
|
||||
include(cmake/zstd.cmake)
|
||||
include(cmake/openal.cmake)
|
||||
include(cmake/png.cmake)
|
||||
include(cmake/jpeg.cmake)
|
||||
@@ -82,11 +81,7 @@ if(UNIX)
|
||||
endif()
|
||||
include(cmake/openimageio.cmake)
|
||||
include(cmake/tiff.cmake)
|
||||
if(WIN32)
|
||||
include(cmake/flexbison.cmake)
|
||||
else()
|
||||
include(cmake/flex.cmake)
|
||||
endif()
|
||||
include(cmake/flexbison.cmake)
|
||||
include(cmake/osl.cmake)
|
||||
include(cmake/tbb.cmake)
|
||||
include(cmake/openvdb.cmake)
|
||||
@@ -169,7 +164,6 @@ endif()
|
||||
if(UNIX AND NOT APPLE)
|
||||
include(cmake/libglu.cmake)
|
||||
include(cmake/mesa.cmake)
|
||||
include(cmake/wayland_protocols.cmake)
|
||||
endif()
|
||||
|
||||
include(cmake/harvest.cmake)
|
||||
|
@@ -87,10 +87,7 @@ download_source(LIBGLU)
|
||||
download_source(MESA)
|
||||
download_source(NASM)
|
||||
download_source(XR_OPENXR_SDK)
|
||||
download_source(WL_PROTOCOLS)
|
||||
download_source(ISPC)
|
||||
download_source(GMP)
|
||||
download_source(POTRACE)
|
||||
download_source(HARU)
|
||||
download_source(ZSTD)
|
||||
download_source(FLEX)
|
||||
|
@@ -30,7 +30,6 @@ if(WIN32)
|
||||
--enable-w32threads
|
||||
--disable-pthreads
|
||||
--enable-libopenjpeg
|
||||
--disable-mediafoundation
|
||||
)
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
|
||||
set(FFMPEG_EXTRA_FLAGS
|
||||
|
@@ -1,28 +0,0 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
ExternalProject_Add(external_flex
|
||||
URL file://${PACKAGE_DIR}/${FLEX_FILE}
|
||||
URL_HASH ${FLEX_HASH_TYPE}=${FLEX_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/flex
|
||||
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
|
||||
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make -j${MAKE_THREADS}
|
||||
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make install
|
||||
INSTALL_DIR ${LIBDIR}/flex
|
||||
)
|
@@ -106,7 +106,6 @@ harvest(llvm/include llvm/include "*")
|
||||
harvest(llvm/bin llvm/bin "llvm-config")
|
||||
harvest(llvm/lib llvm/lib "libLLVM*.a")
|
||||
harvest(llvm/lib llvm/lib "libclang*.a")
|
||||
harvest(llvm/lib/clang llvm/lib/clang "*.h")
|
||||
if(APPLE)
|
||||
harvest(openmp/lib openmp/lib "*")
|
||||
harvest(openmp/include openmp/include "*.h")
|
||||
@@ -127,8 +126,6 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
harvest(xml2/include xml2/include "*.h")
|
||||
harvest(xml2/lib xml2/lib "*.a")
|
||||
|
||||
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
|
||||
else()
|
||||
harvest(blosc/lib openvdb/lib "*.a")
|
||||
harvest(xml2/lib opencollada/lib "*.a")
|
||||
@@ -193,8 +190,6 @@ harvest(potrace/include potrace/include "*.h")
|
||||
harvest(potrace/lib potrace/lib "*.a")
|
||||
harvest(haru/include haru/include "*.h")
|
||||
harvest(haru/lib haru/lib "*.a")
|
||||
harvest(zstd/include zstd/include "*.h")
|
||||
harvest(zstd/lib zstd/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
|
@@ -29,13 +29,12 @@ elseif(APPLE)
|
||||
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
||||
set(ISPC_EXTRA_ARGS_APPLE
|
||||
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
|
||||
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
|
||||
-DARM_ENABLED=On
|
||||
)
|
||||
else()
|
||||
set(ISPC_EXTRA_ARGS_APPLE
|
||||
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
|
||||
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||
-DARM_ENABLED=Off
|
||||
)
|
||||
endif()
|
||||
@@ -44,7 +43,6 @@ elseif(UNIX)
|
||||
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
|
||||
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
|
||||
-DARM_ENABLED=Off
|
||||
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -84,9 +82,4 @@ if(WIN32)
|
||||
external_ispc
|
||||
external_flexbison
|
||||
)
|
||||
else()
|
||||
add_dependencies(
|
||||
external_ispc
|
||||
external_flex
|
||||
)
|
||||
endif()
|
||||
|
@@ -66,11 +66,7 @@ ExternalProject_Add(ll
|
||||
|
||||
if(MSVC)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
set(LLVM_HARVEST_COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib ${HARVEST_TARGET}/llvm/lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include ${HARVEST_TARGET}/llvm/include &&
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/llvm/bin/clang-format.exe ${HARVEST_TARGET}/llvm/bin/clang-format.exe
|
||||
)
|
||||
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
|
||||
else()
|
||||
set(LLVM_HARVEST_COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
|
||||
|
@@ -45,6 +45,7 @@ ExternalProject_Add(external_openimagedenoise
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${OIDN_HASH_TYPE}=${OIDN_HASH}
|
||||
PREFIX ${BUILD_DIR}/openimagedenoise
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimagedenoise/src/external_openimagedenoise < ${PATCH_DIR}/oidn.diff
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openimagedenoise
|
||||
)
|
||||
|
@@ -22,8 +22,9 @@ ExternalProject_Add(external_openmp
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH}
|
||||
PREFIX ${BUILD_DIR}/openmp
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
|
||||
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @rpath/libomp.dylib runtime/src/libomp.dylib && make install
|
||||
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
|
||||
INSTALL_DIR ${LIBDIR}/openmp
|
||||
)
|
||||
|
||||
|
@@ -20,10 +20,12 @@ if(WIN32)
|
||||
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
|
||||
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
|
||||
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
|
||||
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
|
||||
else()
|
||||
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
|
||||
set(OSL_FLEX_BISON)
|
||||
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
|
||||
SET(OSL_PLATFORM_FLAGS)
|
||||
endif()
|
||||
|
||||
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
|
||||
@@ -49,13 +51,12 @@ set(OSL_EXTRA_ARGS
|
||||
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
|
||||
-DOSL_BUILD_TESTS=OFF
|
||||
-DOSL_BUILD_MATERIALX=OFF
|
||||
-DPNG_ROOT=${LIBDIR}/png
|
||||
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
||||
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
|
||||
${OSL_FLEX_BISON}
|
||||
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DLINKSTATIC=ON
|
||||
${OSL_PLATFORM_FLAGS}
|
||||
-DOSL_BUILD_PLUGINS=OFF
|
||||
-DSTOP_ON_WARNING=OFF
|
||||
-DUSE_LLVM_BITCODE=OFF
|
||||
@@ -68,9 +69,13 @@ set(OSL_EXTRA_ARGS
|
||||
${OSL_SIMD_FLAGS}
|
||||
-Dpugixml_ROOT=${LIBDIR}/pugixml
|
||||
-DUSE_PYTHON=OFF
|
||||
-DCMAKE_CXX_STANDARD=14
|
||||
)
|
||||
|
||||
# Apple arm64 uses LLVM 11, LLVM 10+ requires C++14
|
||||
if (APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
||||
list(APPEND OSL_EXTRA_ARGS -DCMAKE_CXX_STANDARD=14)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_osl
|
||||
URL file://${PACKAGE_DIR}/${OSL_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
@@ -88,20 +93,10 @@ add_dependencies(
|
||||
ll
|
||||
external_openexr
|
||||
external_zlib
|
||||
external_flexbison
|
||||
external_openimageio
|
||||
external_pugixml
|
||||
)
|
||||
if(WIN32)
|
||||
add_dependencies(
|
||||
external_osl
|
||||
external_flexbison
|
||||
)
|
||||
else()
|
||||
add_dependencies(
|
||||
external_osl
|
||||
external_flex
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
|
@@ -152,20 +152,35 @@ set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
|
||||
set(OPENCOLORIO_HASH_TYPE MD5)
|
||||
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
|
||||
|
||||
set(LLVM_VERSION 12.0.0)
|
||||
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||
set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
|
||||
set(LLVM_HASH_TYPE MD5)
|
||||
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||
if(BLENDER_PLATFORM_ARM)
|
||||
# Newer version required by ISPC with arm support.
|
||||
set(LLVM_VERSION 11.0.1)
|
||||
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||
set(LLVM_HASH e700af40ab83463e4e9ab0ba3708312e)
|
||||
set(LLVM_HASH_TYPE MD5)
|
||||
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||
|
||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
||||
set(OPENMP_HASH ac48ce3e4582ccb82f81ab59eb3fc9dc)
|
||||
set(OPENMP_HASH_TYPE MD5)
|
||||
set(OPENMP_FILE openmp-${LLVM_VERSION}.src.tar.xz)
|
||||
set(OPENMP_VERSION 9.0.1)
|
||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
|
||||
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
||||
set(OPENMP_HASH_TYPE MD5)
|
||||
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
|
||||
else()
|
||||
set(LLVM_VERSION 9.0.1)
|
||||
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.tar.xz)
|
||||
set(LLVM_HASH b4268e733dfe352960140dc07ef2efcb)
|
||||
set(LLVM_HASH_TYPE MD5)
|
||||
set(LLVM_FILE llvm-project-${LLVM_VERSION}.tar.xz)
|
||||
|
||||
set(OPENIMAGEIO_VERSION 2.2.15.1)
|
||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
||||
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
||||
set(OPENMP_HASH_TYPE MD5)
|
||||
set(OPENMP_FILE openmp-${LLVM_VERSION}.src.tar.xz)
|
||||
endif()
|
||||
|
||||
set(OPENIMAGEIO_VERSION 2.1.15.0)
|
||||
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||
set(OPENIMAGEIO_HASH 3db5c5f0b3dc91597c75e5df09eb9072)
|
||||
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
|
||||
set(OPENIMAGEIO_HASH_TYPE MD5)
|
||||
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||
|
||||
@@ -175,9 +190,9 @@ set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
|
||||
set(TIFF_HASH_TYPE MD5)
|
||||
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
|
||||
|
||||
set(OSL_VERSION 1.11.14.1)
|
||||
set(OSL_VERSION 1.11.10.0)
|
||||
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
|
||||
set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
|
||||
set(OSL_HASH dfdc23597aeef083832cbada62211756)
|
||||
set(OSL_HASH_TYPE MD5)
|
||||
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
|
||||
|
||||
@@ -201,9 +216,9 @@ set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
|
||||
set(OPENVDB_HASH_TYPE MD5)
|
||||
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
|
||||
|
||||
set(NANOVDB_GIT_UID dc37d8a631922e7bef46712947dc19b755f3e841)
|
||||
set(NANOVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
|
||||
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
|
||||
set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
|
||||
set(NANOVDB_HASH 90919510bc6ccd630fedc56f748cb199)
|
||||
set(NANOVDB_HASH_TYPE MD5)
|
||||
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
|
||||
|
||||
@@ -355,18 +370,12 @@ set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
|
||||
set(PUGIXML_HASH_TYPE MD5)
|
||||
set(PUGIXML_FILE pugixml-${PUGIXML_VERSION}.tar.gz)
|
||||
|
||||
set(FLEXBISON_VERSION 2.5.24)
|
||||
set(FLEXBISON_VERSION 2.5.5)
|
||||
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
|
||||
set(FLEXBISON_HASH 6b549d43e34ece0e8ed05af92daa31c4)
|
||||
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
|
||||
set(FLEXBISON_HASH_TYPE MD5)
|
||||
set(FLEXBISON_FILE win_flex_bison-${FLEXBISON_VERSION}.zip)
|
||||
|
||||
set(FLEX_VERSION 2.6.4)
|
||||
set(FLEX_URI https://github.com/westes/flex/releases/download/v${FLEX_VERSION}/flex-${FLEX_VERSION}.tar.gz)
|
||||
set(FLEX_HASH 2882e3179748cc9f9c23ec593d6adc8d)
|
||||
set(FLEX_HASH_TYPE MD5)
|
||||
set(FLEX_FILE flex-${FLEX_VERSION}.tar.gz)
|
||||
|
||||
# Libraries to keep Python modules static on Linux.
|
||||
|
||||
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
|
||||
@@ -423,9 +432,9 @@ set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
|
||||
set(USD_HASH_TYPE MD5)
|
||||
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
|
||||
|
||||
set(OIDN_VERSION 1.4.1)
|
||||
set(OIDN_VERSION 1.4.0)
|
||||
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
||||
set(OIDN_HASH df4007b0ab93b1c41cdf223b075d01c0)
|
||||
set(OIDN_HASH 421824019becc5b664a22a2b98332bc5)
|
||||
set(OIDN_HASH_TYPE MD5)
|
||||
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
|
||||
|
||||
@@ -435,10 +444,10 @@ set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
|
||||
set(LIBGLU_HASH_TYPE MD5)
|
||||
set(LIBGLU_FILE glu-${LIBGLU_VERSION}.tar.xz)
|
||||
|
||||
set(MESA_VERSION 21.1.5)
|
||||
set(MESA_VERSION 20.3.4)
|
||||
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
|
||||
set(MESA_HASH 022c7293074aeeced2278c872db4fa693147c70f8595b076cf3f1ef81520766d)
|
||||
set(MESA_HASH_TYPE SHA256)
|
||||
set(MESA_HASH 556338446aef8ae947a789b3e0b5e056)
|
||||
set(MESA_HASH_TYPE MD5)
|
||||
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
|
||||
|
||||
set(NASM_VERSION 2.15.02)
|
||||
@@ -447,23 +456,25 @@ set(NASM_HASH aded8b796c996a486a56e0515c83e414116decc3b184d88043480b32eb0a8589)
|
||||
set(NASM_HASH_TYPE SHA256)
|
||||
set(NASM_FILE nasm-${NASM_VERSION}.tar.gz)
|
||||
|
||||
set(XR_OPENXR_SDK_VERSION 1.0.17)
|
||||
set(XR_OPENXR_SDK_VERSION 1.0.14)
|
||||
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
|
||||
set(XR_OPENXR_SDK_HASH bf0fd8828837edff01047474e90013e1)
|
||||
set(XR_OPENXR_SDK_HASH 0df6b2fd6045423451a77ff6bc3e1a75)
|
||||
set(XR_OPENXR_SDK_HASH_TYPE MD5)
|
||||
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
|
||||
|
||||
set(WL_PROTOCOLS_VERSION 1.21)
|
||||
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
|
||||
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
|
||||
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
|
||||
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
||||
|
||||
set(ISPC_VERSION v1.16.0)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
|
||||
set(ISPC_HASH_TYPE MD5)
|
||||
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
|
||||
if(BLENDER_PLATFORM_ARM)
|
||||
# Unreleased version with macOS arm support.
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/f5949c055eb9eeb93696978a3da4bfb3a6a30b35.zip)
|
||||
set(ISPC_HASH d382fea18d01dbd0cd05d9e1ede36d7d)
|
||||
set(ISPC_HASH_TYPE MD5)
|
||||
set(ISPC_FILE f5949c055eb9eeb93696978a3da4bfb3a6a30b35.zip)
|
||||
else()
|
||||
set(ISPC_VERSION v1.14.1)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
|
||||
set(ISPC_HASH_TYPE MD5)
|
||||
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
|
||||
endif()
|
||||
|
||||
set(GMP_VERSION 6.2.0)
|
||||
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
||||
@@ -483,11 +494,5 @@ set(HARU_HASH 4f916aa49c3069b3a10850013c507460)
|
||||
set(HARU_HASH_TYPE MD5)
|
||||
set(HARU_FILE libharu-${HARU_VERSION}.tar.gz)
|
||||
|
||||
set(ZSTD_VERSION 1.5.0)
|
||||
set(ZSTD_URI https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz)
|
||||
set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
|
||||
set(ZSTD_HASH_TYPE SHA256)
|
||||
set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
|
||||
|
||||
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
|
||||
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
||||
|
@@ -1,27 +0,0 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
ExternalProject_Add(external_wayland_protocols
|
||||
URL file://${PACKAGE_DIR}/${WL_PROTOCOLS_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${WL_PROTOCOLS_HASH_TYPE}=${WL_PROTOCOLS_HASH}
|
||||
PREFIX ${BUILD_DIR}/wayland-protocols
|
||||
CONFIGURE_COMMAND meson --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
|
||||
BUILD_COMMAND ninja
|
||||
INSTALL_COMMAND ninja install
|
||||
)
|
@@ -1,51 +0,0 @@
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(ZSTD_EXTRA_ARGS
|
||||
-DZSTD_BUILD_PROGRAMS=OFF
|
||||
-DZSTD_BUILD_SHARED=OFF
|
||||
-DZSTD_BUILD_STATIC=ON
|
||||
-DZSTD_BUILD_TESTS=OFF
|
||||
-DZSTD_LEGACY_SUPPORT=OFF
|
||||
-DZSTD_LZ4_SUPPORT=OFF
|
||||
-DZSTD_LZMA_SUPPORT=OFF
|
||||
-DZSTD_MULTITHREAD_SUPPORT=ON
|
||||
-DZSTD_PROGRAMS_LINK_SHARED=OFF
|
||||
-DZSTD_USE_STATIC_RUNTIME=OFF
|
||||
-DZSTD_ZLIB_SUPPORT=OFF
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_zstd
|
||||
URL file://${PACKAGE_DIR}/${ZSTD_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${ZSTD_HASH_TYPE}=${ZSTD_HASH}
|
||||
PREFIX ${BUILD_DIR}/zstd
|
||||
SOURCE_SUBDIR build/cmake
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zstd ${DEFAULT_CMAKE_FLAGS} ${ZSTD_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/zstd
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_zstd after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zstd/lib/zstd_static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/zstd_static${LIBEXT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zstd/include/ ${HARVEST_TARGET}/zstd/include/
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
@@ -474,25 +474,25 @@ OPENEXR_FORCE_REBUILD=false
|
||||
OPENEXR_SKIP=false
|
||||
_with_built_openexr=false
|
||||
|
||||
OIIO_VERSION="2.2.15.1"
|
||||
OIIO_VERSION_SHORT="2.2"
|
||||
OIIO_VERSION="2.1.15.0"
|
||||
OIIO_VERSION_SHORT="2.1"
|
||||
OIIO_VERSION_MIN="2.1.12"
|
||||
OIIO_VERSION_MAX="2.3.0"
|
||||
OIIO_VERSION_MAX="2.2.10"
|
||||
OIIO_FORCE_BUILD=false
|
||||
OIIO_FORCE_REBUILD=false
|
||||
OIIO_SKIP=false
|
||||
|
||||
LLVM_VERSION="12.0.0"
|
||||
LLVM_VERSION_SHORT="12.0"
|
||||
LLVM_VERSION_MIN="11.0"
|
||||
LLVM_VERSION_MAX="13.0"
|
||||
LLVM_VERSION="9.0.1"
|
||||
LLVM_VERSION_SHORT="9.0"
|
||||
LLVM_VERSION_MIN="6.0"
|
||||
LLVM_VERSION_MAX="12.0"
|
||||
LLVM_VERSION_FOUND=""
|
||||
LLVM_FORCE_BUILD=false
|
||||
LLVM_FORCE_REBUILD=false
|
||||
LLVM_SKIP=false
|
||||
|
||||
# OSL needs to be compiled for now!
|
||||
OSL_VERSION="1.11.14.1"
|
||||
OSL_VERSION="1.11.10.0"
|
||||
OSL_VERSION_SHORT="1.11"
|
||||
OSL_VERSION_MIN="1.11"
|
||||
OSL_VERSION_MAX="2.0"
|
||||
@@ -553,7 +553,7 @@ EMBREE_FORCE_BUILD=false
|
||||
EMBREE_FORCE_REBUILD=false
|
||||
EMBREE_SKIP=false
|
||||
|
||||
OIDN_VERSION="1.4.1"
|
||||
OIDN_VERSION="1.4.0"
|
||||
OIDN_VERSION_SHORT="1.4"
|
||||
OIDN_VERSION_MIN="1.4.0"
|
||||
OIDN_VERSION_MAX="1.5"
|
||||
@@ -561,7 +561,7 @@ OIDN_FORCE_BUILD=false
|
||||
OIDN_FORCE_REBUILD=false
|
||||
OIDN_SKIP=false
|
||||
|
||||
ISPC_VERSION="1.16.0"
|
||||
ISPC_VERSION="1.14.1"
|
||||
|
||||
FFMPEG_VERSION="4.4"
|
||||
FFMPEG_VERSION_SHORT="4.4"
|
||||
@@ -572,7 +572,7 @@ FFMPEG_FORCE_REBUILD=false
|
||||
FFMPEG_SKIP=false
|
||||
_ffmpeg_list_sep=";"
|
||||
|
||||
XR_OPENXR_VERSION="1.0.17"
|
||||
XR_OPENXR_VERSION="1.0.14"
|
||||
XR_OPENXR_VERSION_SHORT="1.0"
|
||||
XR_OPENXR_VERSION_MIN="1.0.8"
|
||||
XR_OPENXR_VERSION_MAX="2.0"
|
||||
@@ -603,6 +603,9 @@ MP3LAME_DEV=""
|
||||
OPENJPEG_USE=false
|
||||
OPENJPEG_DEV=""
|
||||
|
||||
# Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
|
||||
NO_SYSTEM_GLEW=false
|
||||
|
||||
# Switch to english language, else some things (like check_package_DEB()) won't work!
|
||||
LANG_BACK=$LANG
|
||||
LANG=""
|
||||
@@ -1070,7 +1073,7 @@ OPENVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/v
|
||||
#~ OPENVDB_SOURCE_REPO_BRANCH="dev"
|
||||
|
||||
NANOVDB_USE_REPO=false
|
||||
NANOVDB_SOURCE_REPO_UID="dc37d8a631922e7bef46712947dc19b755f3e841"
|
||||
NANOVDB_SOURCE_REPO_UID="e62f7a0bf1e27397223c61ddeaaf57edf111b77f"
|
||||
NANOVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_SOURCE_REPO_UID}.tar.gz" )
|
||||
|
||||
ALEMBIC_USE_REPO=false
|
||||
@@ -1105,9 +1108,9 @@ FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
||||
|
||||
XR_OPENXR_USE_REPO=false
|
||||
XR_OPENXR_SOURCE=("https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_VERSION}.tar.gz")
|
||||
XR_OPENXR_SOURCE_REPO=("https://github.com/KhronosGroup/OpenXR-SDK.git")
|
||||
XR_OPENXR_REPO_UID="bf21ccb1007bb531b45d9978919a56ea5059c245"
|
||||
XR_OPENXR_REPO_BRANCH="master"
|
||||
#~ XR_OPENXR_SOURCE_REPO=("https://github.com/KhronosGroup/OpenXR-SDK.git")
|
||||
#~ XR_OPENXR_REPO_UID="5900c51562769b03bea699dc0352cae56acb6419d"
|
||||
#~ XR_OPENXR_REPO_BRANCH="master"
|
||||
|
||||
# C++11 is required now
|
||||
CXXFLAGS_BACK=$CXXFLAGS
|
||||
@@ -1125,8 +1128,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
||||
* Basics of dev environment (cmake, gcc, svn , git, ...).
|
||||
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
|
||||
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
|
||||
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
||||
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\""
|
||||
|
||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||
@@ -2313,7 +2315,6 @@ compile_OSL() {
|
||||
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
fi
|
||||
patch -d $_src -p1 < $SCRIPT_DIR/patches/osl.diff
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
@@ -2336,6 +2337,7 @@ compile_OSL() {
|
||||
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
|
||||
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
|
||||
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
|
||||
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
|
||||
@@ -2343,10 +2345,7 @@ compile_OSL() {
|
||||
cmake_d="$cmake_d -D USE_PARTIO=OFF"
|
||||
cmake_d="$cmake_d -D OSL_BUILD_MATERIALX=OFF"
|
||||
cmake_d="$cmake_d -D USE_QT=OFF"
|
||||
cmake_d="$cmake_d -D USE_Qt5=OFF"
|
||||
cmake_d="$cmake_d -D USE_PYTHON=OFF"
|
||||
cmake_d="$cmake_d -D USE_PARTIO=OFF"
|
||||
cmake_d="$cmake_d -D INSTALL_DOCS=OFF"
|
||||
|
||||
if [ $(uname -m) != "aarch64" ]; then
|
||||
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
||||
@@ -2368,7 +2367,10 @@ compile_OSL() {
|
||||
fi
|
||||
|
||||
if [ -d $INST/oiio ]; then
|
||||
cmake_d="$cmake_d -D OpenImageIO_ROOT=$INST/oiio"
|
||||
cmake_d="$cmake_d -D OPENIMAGEIO_ROOT_DIR=$INST/oiio"
|
||||
# HACK! SIC!!!!
|
||||
# Quiet incredible, but if root dir is given, path to lib is found, but not path to include...
|
||||
cmake_d="$cmake_d -D OPENIMAGEIO_INCLUDE_DIR=$INST/oiio/include"
|
||||
fi
|
||||
|
||||
if [ ! -z $LLVM_VERSION_FOUND ]; then
|
||||
@@ -2735,7 +2737,7 @@ _init_openvdb() {
|
||||
_git=false
|
||||
_inst=$INST/openvdb-$OPENVDB_VERSION_SHORT
|
||||
_inst_shortcut=$INST/openvdb
|
||||
|
||||
|
||||
_openvdb_source=$OPENVDB_SOURCE
|
||||
if [ "$WITH_NANOVDB" = true ]; then
|
||||
_openvdb_source=$NANOVDB_SOURCE
|
||||
@@ -2840,7 +2842,7 @@ compile_OPENVDB() {
|
||||
if [ -d $INST/blosc ]; then
|
||||
cmake_d="$cmake_d -D Blosc_ROOT=$INST/blosc"
|
||||
fi
|
||||
|
||||
|
||||
cmake $cmake_d ..
|
||||
|
||||
make -j$THREADS install
|
||||
@@ -3837,11 +3839,10 @@ install_DEB() {
|
||||
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
|
||||
git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \
|
||||
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
||||
libwayland-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \
|
||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
|
||||
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev"
|
||||
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev"
|
||||
# libglewmx-dev (broken in deb testing currently...)
|
||||
|
||||
VORBIS_USE=true
|
||||
@@ -3982,9 +3983,13 @@ install_DEB() {
|
||||
version_ge $_glew "1.7.0"
|
||||
if [ $? -eq 1 ]; then
|
||||
WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
|
||||
WARNING "Blender will not use system GLEW library"
|
||||
OSD_SKIP=true
|
||||
NO_SYSTEM_GLEW=true
|
||||
else
|
||||
WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
|
||||
WARNING "Blender will not use system GLEW library"
|
||||
NO_SYSTEM_GLEW=true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -4105,8 +4110,6 @@ install_DEB() {
|
||||
|
||||
|
||||
PRINT ""
|
||||
# Debian OIIO includes again libopencv, without even properly dealing with this dependency...
|
||||
OIIO_FORCE_BUILD=true
|
||||
if [ "$OIIO_SKIP" = true ]; then
|
||||
WARNING "Skipping OpenImageIO installation, as requested..."
|
||||
elif [ "$OIIO_FORCE_BUILD" = true ]; then
|
||||
@@ -4505,11 +4508,10 @@ install_RPM() {
|
||||
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison fontconfig-devel \
|
||||
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
|
||||
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||
wayland-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \
|
||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
||||
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
|
||||
gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel"
|
||||
gmp-devel pugixml-devel potrace-devel libharu-devel"
|
||||
|
||||
OPENJPEG_USE=true
|
||||
VORBIS_USE=true
|
||||
@@ -5087,11 +5089,10 @@ install_ARCH() {
|
||||
BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
|
||||
fi
|
||||
|
||||
_packages="$BASE_DEVEL git cmake fontconfig flex \
|
||||
_packages="$BASE_DEVEL git cmake fontconfig \
|
||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \
|
||||
zstd"
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu"
|
||||
|
||||
OPENJPEG_USE=true
|
||||
VORBIS_USE=true
|
||||
@@ -5955,6 +5956,12 @@ print_info() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NO_SYSTEM_GLEW" = true ]; then
|
||||
_1="-D WITH_SYSTEM_GLEW=OFF"
|
||||
PRINT " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
|
||||
if [ "$FFMPEG_SKIP" = false ]; then
|
||||
_1="-D WITH_CODEC_FFMPEG=ON"
|
||||
_2="-D FFMPEG_LIBRARIES='avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;`print_info_ffmpeglink`'"
|
||||
|
@@ -68,32 +68,3 @@
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
--- a/libavcodec/rl.c
|
||||
+++ b/libavcodec/rl.c
|
||||
@@ -71,7 +71,7 @@ av_cold void ff_rl_init(RLTable *rl,
|
||||
av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
|
||||
{
|
||||
int i, q;
|
||||
- VLC_TYPE table[1500][2] = {{0}};
|
||||
+ VLC_TYPE (*table)[2] = av_calloc(sizeof(VLC_TYPE), 1500 * 2);
|
||||
VLC vlc = { .table = table, .table_allocated = static_size };
|
||||
av_assert0(static_size <= FF_ARRAY_ELEMS(table));
|
||||
init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
|
||||
@@ -80,8 +80,10 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
|
||||
int qmul = q * 2;
|
||||
int qadd = (q - 1) | 1;
|
||||
|
||||
- if (!rl->rl_vlc[q])
|
||||
+ if (!rl->rl_vlc[q]){
|
||||
+ av_free(table);
|
||||
return;
|
||||
+ }
|
||||
|
||||
if (q == 0) {
|
||||
qmul = 1;
|
||||
@@ -113,4 +115,5 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
|
||||
rl->rl_vlc[q][i].run = run;
|
||||
}
|
||||
}
|
||||
+ av_free(table);
|
||||
}
|
||||
|
10
build_files/build_environment/patches/oidn.diff
Normal file
10
build_files/build_environment/patches/oidn.diff
Normal file
@@ -0,0 +1,10 @@
|
||||
--- external_openimagedenoise/cmake/oidn_ispc.cmake 2021-02-15 17:29:34.000000000 +0100
|
||||
+++ external_openimagedenoise/cmake/oidn_ispc.cmake2 2021-02-15 17:29:28.000000000 +0100
|
||||
@@ -98,7 +98,7 @@
|
||||
elseif(OIDN_ARCH STREQUAL "ARM64")
|
||||
set(ISPC_ARCHITECTURE "aarch64")
|
||||
if(APPLE)
|
||||
- set(ISPC_TARGET_OS "--target-os=ios")
|
||||
+ set(ISPC_TARGET_OS "--target-os=macos")
|
||||
endif()
|
||||
endif()
|
@@ -34,3 +34,24 @@ diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/incl
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
diff -Naur orig/src/libutil/ustring.cpp external_openimageio/src/libutil/ustring.cpp
|
||||
--- orig/src/libutil/ustring.cpp 2020-05-11 05:43:52.000000000 +0200
|
||||
+++ external_openimageio/src/libutil/ustring.cpp 2020-11-26 12:06:08.000000000 +0100
|
||||
@@ -337,6 +337,8 @@
|
||||
// the std::string to make it point to our chars! In such a case, the
|
||||
// destructor will be careful not to allow a deallocation.
|
||||
|
||||
+ // Disable internal std::string for Apple silicon based Macs
|
||||
+#if !(defined(__APPLE__) && defined(__arm64__))
|
||||
#if defined(__GNUC__) && !defined(_LIBCPP_VERSION) \
|
||||
&& defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
|
||||
// NEW gcc ABI
|
||||
@@ -382,7 +384,7 @@
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+#endif
|
||||
// Remaining cases - just assign the internal string. This may result
|
||||
// in double allocation for the chars. If you care about that, do
|
||||
// something special for your platform, much like we did for gcc and
|
23
build_files/build_environment/patches/openmp.diff
Normal file
23
build_files/build_environment/patches/openmp.diff
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/runtime/src/z_Linux_asm.S b/runtime/src/z_Linux_asm.S
|
||||
index 0d8885e..42aa5ad 100644
|
||||
--- a/runtime/src/z_Linux_asm.S
|
||||
+++ b/runtime/src/z_Linux_asm.S
|
||||
@@ -1540,10 +1540,12 @@ __kmp_unnamed_critical_addr:
|
||||
.comm .gomp_critical_user_,32,8
|
||||
.data
|
||||
.align 8
|
||||
- .global __kmp_unnamed_critical_addr
|
||||
-__kmp_unnamed_critical_addr:
|
||||
+ .global ___kmp_unnamed_critical_addr
|
||||
+___kmp_unnamed_critical_addr:
|
||||
.8byte .gomp_critical_user_
|
||||
- .size __kmp_unnamed_critical_addr,8
|
||||
+# if !(KMP_OS_DARWIN)
|
||||
+ .size ___kmp_unnamed_critical_addr,8
|
||||
+# endif
|
||||
#endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */
|
||||
|
||||
#if KMP_OS_LINUX
|
||||
|
||||
|
||||
|
@@ -1,3 +1,18 @@
|
||||
diff -Naur OpenShadingLanguage-Release-1.9.9/src/cmake/flexbison.cmake.rej external_osl/src/cmake/flexbison.cmake.rej
|
||||
--- OpenShadingLanguage-Release-1.9.9/src/cmake/flexbison.cmake.rej 1969-12-31 17:00:00 -0700
|
||||
+++ external_osl/src/cmake/flexbison.cmake.rej 2018-08-24 17:42:11 -0600
|
||||
@@ -0,0 +1,11 @@
|
||||
+--- src/cmake/flexbison.cmake 2018-05-01 16:39:02 -0600
|
||||
++++ src/cmake/flexbison.cmake 2018-08-24 10:24:03 -0600
|
||||
+@@ -77,7 +77,7 @@
|
||||
+ DEPENDS ${${compiler_headers}}
|
||||
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
+ ADD_CUSTOM_COMMAND ( OUTPUT ${flexoutputcxx}
|
||||
+- COMMAND ${FLEX_EXECUTABLE} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
|
||||
++ COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXTRA_OPTIONS} -o ${flexoutputcxx} "${CMAKE_CURRENT_SOURCE_DIR}/${flexsrc}"
|
||||
+ MAIN_DEPENDENCY ${flexsrc}
|
||||
+ DEPENDS ${${compiler_headers}}
|
||||
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
diff -Naur OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h external_osl/src/include/OSL/llvm_util.h
|
||||
--- OpenShadingLanguage-Release-1.9.9/src/include/OSL/llvm_util.h 2018-05-01 16:39:02 -0600
|
||||
+++ external_osl/src/include/OSL/llvm_util.h 2018-08-25 14:05:00 -0600
|
||||
@@ -48,50 +63,19 @@ diff -Naur org/CMakeLists.txt external_osl/CMakeLists.txt
|
||||
|
||||
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
||||
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 990f50d69..46ef7351d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -252,11 +252,9 @@ install (EXPORT OSL_EXPORTED_TARGETS
|
||||
FILE ${OSL_TARGETS_EXPORT_NAME}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
-osl_add_all_tests()
|
||||
-
|
||||
+if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT)
|
||||
+ osl_add_all_tests()
|
||||
+endif ()
|
||||
|
||||
if (NOT ${PROJECT_NAME}_IS_SUBPROJECT)
|
||||
include (packaging)
|
||||
diff -Naur external_osl_orig/src/cmake/externalpackages.cmake external_osl/src/cmake/externalpackages.cmake
|
||||
--- external_osl_orig/src/cmake/externalpackages.cmake 2021-06-01 13:44:18 -0600
|
||||
+++ external_osl/src/cmake/externalpackages.cmake 2021-06-28 07:44:32 -0600
|
||||
@@ -80,6 +80,7 @@
|
||||
|
||||
|
||||
checked_find_package (ZLIB REQUIRED) # Needed by several packages
|
||||
+checked_find_package (PNG REQUIRED) # Needed since OIIO needs it
|
||||
|
||||
# IlmBase & OpenEXR
|
||||
checked_find_package (OpenEXR REQUIRED
|
||||
diff -Naur external_osl_orig/src/liboslcomp/oslcomp.cpp external_osl/src/liboslcomp/oslcomp.cpp
|
||||
--- external_osl_orig/src/liboslcomp/oslcomp.cpp 2021-06-01 13:44:18 -0600
|
||||
+++ external_osl/src/liboslcomp/oslcomp.cpp 2021-06-28 09:11:06 -0600
|
||||
@@ -21,6 +21,13 @@
|
||||
#if !defined(__STDC_CONSTANT_MACROS)
|
||||
# define __STDC_CONSTANT_MACROS 1
|
||||
diff --git a/src/liboslexec/llvm_util.cpp b/src/liboslexec/llvm_util.cpp
|
||||
index 445f6400..3d468de2 100644
|
||||
--- a/src/liboslexec/llvm_util.cpp
|
||||
+++ b/src/liboslexec/llvm_util.cpp
|
||||
@@ -3430,8 +3430,9 @@ LLVM_Util::call_function (llvm::Value *func, cspan<llvm::Value *> args)
|
||||
#endif
|
||||
//llvm_gen_debug_printf (std::string("start ") + std::string(name));
|
||||
#if OSL_LLVM_VERSION >= 110
|
||||
- OSL_DASSERT(llvm::isa<llvm::Function>(func));
|
||||
- llvm::Value *r = builder().CreateCall(llvm::cast<llvm::Function>(func), llvm::ArrayRef<llvm::Value *>(args.data(), args.size()));
|
||||
+ llvm::Value* r = builder().CreateCall(
|
||||
+ llvm::cast<llvm::FunctionType>(func->getType()->getPointerElementType()), func,
|
||||
+ llvm::ArrayRef<llvm::Value*>(args.data(), args.size()));
|
||||
#else
|
||||
llvm::Value *r = builder().CreateCall (func, llvm::ArrayRef<llvm::Value *>(args.data(), args.size()));
|
||||
#endif
|
||||
+
|
||||
+// clang uses CALLBACK in its templates which causes issues if it is already defined
|
||||
+#ifdef _WIN32 && defined(CALLBACK)
|
||||
+# undef CALLBACK
|
||||
+#endif
|
||||
+
|
||||
+//
|
||||
#include <clang/Basic/TargetInfo.h>
|
||||
#include <clang/Frontend/CompilerInstance.h>
|
||||
#include <clang/Frontend/TextDiagnosticPrinter.h>
|
||||
|
@@ -8,9 +8,6 @@ IGNORE_SOURCE = (
|
||||
# specific source files
|
||||
"extern/audaspace/",
|
||||
|
||||
# Use for `WIN32` only.
|
||||
"source/creator/blender_launcher_win32.c",
|
||||
|
||||
# specific source files
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
|
||||
|
@@ -82,7 +82,7 @@ def create_nb_project_main():
|
||||
make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
|
||||
make_exe_basename = os.path.basename(make_exe)
|
||||
|
||||
# --------------- NetBeans specific.
|
||||
# --------------- NB specific
|
||||
defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
|
||||
defines += [cdef.replace("#define", "").strip() for cdef in cmake_compiler_defines()]
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
set(WITH_ASSERT_ABORT ON CACHE BOOL "" FORCE)
|
||||
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPILER_ASAN ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_DEBUG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_NATIVE_ONLY ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GTESTS ON CACHE BOOL "" FORCE)
|
||||
|
@@ -29,7 +29,6 @@ set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
|
@@ -30,7 +30,6 @@ set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
|
@@ -404,7 +404,7 @@ endif()
|
||||
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
||||
@@ -480,8 +480,10 @@ else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
|
||||
endif()
|
||||
|
||||
# Clang has too low template depth of 128 for libmv.
|
||||
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
||||
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
|
||||
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
endif()
|
||||
|
||||
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
||||
# libraries as Blender with a different version or build options.
|
||||
|
@@ -581,6 +581,8 @@ if(WITH_GHOST_WAYLAND)
|
||||
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
||||
pkg_check_modules(dbus REQUIRED dbus-1)
|
||||
|
||||
set(WITH_GL_EGL ON)
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${wayland-client_LINK_LIBRARIES}
|
||||
${wayland-egl_LINK_LIBRARIES}
|
||||
|
@@ -1,11 +1,8 @@
|
||||
Pipeline Config
|
||||
===============
|
||||
|
||||
This configuration file is used by buildbot new build pipeline for the `update-code` step.
|
||||
This configuration file is used by buildbot new pipeline for the `update-code` step.
|
||||
|
||||
It will also be used by the `../utils/make_update.py` script in the near future.
|
||||
It will soon be used by the ../utils/make_update.py script.
|
||||
|
||||
NOTES:
|
||||
* Keep both `yaml` and `json` files in sync until deployment of build pipeline updates.
|
||||
* The `json` file be removed once all branches are running with the `yaml` file.
|
||||
* Expected buildbot pipeline update is *Friday, July 30th* or *Monday August, 2nd*.
|
||||
Both buildbot and developers will eventually use the same configuration file.
|
||||
|
@@ -41,7 +41,7 @@
|
||||
},
|
||||
"cuda11":
|
||||
{
|
||||
"version": "11.4"
|
||||
"version": "11.3"
|
||||
}
|
||||
},
|
||||
"cmake":
|
||||
|
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# Used by Buildbot build pipeline make_update.py script only for now
|
||||
# We intended to update the make_update.py in the branches to use this file eventually
|
||||
#
|
||||
update-code:
|
||||
git:
|
||||
submodules:
|
||||
- branch: master
|
||||
commit_id: HEAD
|
||||
path: release/scripts/addons
|
||||
- branch: master
|
||||
commit_id: HEAD
|
||||
path: release/scripts/addons_contrib
|
||||
- branch: master
|
||||
commit_id: HEAD
|
||||
path: release/datafiles/locale
|
||||
- branch: master
|
||||
commit_id: HEAD
|
||||
path: source/tools
|
||||
svn:
|
||||
libraries:
|
||||
darwin-arm64:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/darwin_arm64
|
||||
darwin-x86_64:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/darwin
|
||||
linux-x86_64:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/linux_centos7_x86_64
|
||||
windows-amd64:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/win64_vc15
|
||||
tests:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/tests
|
||||
benchmarks:
|
||||
branch: trunk
|
||||
commit_id: HEAD
|
||||
path: lib/benchmarks
|
||||
|
||||
#
|
||||
# Buildbot only configs
|
||||
#
|
||||
buildbot:
|
||||
gcc:
|
||||
version: '9.0.0'
|
||||
cuda10:
|
||||
version: '10.1.0'
|
||||
cuda11:
|
||||
version: '11.4.0'
|
||||
optix:
|
||||
version: '7.1.0'
|
||||
cmake:
|
||||
default:
|
||||
version: any
|
||||
overrides: {}
|
||||
darwin-arm64:
|
||||
overrides: {}
|
||||
darwin-x86_64:
|
||||
overrides: {}
|
||||
linux-x86_64:
|
||||
overrides: {}
|
||||
windows-amd64:
|
||||
overrides: {}
|
@@ -1,9 +1,9 @@
|
||||
echo No explicit msvc version requested, autodetecting version.
|
||||
|
||||
call "%~dp0\detect_msvc2019.cmd"
|
||||
call "%~dp0\detect_msvc2017.cmd"
|
||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||
|
||||
call "%~dp0\detect_msvc2017.cmd"
|
||||
call "%~dp0\detect_msvc2019.cmd"
|
||||
if %ERRORLEVEL% EQU 0 goto DetectionComplete
|
||||
|
||||
call "%~dp0\detect_msvc2022.cmd"
|
||||
|
@@ -122,7 +122,7 @@ is a full-featured 3D application. It supports the entirety of the 3D pipeline -
|
||||
'''modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
|
||||
|
||||
Use Blender to create 3D images and animations, films and commercials, content for games, '''
|
||||
r'''architectural and industrial visualizations, and scientific visualizations.
|
||||
r'''architectural and industrial visualizatons, and scientific visualizations.
|
||||
|
||||
https://www.blender.org''')
|
||||
|
||||
|
@@ -12,7 +12,6 @@ such cases, lock the interface (Render → Lock Interface or
|
||||
Below is an example of a mesh that is altered from a handler:
|
||||
"""
|
||||
|
||||
|
||||
def frame_change_pre(scene):
|
||||
# A triangle that shifts in the z direction
|
||||
zshift = scene.frame_current * 0.1
|
||||
|
@@ -16,12 +16,10 @@ execution_queue = queue.Queue()
|
||||
def run_in_main_thread(function):
|
||||
execution_queue.put(function)
|
||||
|
||||
|
||||
def execute_queued_functions():
|
||||
while not execution_queue.empty():
|
||||
function = execution_queue.get()
|
||||
function()
|
||||
return 1.0
|
||||
|
||||
|
||||
bpy.app.timers.register(execute_queued_functions)
|
||||
|
@@ -31,13 +31,11 @@ owner = object()
|
||||
|
||||
subscribe_to = bpy.context.object.location
|
||||
|
||||
|
||||
def msgbus_callback(*args):
|
||||
# This will print:
|
||||
# Something changed! (1, 2, 3)
|
||||
print("Something changed!", args)
|
||||
|
||||
|
||||
bpy.msgbus.subscribe_rna(
|
||||
key=subscribe_to,
|
||||
owner=owner,
|
||||
|
@@ -44,7 +44,7 @@ class OBJECT_OT_object_to_curve(bpy.types.Operator):
|
||||
# Remove temporary curve.
|
||||
obj.to_curve_clear()
|
||||
# Invoke to_curve() with applying modifiers.
|
||||
curve_with_modifiers = obj.to_curve(depsgraph, apply_modifiers=True)
|
||||
curve_with_modifiers = obj.to_curve(depsgraph, apply_modifiers = True)
|
||||
self.report({'INFO'}, f"{len(curve_with_modifiers.splines)} splines in new curve with modifiers.")
|
||||
# Remove temporary curve.
|
||||
obj.to_curve_clear()
|
||||
|
@@ -21,7 +21,6 @@ batch = batch_for_shader(
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_sampler("image", texture)
|
||||
|
@@ -1047,7 +1047,6 @@ context_type_map = {
|
||||
"annotation_data": ("GreasePencil", False),
|
||||
"annotation_data_owner": ("ID", False),
|
||||
"armature": ("Armature", False),
|
||||
"asset_library": ("AssetLibraryReference", False),
|
||||
"bone": ("Bone", False),
|
||||
"brush": ("Brush", False),
|
||||
"camera": ("Camera", False),
|
||||
@@ -1114,7 +1113,6 @@ context_type_map = {
|
||||
"texture_slot": ("MaterialTextureSlot", False),
|
||||
"texture_user": ("ID", False),
|
||||
"texture_user_property": ("Property", False),
|
||||
"ui_list": ("UIList", False),
|
||||
"vertex_paint_object": ("Object", False),
|
||||
"view_layer": ("ViewLayer", False),
|
||||
"visible_bones": ("EditBone", True),
|
||||
|
@@ -265,12 +265,6 @@ protected:
|
||||
*/
|
||||
void setSpecs(Specs specs);
|
||||
|
||||
/**
|
||||
* Sets the audio output specification of the device.
|
||||
* \param specs The output specification.
|
||||
*/
|
||||
void setSpecs(DeviceSpecs specs);
|
||||
|
||||
/**
|
||||
* Empty default constructor. To setup the device call the function create()
|
||||
* and to uninitialize call destroy().
|
||||
|
6
extern/audaspace/include/respec/Mixer.h
vendored
6
extern/audaspace/include/respec/Mixer.h
vendored
@@ -87,12 +87,6 @@ public:
|
||||
*/
|
||||
void setSpecs(Specs specs);
|
||||
|
||||
/**
|
||||
* Sets the target specification for superposing.
|
||||
* \param specs The target specification.
|
||||
*/
|
||||
void setSpecs(DeviceSpecs specs);
|
||||
|
||||
/**
|
||||
* Mixes a buffer.
|
||||
* \param buffer The buffer to superpose.
|
||||
|
@@ -78,7 +78,6 @@ void PulseAudioDevice::runMixingThread()
|
||||
if(shouldStop())
|
||||
{
|
||||
AUD_pa_stream_cork(m_stream, 1, nullptr, nullptr);
|
||||
AUD_pa_stream_flush(m_stream, nullptr, nullptr);
|
||||
doStop();
|
||||
return;
|
||||
}
|
||||
@@ -87,10 +86,7 @@ void PulseAudioDevice::runMixingThread()
|
||||
if(AUD_pa_stream_is_corked(m_stream))
|
||||
AUD_pa_stream_cork(m_stream, 0, nullptr, nullptr);
|
||||
|
||||
// similar to AUD_pa_mainloop_iterate(m_mainloop, false, nullptr); except with a longer timeout
|
||||
AUD_pa_mainloop_prepare(m_mainloop, 1 << 14);
|
||||
AUD_pa_mainloop_poll(m_mainloop);
|
||||
AUD_pa_mainloop_dispatch(m_mainloop);
|
||||
AUD_pa_mainloop_iterate(m_mainloop, true, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,6 @@ PULSEAUDIO_SYMBOL(pa_context_unref);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_begin_write);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_connect_playback);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_cork);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_flush);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_is_corked);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_new);
|
||||
PULSEAUDIO_SYMBOL(pa_stream_set_buffer_attr);
|
||||
@@ -36,6 +35,3 @@ PULSEAUDIO_SYMBOL(pa_mainloop_free);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_get_api);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_new);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_iterate);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_prepare);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_poll);
|
||||
PULSEAUDIO_SYMBOL(pa_mainloop_dispatch);
|
||||
|
201
extern/audaspace/plugins/wasapi/WASAPIDevice.cpp
vendored
201
extern/audaspace/plugins/wasapi/WASAPIDevice.cpp
vendored
@@ -31,81 +31,65 @@ template <class T> void SafeRelease(T **ppT)
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT WASAPIDevice::setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size)
|
||||
void WASAPIDevice::runMixingThread()
|
||||
{
|
||||
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
|
||||
|
||||
UINT32 buffer_size;
|
||||
UINT32 padding;
|
||||
UINT32 length;
|
||||
data_t* buffer;
|
||||
|
||||
HRESULT result;
|
||||
IAudioRenderClient* render_client = nullptr;
|
||||
|
||||
if(FAILED(result = m_audio_client->GetBufferSize(&buffer_size)))
|
||||
return result;
|
||||
{
|
||||
std::lock_guard<ILockable> lock(*this);
|
||||
|
||||
if(FAILED(result = m_audio_client->GetService(IID_IAudioRenderClient, reinterpret_cast<void**>(&render_client))))
|
||||
return result;
|
||||
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
|
||||
|
||||
if(FAILED(result = m_audio_client->GetCurrentPadding(&padding)))
|
||||
return result;
|
||||
if(FAILED(m_audio_client->GetBufferSize(&buffer_size)))
|
||||
goto init_error;
|
||||
|
||||
length = buffer_size - padding;
|
||||
if(FAILED(m_audio_client->GetService(IID_IAudioRenderClient, reinterpret_cast<void**>(&render_client))))
|
||||
goto init_error;
|
||||
|
||||
if(FAILED(result = render_client->GetBuffer(length, &buffer)))
|
||||
return result;
|
||||
if(FAILED(m_audio_client->GetCurrentPadding(&padding)))
|
||||
goto init_error;
|
||||
|
||||
mix((data_t*)buffer, length);
|
||||
length = buffer_size - padding;
|
||||
|
||||
if(FAILED(result = render_client->ReleaseBuffer(length, 0)))
|
||||
return result;
|
||||
if(FAILED(render_client->GetBuffer(length, &buffer)))
|
||||
goto init_error;
|
||||
|
||||
mix((data_t*)buffer, length);
|
||||
|
||||
if(FAILED(render_client->ReleaseBuffer(length, 0)))
|
||||
{
|
||||
init_error:
|
||||
SafeRelease(&render_client);
|
||||
doStop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_audio_client->Start();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void WASAPIDevice::runMixingThread()
|
||||
{
|
||||
UINT32 buffer_size;
|
||||
|
||||
IAudioRenderClient* render_client = nullptr;
|
||||
|
||||
std::chrono::milliseconds sleep_duration;
|
||||
|
||||
bool run_init = true;
|
||||
auto sleepDuration = std::chrono::milliseconds(buffer_size * 1000 / int(m_specs.rate) / 2);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
HRESULT result = S_OK;
|
||||
|
||||
{
|
||||
UINT32 padding;
|
||||
UINT32 length;
|
||||
data_t* buffer;
|
||||
std::lock_guard<ILockable> lock(*this);
|
||||
|
||||
if(run_init)
|
||||
{
|
||||
result = setupRenderClient(render_client, buffer_size);
|
||||
|
||||
if(FAILED(result))
|
||||
goto stop_thread;
|
||||
|
||||
sleep_duration = std::chrono::milliseconds(buffer_size * 1000 / int(m_specs.rate) / 2);
|
||||
}
|
||||
|
||||
if(FAILED(result = m_audio_client->GetCurrentPadding(&padding)))
|
||||
if(FAILED(m_audio_client->GetCurrentPadding(&padding)))
|
||||
goto stop_thread;
|
||||
|
||||
length = buffer_size - padding;
|
||||
|
||||
if(FAILED(result = render_client->GetBuffer(length, &buffer)))
|
||||
if(FAILED(render_client->GetBuffer(length, &buffer)))
|
||||
goto stop_thread;
|
||||
|
||||
mix((data_t*)buffer, length);
|
||||
|
||||
if(FAILED(result = render_client->ReleaseBuffer(length, 0)))
|
||||
if(FAILED(render_client->ReleaseBuffer(length, 0)))
|
||||
goto stop_thread;
|
||||
|
||||
// stop thread
|
||||
@@ -114,51 +98,53 @@ void WASAPIDevice::runMixingThread()
|
||||
stop_thread:
|
||||
m_audio_client->Stop();
|
||||
SafeRelease(&render_client);
|
||||
|
||||
if(result == AUDCLNT_E_DEVICE_INVALIDATED)
|
||||
{
|
||||
DeviceSpecs specs = m_specs;
|
||||
if(!setupDevice(specs))
|
||||
result = S_FALSE;
|
||||
else
|
||||
{
|
||||
setSpecs(specs);
|
||||
|
||||
run_init = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(result != AUDCLNT_E_DEVICE_INVALIDATED)
|
||||
{
|
||||
doStop();
|
||||
return;
|
||||
}
|
||||
doStop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(sleep_duration);
|
||||
std::this_thread::sleep_for(sleepDuration);
|
||||
}
|
||||
}
|
||||
|
||||
bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
|
||||
WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
|
||||
m_imm_device_enumerator(nullptr),
|
||||
m_imm_device(nullptr),
|
||||
m_audio_client(nullptr),
|
||||
|
||||
m_wave_format_extensible({})
|
||||
{
|
||||
SafeRelease(&m_audio_client);
|
||||
SafeRelease(&m_imm_device);
|
||||
// initialize COM if it hasn't happened yet
|
||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
|
||||
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
|
||||
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
|
||||
const IID IID_IAudioClient = __uuidof(IAudioClient);
|
||||
|
||||
if(FAILED(m_imm_device_enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &m_imm_device)))
|
||||
return false;
|
||||
|
||||
if(FAILED(m_imm_device->Activate(IID_IAudioClient, CLSCTX_ALL, nullptr, reinterpret_cast<void**>(&m_audio_client))))
|
||||
return false;
|
||||
|
||||
WAVEFORMATEXTENSIBLE wave_format_extensible_closest_match;
|
||||
WAVEFORMATEXTENSIBLE* closest_match_pointer = &wave_format_extensible_closest_match;
|
||||
|
||||
HRESULT result;
|
||||
|
||||
REFERENCE_TIME minimum_time = 0;
|
||||
REFERENCE_TIME buffer_duration;
|
||||
|
||||
if(FAILED(CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, reinterpret_cast<void**>(&m_imm_device_enumerator))))
|
||||
goto error;
|
||||
|
||||
if(FAILED(m_imm_device_enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &m_imm_device)))
|
||||
goto error;
|
||||
|
||||
if(FAILED(m_imm_device->Activate(IID_IAudioClient, CLSCTX_ALL, nullptr, reinterpret_cast<void**>(&m_audio_client))))
|
||||
goto error;
|
||||
|
||||
if(specs.channels == CHANNELS_INVALID)
|
||||
specs.channels = CHANNELS_STEREO;
|
||||
if(specs.format == FORMAT_INVALID)
|
||||
specs.format = FORMAT_FLOAT32;
|
||||
if(specs.rate == RATE_INVALID)
|
||||
specs.rate = RATE_48000;
|
||||
|
||||
switch(specs.format)
|
||||
{
|
||||
case FORMAT_U8:
|
||||
@@ -217,14 +203,12 @@ bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
|
||||
m_wave_format_extensible.Format.cbSize = 22;
|
||||
m_wave_format_extensible.Samples.wValidBitsPerSample = m_wave_format_extensible.Format.wBitsPerSample;
|
||||
|
||||
HRESULT result = m_audio_client->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, reinterpret_cast<const WAVEFORMATEX*>(&m_wave_format_extensible), reinterpret_cast<WAVEFORMATEX**>(&closest_match_pointer));
|
||||
result = m_audio_client->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, reinterpret_cast<const WAVEFORMATEX*>(&m_wave_format_extensible), reinterpret_cast<WAVEFORMATEX**>(&closest_match_pointer));
|
||||
|
||||
if(result == S_FALSE)
|
||||
{
|
||||
bool errored = false;
|
||||
|
||||
if(closest_match_pointer->Format.wFormatTag != WAVE_FORMAT_EXTENSIBLE)
|
||||
goto closest_match_error;
|
||||
goto error;
|
||||
|
||||
specs.channels = Channels(closest_match_pointer->Format.nChannels);
|
||||
specs.rate = closest_match_pointer->Format.nSamplesPerSec;
|
||||
@@ -236,7 +220,7 @@ bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
|
||||
else if(closest_match_pointer->Format.wBitsPerSample == 64)
|
||||
specs.format = FORMAT_FLOAT64;
|
||||
else
|
||||
goto closest_match_error;
|
||||
goto error;
|
||||
}
|
||||
else if(closest_match_pointer->SubFormat == KSDATAFORMAT_SUBTYPE_PCM)
|
||||
{
|
||||
@@ -255,81 +239,44 @@ bool WASAPIDevice::setupDevice(DeviceSpecs &specs)
|
||||
specs.format = FORMAT_S32;
|
||||
break;
|
||||
default:
|
||||
goto closest_match_error;
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
goto closest_match_error;
|
||||
goto error;
|
||||
|
||||
m_wave_format_extensible = *closest_match_pointer;
|
||||
|
||||
if(false)
|
||||
{
|
||||
closest_match_error:
|
||||
errored = true;
|
||||
}
|
||||
|
||||
if(closest_match_pointer != &wave_format_extensible_closest_match)
|
||||
{
|
||||
CoTaskMemFree(closest_match_pointer);
|
||||
closest_match_pointer = &wave_format_extensible_closest_match;
|
||||
}
|
||||
|
||||
if(errored)
|
||||
return false;
|
||||
}
|
||||
else if(FAILED(result))
|
||||
return false;
|
||||
goto error;
|
||||
|
||||
if(FAILED(m_audio_client->GetDevicePeriod(nullptr, &minimum_time)))
|
||||
return false;
|
||||
goto error;
|
||||
|
||||
buffer_duration = REFERENCE_TIME(m_buffersize) * REFERENCE_TIME(10000000) / REFERENCE_TIME(specs.rate);
|
||||
buffer_duration = REFERENCE_TIME(buffersize) * REFERENCE_TIME(10000000) / REFERENCE_TIME(specs.rate);
|
||||
|
||||
if(minimum_time > buffer_duration)
|
||||
buffer_duration = minimum_time;
|
||||
|
||||
if(FAILED(m_audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, buffer_duration, 0, reinterpret_cast<WAVEFORMATEX*>(&m_wave_format_extensible), nullptr)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
WASAPIDevice::WASAPIDevice(DeviceSpecs specs, int buffersize) :
|
||||
m_buffersize(buffersize),
|
||||
m_imm_device_enumerator(nullptr),
|
||||
m_imm_device(nullptr),
|
||||
m_audio_client(nullptr),
|
||||
|
||||
m_wave_format_extensible({})
|
||||
{
|
||||
// initialize COM if it hasn't happened yet
|
||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
|
||||
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
|
||||
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
|
||||
|
||||
if(specs.channels == CHANNELS_INVALID)
|
||||
specs.channels = CHANNELS_STEREO;
|
||||
if(specs.format == FORMAT_INVALID)
|
||||
specs.format = FORMAT_FLOAT32;
|
||||
if(specs.rate == RATE_INVALID)
|
||||
specs.rate = RATE_48000;
|
||||
|
||||
if(FAILED(CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, reinterpret_cast<void**>(&m_imm_device_enumerator))))
|
||||
goto error;
|
||||
|
||||
if(!setupDevice(specs))
|
||||
goto error;
|
||||
|
||||
m_specs = specs;
|
||||
|
||||
if(FAILED(m_audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED, 0, buffer_duration, 0, reinterpret_cast<WAVEFORMATEX*>(&m_wave_format_extensible), nullptr)))
|
||||
goto error;
|
||||
|
||||
create();
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
if(closest_match_pointer != &wave_format_extensible_closest_match)
|
||||
CoTaskMemFree(closest_match_pointer);
|
||||
SafeRelease(&m_imm_device);
|
||||
SafeRelease(&m_imm_device_enumerator);
|
||||
SafeRelease(&m_audio_client);
|
||||
|
@@ -43,21 +43,16 @@ AUD_NAMESPACE_BEGIN
|
||||
class AUD_PLUGIN_API WASAPIDevice : public ThreadedDevice
|
||||
{
|
||||
private:
|
||||
int m_buffersize;
|
||||
IMMDeviceEnumerator* m_imm_device_enumerator;
|
||||
IMMDevice* m_imm_device;
|
||||
IAudioClient* m_audio_client;
|
||||
WAVEFORMATEXTENSIBLE m_wave_format_extensible;
|
||||
|
||||
AUD_LOCAL HRESULT setupRenderClient(IAudioRenderClient*& render_client, UINT32& buffer_size);
|
||||
|
||||
/**
|
||||
* Streaming thread main function.
|
||||
*/
|
||||
AUD_LOCAL void runMixingThread();
|
||||
|
||||
AUD_LOCAL bool setupDevice(DeviceSpecs& specs);
|
||||
|
||||
// delete copy constructor and operator=
|
||||
WASAPIDevice(const WASAPIDevice&) = delete;
|
||||
WASAPIDevice& operator=(const WASAPIDevice&) = delete;
|
||||
|
22
extern/audaspace/src/devices/SoftwareDevice.cpp
vendored
22
extern/audaspace/src/devices/SoftwareDevice.cpp
vendored
@@ -756,7 +756,6 @@ void SoftwareDevice::mix(data_t* buffer, int length)
|
||||
// get the buffer from the source
|
||||
pos = 0;
|
||||
len = length;
|
||||
eos = false;
|
||||
|
||||
// update 3D Info
|
||||
sound->update();
|
||||
@@ -843,27 +842,6 @@ void SoftwareDevice::setSpecs(Specs specs)
|
||||
{
|
||||
sound->setSpecs(specs);
|
||||
}
|
||||
|
||||
for(auto& sound : m_pausedSounds)
|
||||
{
|
||||
sound->setSpecs(specs);
|
||||
}
|
||||
}
|
||||
|
||||
void SoftwareDevice::setSpecs(DeviceSpecs specs)
|
||||
{
|
||||
m_specs = specs;
|
||||
m_mixer->setSpecs(specs);
|
||||
|
||||
for(auto& sound : m_playingSounds)
|
||||
{
|
||||
sound->setSpecs(specs.specs);
|
||||
}
|
||||
|
||||
for(auto& sound : m_pausedSounds)
|
||||
{
|
||||
sound->setSpecs(specs.specs);
|
||||
}
|
||||
}
|
||||
|
||||
SoftwareDevice::SoftwareDevice()
|
||||
|
30
extern/audaspace/src/respec/Mixer.cpp
vendored
30
extern/audaspace/src/respec/Mixer.cpp
vendored
@@ -21,25 +21,9 @@
|
||||
|
||||
AUD_NAMESPACE_BEGIN
|
||||
|
||||
Mixer::Mixer(DeviceSpecs specs)
|
||||
Mixer::Mixer(DeviceSpecs specs) :
|
||||
m_specs(specs)
|
||||
{
|
||||
setSpecs(specs);
|
||||
}
|
||||
|
||||
DeviceSpecs Mixer::getSpecs() const
|
||||
{
|
||||
return m_specs;
|
||||
}
|
||||
|
||||
void Mixer::setSpecs(Specs specs)
|
||||
{
|
||||
m_specs.specs = specs;
|
||||
}
|
||||
|
||||
void Mixer::setSpecs(DeviceSpecs specs)
|
||||
{
|
||||
m_specs = specs;
|
||||
|
||||
switch(m_specs.format)
|
||||
{
|
||||
case FORMAT_U8:
|
||||
@@ -70,6 +54,16 @@ void Mixer::setSpecs(DeviceSpecs specs)
|
||||
}
|
||||
}
|
||||
|
||||
DeviceSpecs Mixer::getSpecs() const
|
||||
{
|
||||
return m_specs;
|
||||
}
|
||||
|
||||
void Mixer::setSpecs(Specs specs)
|
||||
{
|
||||
m_specs.specs = specs;
|
||||
}
|
||||
|
||||
void Mixer::clear(int length)
|
||||
{
|
||||
m_buffer.assureSize(length * AUD_SAMPLE_SIZE(m_specs));
|
||||
|
1
extern/glog/README.blender
vendored
1
extern/glog/README.blender
vendored
@@ -7,4 +7,3 @@ Local modifications:
|
||||
checks for functions and so are needed.
|
||||
* Added special definitions of HAVE_SNPRINTF and HAVE_LIB_GFLAGS
|
||||
in Windows' specific config.h.
|
||||
* Silenced syscall deprecation warnings on macOS >= 10.12.
|
||||
|
2
extern/glog/src/raw_logging.cc
vendored
2
extern/glog/src/raw_logging.cc
vendored
@@ -59,7 +59,7 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)) && (!(defined OS_MACOSX))
|
||||
#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
|
||||
# define safe_write(fd, s, len) syscall(SYS_write, fd, s, len)
|
||||
#else
|
||||
// Not so safe, but what can you do?
|
||||
|
6
extern/glog/src/utilities.cc
vendored
6
extern/glog/src/utilities.cc
vendored
@@ -259,13 +259,7 @@ pid_t GetTID() {
|
||||
#endif
|
||||
static bool lacks_gettid = false;
|
||||
if (!lacks_gettid) {
|
||||
#ifdef OS_MACOSX
|
||||
uint64_t tid64;
|
||||
const int error = pthread_threadid_np(NULL, &tid64);
|
||||
pid_t tid = error ? -1 : (pid_t)tid64;
|
||||
#else
|
||||
pid_t tid = syscall(__NR_gettid);
|
||||
#endif
|
||||
if (tid != -1) {
|
||||
return tid;
|
||||
}
|
||||
|
2
extern/rangetree/intern/generic_alloc_impl.h
vendored
2
extern/rangetree/intern/generic_alloc_impl.h
vendored
@@ -32,7 +32,7 @@
|
||||
* - #TPOOL_STRUCT: Name for pool struct name.
|
||||
* - #TPOOL_CHUNK_SIZE: Chunk size (optional), use 64kb when not defined.
|
||||
*
|
||||
* \note #TPOOL_ALLOC_TYPE must be at least `sizeof(void *)`.
|
||||
* \note #TPOOL_ALLOC_TYPE must be at least ``sizeof(void *)``.
|
||||
*
|
||||
* Defines the API, uses #TPOOL_IMPL_PREFIX to prefix each function.
|
||||
*
|
||||
|
@@ -49,9 +49,9 @@
|
||||
|
||||
#include "atomic_ops_utils.h"
|
||||
|
||||
#if defined(__arm__) || defined(__riscv)
|
||||
/* Attempt to fix compilation error on Debian armel and RISC-V kernels.
|
||||
* Both architectures do have both 32 and 64bit atomics, however
|
||||
#if defined(__arm__)
|
||||
/* Attempt to fix compilation error on Debian armel kernel.
|
||||
* arm7 architecture does have both 32 and 64bit atomics, however
|
||||
* its gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
|
||||
*/
|
||||
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
|
||||
|
@@ -307,9 +307,9 @@ if(WITH_CYCLES_LOGGING)
|
||||
)
|
||||
endif()
|
||||
|
||||
# NaN debugging
|
||||
if(WITH_CYCLES_DEBUG_NAN)
|
||||
add_definitions(-DWITH_CYCLES_DEBUG_NAN)
|
||||
# Debugging capabilities (debug passes etc).
|
||||
if(WITH_CYCLES_DEBUG)
|
||||
add_definitions(-DWITH_CYCLES_DEBUG)
|
||||
endif()
|
||||
|
||||
if(NOT OPENIMAGEIO_PUGIXML_FOUND)
|
||||
|
@@ -235,12 +235,9 @@ def system_info():
|
||||
|
||||
|
||||
def list_render_passes(scene, srl):
|
||||
crl = srl.cycles
|
||||
|
||||
# Combined pass.
|
||||
# Builtin Blender passes.
|
||||
yield ("Combined", "RGBA", 'COLOR')
|
||||
|
||||
# Data passes.
|
||||
if srl.use_pass_z: yield ("Depth", "Z", 'VALUE')
|
||||
if srl.use_pass_mist: yield ("Mist", "Z", 'VALUE')
|
||||
if srl.use_pass_normal: yield ("Normal", "XYZ", 'VECTOR')
|
||||
@@ -248,8 +245,8 @@ def list_render_passes(scene, srl):
|
||||
if srl.use_pass_uv: yield ("UV", "UVA", 'VECTOR')
|
||||
if srl.use_pass_object_index: yield ("IndexOB", "X", 'VALUE')
|
||||
if srl.use_pass_material_index: yield ("IndexMA", "X", 'VALUE')
|
||||
|
||||
# Light passes.
|
||||
if srl.use_pass_shadow: yield ("Shadow", "RGB", 'COLOR')
|
||||
if srl.use_pass_ambient_occlusion: yield ("AO", "RGB", 'COLOR')
|
||||
if srl.use_pass_diffuse_direct: yield ("DiffDir", "RGB", 'COLOR')
|
||||
if srl.use_pass_diffuse_indirect: yield ("DiffInd", "RGB", 'COLOR')
|
||||
if srl.use_pass_diffuse_color: yield ("DiffCol", "RGB", 'COLOR')
|
||||
@@ -259,16 +256,19 @@ def list_render_passes(scene, srl):
|
||||
if srl.use_pass_transmission_direct: yield ("TransDir", "RGB", 'COLOR')
|
||||
if srl.use_pass_transmission_indirect: yield ("TransInd", "RGB", 'COLOR')
|
||||
if srl.use_pass_transmission_color: yield ("TransCol", "RGB", 'COLOR')
|
||||
if crl.use_pass_volume_direct: yield ("VolumeDir", "RGB", 'COLOR')
|
||||
if crl.use_pass_volume_indirect: yield ("VolumeInd", "RGB", 'COLOR')
|
||||
if srl.use_pass_emit: yield ("Emit", "RGB", 'COLOR')
|
||||
if srl.use_pass_environment: yield ("Env", "RGB", 'COLOR')
|
||||
if srl.use_pass_shadow: yield ("Shadow", "RGB", 'COLOR')
|
||||
if srl.use_pass_ambient_occlusion: yield ("AO", "RGB", 'COLOR')
|
||||
|
||||
# Debug passes.
|
||||
# Cycles specific passes.
|
||||
crl = srl.cycles
|
||||
if crl.pass_debug_render_time: yield ("Debug Render Time", "X", 'VALUE')
|
||||
if crl.pass_debug_bvh_traversed_nodes: yield ("Debug BVH Traversed Nodes", "X", 'VALUE')
|
||||
if crl.pass_debug_bvh_traversed_instances: yield ("Debug BVH Traversed Instances", "X", 'VALUE')
|
||||
if crl.pass_debug_bvh_intersections: yield ("Debug BVH Intersections", "X", 'VALUE')
|
||||
if crl.pass_debug_ray_bounces: yield ("Debug Ray Bounces", "X", 'VALUE')
|
||||
if crl.pass_debug_sample_count: yield ("Debug Sample Count", "X", 'VALUE')
|
||||
if crl.use_pass_volume_direct: yield ("VolumeDir", "RGB", 'COLOR')
|
||||
if crl.use_pass_volume_indirect: yield ("VolumeInd", "RGB", 'COLOR')
|
||||
|
||||
# Cryptomatte passes.
|
||||
crypto_depth = (srl.pass_cryptomatte_depth + 1) // 2
|
||||
|
@@ -263,7 +263,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
name="Use Denoising",
|
||||
description="Denoise the rendered image",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
use_preview_denoising: BoolProperty(
|
||||
name="Use Viewport Denoising",
|
||||
@@ -483,7 +482,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
transparent_max_bounces: IntProperty(
|
||||
name="Transparent Max Bounces",
|
||||
description="Maximum number of transparent bounces. This is independent of maximum number of other bounces ",
|
||||
description="Maximum number of transparent bounces",
|
||||
min=0, max=1024,
|
||||
default=8,
|
||||
)
|
||||
@@ -1255,19 +1254,12 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
|
||||
)
|
||||
|
||||
shadow_terminator_offset: FloatProperty(
|
||||
name="Shadow Terminator Shading Offset",
|
||||
name="Shadow Terminator Offset",
|
||||
description="Push the shadow terminator towards the light to hide artifacts on low poly geometry",
|
||||
min=0.0, max=1.0,
|
||||
default=0.0,
|
||||
)
|
||||
|
||||
shadow_terminator_geometry_offset: FloatProperty(
|
||||
name="Shadow Terminator Geometry Offset",
|
||||
description="Offset rays from the surface to reduce shadow terminator artifact on low poly geometry. Only affects triangles at grazing angles to light",
|
||||
min=0.0, max=1.0,
|
||||
default=0.1,
|
||||
)
|
||||
|
||||
is_shadow_catcher: BoolProperty(
|
||||
name="Shadow Catcher",
|
||||
description="Only render shadows on this object, for compositing renders into real footage",
|
||||
@@ -1325,6 +1317,30 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
|
||||
pass_debug_bvh_traversed_nodes: BoolProperty(
|
||||
name="Debug BVH Traversed Nodes",
|
||||
description="Store Debug BVH Traversed Nodes pass",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
pass_debug_bvh_traversed_instances: BoolProperty(
|
||||
name="Debug BVH Traversed Instances",
|
||||
description="Store Debug BVH Traversed Instances pass",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
pass_debug_bvh_intersections: BoolProperty(
|
||||
name="Debug BVH Intersections",
|
||||
description="Store Debug BVH Intersections",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
pass_debug_ray_bounces: BoolProperty(
|
||||
name="Debug Ray Bounces",
|
||||
description="Store Debug Ray Bounces pass",
|
||||
default=False,
|
||||
update=update_render_passes,
|
||||
)
|
||||
pass_debug_render_time: BoolProperty(
|
||||
name="Debug Render Time",
|
||||
description="Render time in milliseconds per sample and pixel",
|
||||
|
@@ -485,12 +485,10 @@ class CYCLES_RENDER_PT_light_paths_max_bounces(CyclesButtonsPanel, Panel):
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "diffuse_bounces", text="Diffuse")
|
||||
col.prop(cscene, "glossy_bounces", text="Glossy")
|
||||
col.prop(cscene, "transparent_max_bounces", text="Transparency")
|
||||
col.prop(cscene, "transmission_bounces", text="Transmission")
|
||||
col.prop(cscene, "volume_bounces", text="Volume")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "transparent_max_bounces", text="Transparent")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_light_paths_clamping(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Clamping"
|
||||
@@ -936,6 +934,29 @@ class CYCLES_RENDER_PT_passes_crypto(CyclesButtonsPanel, ViewLayerCryptomattePan
|
||||
bl_parent_id = "CYCLES_RENDER_PT_passes"
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_passes_debug(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Debug"
|
||||
bl_context = "view_layer"
|
||||
bl_parent_id = "CYCLES_RENDER_PT_passes"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
import _cycles
|
||||
return _cycles.with_cycles_debug
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
|
||||
cycles_view_layer = context.view_layer.cycles
|
||||
|
||||
layout.prop(cycles_view_layer, "pass_debug_bvh_traversed_nodes")
|
||||
layout.prop(cycles_view_layer, "pass_debug_bvh_traversed_instances")
|
||||
layout.prop(cycles_view_layer, "pass_debug_bvh_intersections")
|
||||
layout.prop(cycles_view_layer, "pass_debug_ray_bounces")
|
||||
|
||||
|
||||
class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, ViewLayerAOVPanel):
|
||||
bl_label = "Shader AOV"
|
||||
bl_context = "view_layer"
|
||||
@@ -1113,7 +1134,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
|
||||
col = row.column(align=True)
|
||||
col.operator("object.material_slot_add", icon='ADD', text="")
|
||||
col.operator("object.material_slot_remove", icon='REMOVE', text="")
|
||||
col.separator()
|
||||
|
||||
col.menu("MATERIAL_MT_context_menu", icon='DOWNARROW_HLT', text="")
|
||||
|
||||
if is_sortable:
|
||||
@@ -1128,15 +1149,16 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
|
||||
row.operator("object.material_slot_select", text="Select")
|
||||
row.operator("object.material_slot_deselect", text="Deselect")
|
||||
|
||||
row = layout.row()
|
||||
split = layout.split(factor=0.65)
|
||||
|
||||
if ob:
|
||||
row.template_ID(ob, "active_material", new="material.new")
|
||||
split.template_ID(ob, "active_material", new="material.new")
|
||||
row = split.row()
|
||||
|
||||
if slot:
|
||||
icon_link = 'MESH_DATA' if slot.link == 'DATA' else 'OBJECT_DATA'
|
||||
row.prop(slot, "link", text="", icon=icon_link, icon_only=True)
|
||||
|
||||
row.prop(slot, "link", text="")
|
||||
else:
|
||||
row.label()
|
||||
elif mat:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.separator()
|
||||
@@ -1201,31 +1223,20 @@ class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
if not CyclesButtonsPanel.poll(context):
|
||||
return False
|
||||
|
||||
ob = context.object
|
||||
return ob and has_geometry_visibility(ob)
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_shading_shadow_terminator(CyclesButtonsPanel, Panel):
|
||||
bl_label = "Shadow Terminator"
|
||||
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||
bl_context = "object"
|
||||
return CyclesButtonsPanel.poll(context) and (context.object)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
|
||||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
layout = self.layout
|
||||
ob = context.object
|
||||
cob = ob.cycles
|
||||
flow.prop(cob, "shadow_terminator_geometry_offset", text="Geometry Offset")
|
||||
flow.prop(cob, "shadow_terminator_offset", text="Shading Offset")
|
||||
|
||||
if has_geometry_visibility(ob):
|
||||
col = flow.column()
|
||||
col.prop(cob, "shadow_terminator_offset")
|
||||
|
||||
|
||||
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||
@@ -2294,6 +2305,7 @@ classes = (
|
||||
CYCLES_RENDER_PT_passes_data,
|
||||
CYCLES_RENDER_PT_passes_light,
|
||||
CYCLES_RENDER_PT_passes_crypto,
|
||||
CYCLES_RENDER_PT_passes_debug,
|
||||
CYCLES_RENDER_PT_passes_aov,
|
||||
CYCLES_RENDER_PT_filter,
|
||||
CYCLES_RENDER_PT_override,
|
||||
@@ -2304,7 +2316,6 @@ classes = (
|
||||
CYCLES_PT_context_material,
|
||||
CYCLES_OBJECT_PT_motion_blur,
|
||||
CYCLES_OBJECT_PT_shading,
|
||||
CYCLES_OBJECT_PT_shading_shadow_terminator,
|
||||
CYCLES_OBJECT_PT_visibility,
|
||||
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
||||
CYCLES_OBJECT_PT_visibility_culling,
|
||||
|
@@ -137,9 +137,9 @@ bool BlenderImageLoader::load_pixels(const ImageMetaData &metadata,
|
||||
/* Premultiply, byte images are always straight for Blender. */
|
||||
unsigned char *cp = (unsigned char *)pixels;
|
||||
for (size_t i = 0; i < num_pixels; i++, cp += channels) {
|
||||
cp[0] = (cp[0] * cp[3]) / 255;
|
||||
cp[1] = (cp[1] * cp[3]) / 255;
|
||||
cp[2] = (cp[2] * cp[3]) / 255;
|
||||
cp[0] = (cp[0] * cp[3]) >> 8;
|
||||
cp[1] = (cp[1] * cp[3]) >> 8;
|
||||
cp[2] = (cp[2] * cp[3]) >> 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1055,45 +1055,10 @@ static BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob)
|
||||
return BL::MeshSequenceCacheModifier(PointerRNA_NULL);
|
||||
}
|
||||
|
||||
/* Check whether some of "built-in" motion-related attributes are needed to be exported (includes
|
||||
* things like velocity from cache modifier, fluid simulation).
|
||||
*
|
||||
* NOTE: This code is run prior to object motion blur initialization. so can not access properties
|
||||
* set by `sync_object_motion_init()`. */
|
||||
static bool mesh_need_motion_attribute(BL::Object &b_ob, Scene *scene)
|
||||
{
|
||||
const Scene::MotionType need_motion = scene->need_motion();
|
||||
if (need_motion == Scene::MOTION_NONE) {
|
||||
/* Simple case: neither motion pass nor motion blur is needed, no need in the motion related
|
||||
* attributes. */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (need_motion == Scene::MOTION_BLUR) {
|
||||
/* A bit tricky and implicit case:
|
||||
* - Motion blur is enabled in the scene, which implies specific number of time steps for
|
||||
* objects.
|
||||
* - If the object has motion blur disabled on it, it will have 0 time steps.
|
||||
* - Motion attribute expects non-zero time steps.
|
||||
*
|
||||
* Avoid adding motion attributes if the motion blur will enforce 0 motion steps. */
|
||||
PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
|
||||
const bool use_motion = get_boolean(cobject, "use_motion_blur");
|
||||
if (!use_motion) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Motion pass which implies 3 motion steps, or motion blur which is not disabled on object
|
||||
* level. */
|
||||
return true;
|
||||
}
|
||||
|
||||
static void sync_mesh_cached_velocities(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
||||
{
|
||||
if (!mesh_need_motion_attribute(b_ob, scene)) {
|
||||
if (scene->need_motion() == Scene::MOTION_NONE)
|
||||
return;
|
||||
}
|
||||
|
||||
BL::MeshSequenceCacheModifier b_mesh_cache = object_mesh_cache_find(b_ob);
|
||||
|
||||
@@ -1137,9 +1102,8 @@ static void sync_mesh_cached_velocities(BL::Object &b_ob, Scene *scene, Mesh *me
|
||||
|
||||
static void sync_mesh_fluid_motion(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
||||
{
|
||||
if (!mesh_need_motion_attribute(b_ob, scene)) {
|
||||
if (scene->need_motion() == Scene::MOTION_NONE)
|
||||
return;
|
||||
}
|
||||
|
||||
BL::FluidDomainSettings b_fluid_domain = object_fluid_liquid_domain_find(b_ob);
|
||||
|
||||
|
@@ -109,23 +109,23 @@ void BlenderSync::sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob
|
||||
}
|
||||
|
||||
Geometry *geom = object->get_geometry();
|
||||
geom->set_use_motion_blur(false);
|
||||
geom->set_motion_steps(0);
|
||||
|
||||
int motion_steps = 0;
|
||||
bool use_motion_blur = false;
|
||||
uint motion_steps;
|
||||
|
||||
if (need_motion == Scene::MOTION_BLUR) {
|
||||
motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
|
||||
geom->set_motion_steps(motion_steps);
|
||||
if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
|
||||
use_motion_blur = true;
|
||||
geom->set_use_motion_blur(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
motion_steps = 3;
|
||||
geom->set_motion_steps(motion_steps);
|
||||
}
|
||||
|
||||
geom->set_use_motion_blur(use_motion_blur);
|
||||
geom->set_motion_steps(motion_steps);
|
||||
|
||||
motion.resize(motion_steps, transform_empty());
|
||||
|
||||
if (motion_steps) {
|
||||
@@ -290,12 +290,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
||||
bool is_shadow_catcher = get_boolean(cobject, "is_shadow_catcher");
|
||||
object->set_is_shadow_catcher(is_shadow_catcher);
|
||||
|
||||
float shadow_terminator_shading_offset = get_float(cobject, "shadow_terminator_offset");
|
||||
object->set_shadow_terminator_shading_offset(shadow_terminator_shading_offset);
|
||||
|
||||
float shadow_terminator_geometry_offset = get_float(cobject,
|
||||
"shadow_terminator_geometry_offset");
|
||||
object->set_shadow_terminator_geometry_offset(shadow_terminator_geometry_offset);
|
||||
float shadow_terminator_offset = get_float(cobject, "shadow_terminator_offset");
|
||||
object->set_shadow_terminator_offset(shadow_terminator_offset);
|
||||
|
||||
/* sync the asset name for Cryptomatte */
|
||||
BL::Object parent = b_ob.parent();
|
||||
|
@@ -1098,6 +1098,14 @@ void *CCL_python_module_init()
|
||||
PyModule_AddStringConstant(mod, "osl_version_string", "unknown");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
PyModule_AddObject(mod, "with_cycles_debug", Py_True);
|
||||
Py_INCREF(Py_True);
|
||||
#else
|
||||
PyModule_AddObject(mod, "with_cycles_debug", Py_False);
|
||||
Py_INCREF(Py_False);
|
||||
#endif
|
||||
|
||||
#ifdef WITH_NETWORK
|
||||
PyModule_AddObject(mod, "with_network", Py_True);
|
||||
Py_INCREF(Py_True);
|
||||
|
@@ -404,6 +404,8 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d)
|
||||
|
||||
Film *film = scene->film;
|
||||
|
||||
vector<Pass> prevpasses = scene->passes;
|
||||
|
||||
if (b_v3d) {
|
||||
film->set_display_pass(update_viewport_display_passes(b_v3d, scene->passes));
|
||||
}
|
||||
@@ -433,6 +435,11 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Pass::equals(prevpasses, scene->passes)) {
|
||||
film->tag_passes_update(scene, prevpasses, false);
|
||||
film->tag_modified();
|
||||
}
|
||||
}
|
||||
|
||||
/* Render Layer */
|
||||
@@ -538,6 +545,12 @@ PassType BlenderSync::get_pass_type(BL::RenderPass &b_pass)
|
||||
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE);
|
||||
MAP_PASS("BakeDifferential", PASS_BAKE_DIFFERENTIAL);
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
MAP_PASS("Debug BVH Traversed Nodes", PASS_BVH_TRAVERSED_NODES);
|
||||
MAP_PASS("Debug BVH Traversed Instances", PASS_BVH_TRAVERSED_INSTANCES);
|
||||
MAP_PASS("Debug BVH Intersections", PASS_BVH_INTERSECTIONS);
|
||||
MAP_PASS("Debug Ray Bounces", PASS_RAY_BOUNCES);
|
||||
#endif
|
||||
MAP_PASS("Debug Render Time", PASS_RENDER_TIME);
|
||||
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
|
||||
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
|
||||
@@ -590,10 +603,8 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
|
||||
for (BL::RenderPass &b_pass : b_rlay.passes) {
|
||||
PassType pass_type = get_pass_type(b_pass);
|
||||
|
||||
if (pass_type == PASS_MOTION &&
|
||||
(b_view_layer.use_motion_blur() && b_scene.render().use_motion_blur())) {
|
||||
if (pass_type == PASS_MOTION && view_layer.use_motion_blur)
|
||||
continue;
|
||||
}
|
||||
if (pass_type != PASS_NONE)
|
||||
Pass::add(pass_type, passes, b_pass.name().c_str());
|
||||
}
|
||||
@@ -635,6 +646,24 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
if (get_boolean(crl, "pass_debug_bvh_traversed_nodes")) {
|
||||
b_engine.add_pass("Debug BVH Traversed Nodes", 1, "X", b_view_layer.name().c_str());
|
||||
Pass::add(PASS_BVH_TRAVERSED_NODES, passes, "Debug BVH Traversed Nodes");
|
||||
}
|
||||
if (get_boolean(crl, "pass_debug_bvh_traversed_instances")) {
|
||||
b_engine.add_pass("Debug BVH Traversed Instances", 1, "X", b_view_layer.name().c_str());
|
||||
Pass::add(PASS_BVH_TRAVERSED_INSTANCES, passes, "Debug BVH Traversed Instances");
|
||||
}
|
||||
if (get_boolean(crl, "pass_debug_bvh_intersections")) {
|
||||
b_engine.add_pass("Debug BVH Intersections", 1, "X", b_view_layer.name().c_str());
|
||||
Pass::add(PASS_BVH_INTERSECTIONS, passes, "Debug BVH Intersections");
|
||||
}
|
||||
if (get_boolean(crl, "pass_debug_ray_bounces")) {
|
||||
b_engine.add_pass("Debug Ray Bounces", 1, "X", b_view_layer.name().c_str());
|
||||
Pass::add(PASS_RAY_BOUNCES, passes, "Debug Ray Bounces");
|
||||
}
|
||||
#endif
|
||||
if (get_boolean(crl, "pass_debug_render_time")) {
|
||||
b_engine.add_pass("Debug Render Time", 1, "X", b_view_layer.name().c_str());
|
||||
Pass::add(PASS_RENDER_TIME, passes, "Debug Render Time");
|
||||
@@ -718,13 +747,10 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
|
||||
DENOISING_CLEAN_ALL_PASSES);
|
||||
scene->film->set_denoising_prefiltered_pass(denoising.store_passes &&
|
||||
denoising.type == DENOISER_NLM);
|
||||
scene->film->set_pass_alpha_threshold(b_view_layer.pass_alpha_threshold());
|
||||
|
||||
if (!Pass::equals(passes, scene->passes)) {
|
||||
scene->film->tag_passes_update(scene, passes);
|
||||
scene->film->tag_modified();
|
||||
scene->integrator->tag_update(scene, Integrator::UPDATE_ALL);
|
||||
}
|
||||
scene->film->set_pass_alpha_threshold(b_view_layer.pass_alpha_threshold());
|
||||
scene->film->tag_passes_update(scene, passes);
|
||||
scene->integrator->tag_update(scene, Integrator::UPDATE_ALL);
|
||||
|
||||
return passes;
|
||||
}
|
||||
|
@@ -40,8 +40,8 @@ BlenderViewportParameters::BlenderViewportParameters(BL::SpaceView3D &b_v3d)
|
||||
BL::View3DShading shading = b_v3d.shading();
|
||||
PointerRNA cshading = RNA_pointer_get(&shading.ptr, "cycles");
|
||||
|
||||
/* We only copy the shading parameters if we are in look-dev mode.
|
||||
* Otherwise defaults are being used. These defaults mimic normal render settings. */
|
||||
/* We only copy the shading parameters if we are in look dev mode. otherwise
|
||||
* defaults are being used. These defaults mimic normal render settings */
|
||||
if (shading.type() == BL::View3DShading::type_RENDERED) {
|
||||
use_scene_world = shading.use_scene_world_render();
|
||||
use_scene_lights = shading.use_scene_lights_render();
|
||||
|
@@ -351,6 +351,9 @@ string CUDADevice::compile_kernel_get_common_cflags(
|
||||
if (extra_cflags) {
|
||||
cflags += string(" ") + string(extra_cflags);
|
||||
}
|
||||
# ifdef WITH_CYCLES_DEBUG
|
||||
cflags += " -D__KERNEL_DEBUG__";
|
||||
# endif
|
||||
|
||||
if (split) {
|
||||
cflags += " -D__SPLIT__";
|
||||
@@ -458,19 +461,18 @@ string CUDADevice::compile_kernel(const DeviceRequestedFeatures &requested_featu
|
||||
|
||||
const int nvcc_cuda_version = cuewCompilerVersion();
|
||||
VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << ".";
|
||||
if (nvcc_cuda_version < 101) {
|
||||
if (nvcc_cuda_version < 80) {
|
||||
printf(
|
||||
"Unsupported CUDA version %d.%d detected, "
|
||||
"you need CUDA 10.1 or newer.\n",
|
||||
"you need CUDA 8.0 or newer.\n",
|
||||
nvcc_cuda_version / 10,
|
||||
nvcc_cuda_version % 10);
|
||||
return string();
|
||||
}
|
||||
else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102 || nvcc_cuda_version == 111 ||
|
||||
nvcc_cuda_version == 112 || nvcc_cuda_version == 113 || nvcc_cuda_version == 114)) {
|
||||
else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102)) {
|
||||
printf(
|
||||
"CUDA version %d.%d detected, build may succeed but only "
|
||||
"CUDA 10.1 to 11.4 are officially supported.\n",
|
||||
"CUDA 10.1 and 10.2 are officially supported.\n",
|
||||
nvcc_cuda_version / 10,
|
||||
nvcc_cuda_version % 10);
|
||||
}
|
||||
|
@@ -57,8 +57,8 @@
|
||||
#include "util/util_function.h"
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_map.h"
|
||||
#include "util/util_opengl.h"
|
||||
#include "util/util_openimagedenoise.h"
|
||||
#include "util/util_opengl.h"
|
||||
#include "util/util_optimization.h"
|
||||
#include "util/util_progress.h"
|
||||
#include "util/util_system.h"
|
||||
|
@@ -233,6 +233,9 @@ class OptiXDevice : public CUDADevice {
|
||||
break;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
# if OPTIX_ABI_VERSION >= 41 && defined(WITH_CYCLES_DEBUG)
|
||||
options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
|
||||
# endif
|
||||
check_result_optix(optixDeviceContextCreate(cuContext, &options, &context));
|
||||
# ifdef WITH_CYCLES_LOGGING
|
||||
@@ -366,8 +369,13 @@ class OptiXDevice : public CUDADevice {
|
||||
|
||||
OptixModuleCompileOptions module_options = {};
|
||||
module_options.maxRegisterCount = 0; // Do not set an explicit register limit
|
||||
# ifdef WITH_CYCLES_DEBUG
|
||||
module_options.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_0;
|
||||
module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
|
||||
# else
|
||||
module_options.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_3;
|
||||
module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
|
||||
# endif
|
||||
|
||||
# if OPTIX_ABI_VERSION >= 41
|
||||
module_options.boundValues = nullptr;
|
||||
@@ -570,7 +578,11 @@ class OptiXDevice : public CUDADevice {
|
||||
|
||||
OptixPipelineLinkOptions link_options = {};
|
||||
link_options.maxTraceDepth = 1;
|
||||
# ifdef WITH_CYCLES_DEBUG
|
||||
link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_FULL;
|
||||
# else
|
||||
link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
|
||||
# endif
|
||||
# if OPTIX_ABI_VERSION < 24
|
||||
link_options.overrideUsesMotionBlur = motion_blur;
|
||||
# endif
|
||||
|
@@ -1968,6 +1968,10 @@ string OpenCLDevice::kernel_build_options(const string *debug_src)
|
||||
build_options += "-D__KERNEL_OPENCL_DEBUG__ ";
|
||||
}
|
||||
|
||||
# ifdef WITH_CYCLES_DEBUG
|
||||
build_options += "-D__KERNEL_DEBUG__ ";
|
||||
# endif
|
||||
|
||||
# ifdef WITH_NANOVDB
|
||||
if (info.has_nanovdb) {
|
||||
build_options += "-DWITH_NANOVDB ";
|
||||
|
@@ -380,16 +380,11 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
||||
|
||||
# warn for other versions
|
||||
if((CUDA_VERSION MATCHES "101") OR
|
||||
(CUDA_VERSION MATCHES "102") OR
|
||||
(CUDA_VERSION MATCHES "111") OR
|
||||
(CUDA_VERSION MATCHES "112") OR
|
||||
(CUDA_VERSION MATCHES "113") OR
|
||||
(CUDA_VERSION MATCHES "114"))
|
||||
if((CUDA_VERSION MATCHES "101") OR (CUDA_VERSION MATCHES "102") OR (CUDA_VERSION MATCHES "111"))
|
||||
else()
|
||||
message(WARNING
|
||||
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
|
||||
"build may succeed but only CUDA 10.1 to 11.4 are officially supported")
|
||||
"build may succeed but only CUDA 10.1, 10.2 and 11.1 are officially supported")
|
||||
endif()
|
||||
|
||||
# build for each arch
|
||||
@@ -444,6 +439,10 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
set(name ${name}_experimental)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_DEBUG)
|
||||
set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(cuda_flags ${cuda_flags}
|
||||
-D WITH_NANOVDB
|
||||
@@ -558,6 +557,11 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
||||
--use_fast_math
|
||||
-o ${output})
|
||||
|
||||
if(WITH_CYCLES_DEBUG)
|
||||
set(cuda_flags ${cuda_flags}
|
||||
-D __KERNEL_DEBUG__)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(cuda_flags ${cuda_flags}
|
||||
-D WITH_NANOVDB
|
||||
|
@@ -67,6 +67,8 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
isect->prim = PRIM_NONE;
|
||||
isect->object = OBJECT_NONE;
|
||||
|
||||
BVH_DEBUG_INIT();
|
||||
|
||||
/* traversal loop */
|
||||
do {
|
||||
do {
|
||||
@@ -116,6 +118,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
--stack_ptr;
|
||||
}
|
||||
}
|
||||
BVH_DEBUG_NEXT_NODE();
|
||||
}
|
||||
|
||||
/* if node is leaf, fetch triangle list */
|
||||
@@ -135,6 +138,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
switch (type & PRIMITIVE_ALL) {
|
||||
case PRIMITIVE_TRIANGLE: {
|
||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||
BVH_DEBUG_NEXT_INTERSECTION();
|
||||
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
||||
if (triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) {
|
||||
/* shadow ray early termination */
|
||||
@@ -147,6 +151,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
#if BVH_FEATURE(BVH_MOTION)
|
||||
case PRIMITIVE_MOTION_TRIANGLE: {
|
||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||
BVH_DEBUG_NEXT_INTERSECTION();
|
||||
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
||||
if (motion_triangle_intersect(
|
||||
kg, isect, P, dir, ray->time, visibility, object, prim_addr)) {
|
||||
@@ -164,6 +169,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
case PRIMITIVE_CURVE_RIBBON:
|
||||
case PRIMITIVE_MOTION_CURVE_RIBBON: {
|
||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||
BVH_DEBUG_NEXT_INTERSECTION();
|
||||
const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr);
|
||||
kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
|
||||
const bool hit = curve_intersect(
|
||||
@@ -195,6 +201,8 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL;
|
||||
|
||||
node_addr = kernel_tex_fetch(__object_node, object);
|
||||
|
||||
BVH_DEBUG_NEXT_INSTANCE();
|
||||
}
|
||||
}
|
||||
} while (node_addr != ENTRYPOINT_SENTINEL);
|
||||
|
@@ -42,6 +42,33 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
#define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0)
|
||||
|
||||
/* Debugging helpers. */
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
# define BVH_DEBUG_INIT() \
|
||||
do { \
|
||||
isect->num_traversed_nodes = 0; \
|
||||
isect->num_traversed_instances = 0; \
|
||||
isect->num_intersections = 0; \
|
||||
} while (0)
|
||||
# define BVH_DEBUG_NEXT_NODE() \
|
||||
do { \
|
||||
++isect->num_traversed_nodes; \
|
||||
} while (0)
|
||||
# define BVH_DEBUG_NEXT_INTERSECTION() \
|
||||
do { \
|
||||
++isect->num_intersections; \
|
||||
} while (0)
|
||||
# define BVH_DEBUG_NEXT_INSTANCE() \
|
||||
do { \
|
||||
++isect->num_traversed_instances; \
|
||||
} while (0)
|
||||
#else /* __KERNEL_DEBUG__ */
|
||||
# define BVH_DEBUG_INIT()
|
||||
# define BVH_DEBUG_NEXT_NODE()
|
||||
# define BVH_DEBUG_NEXT_INTERSECTION()
|
||||
# define BVH_DEBUG_NEXT_INSTANCE()
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_TYPES__ */
|
||||
|
@@ -71,86 +71,6 @@ ccl_device_inline float3 ray_offset(float3 P, float3 Ng)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This function should be used to compute a modified ray start position for
|
||||
* rays leaving from a surface. The algorithm slightly distorts flat surface
|
||||
* of a triangle. Surface is lifted by amount h along normal n in the incident
|
||||
* point. */
|
||||
|
||||
ccl_device_inline float3 smooth_surface_offset(KernelGlobals *kg, ShaderData *sd, float3 Ng)
|
||||
{
|
||||
float3 V[3], N[3];
|
||||
triangle_vertices_and_normals(kg, sd->prim, V, N);
|
||||
|
||||
const float u = sd->u, v = sd->v;
|
||||
const float w = 1 - u - v;
|
||||
float3 P = V[0] * u + V[1] * v + V[2] * w; /* Local space */
|
||||
float3 n = N[0] * u + N[1] * v + N[2] * w; /* We get away without normalization */
|
||||
|
||||
object_normal_transform(kg, sd, &n); /* Normal x scale, world space */
|
||||
|
||||
/* Parabolic approximation */
|
||||
float a = dot(N[2] - N[0], V[0] - V[2]);
|
||||
float b = dot(N[2] - N[1], V[1] - V[2]);
|
||||
float c = dot(N[1] - N[0], V[1] - V[0]);
|
||||
float h = a * u * (u - 1) + (a + b + c) * u * v + b * v * (v - 1);
|
||||
|
||||
/* Check flipped normals */
|
||||
if (dot(n, Ng) > 0) {
|
||||
/* Local linear envelope */
|
||||
float h0 = max(max(dot(V[1] - V[0], N[0]), dot(V[2] - V[0], N[0])), 0.0f);
|
||||
float h1 = max(max(dot(V[0] - V[1], N[1]), dot(V[2] - V[1], N[1])), 0.0f);
|
||||
float h2 = max(max(dot(V[0] - V[2], N[2]), dot(V[1] - V[2], N[2])), 0.0f);
|
||||
h0 = max(dot(V[0] - P, N[0]) + h0, 0.0f);
|
||||
h1 = max(dot(V[1] - P, N[1]) + h1, 0.0f);
|
||||
h2 = max(dot(V[2] - P, N[2]) + h2, 0.0f);
|
||||
h = max(min(min(h0, h1), h2), h * 0.5f);
|
||||
}
|
||||
else {
|
||||
float h0 = max(max(dot(V[0] - V[1], N[0]), dot(V[0] - V[2], N[0])), 0.0f);
|
||||
float h1 = max(max(dot(V[1] - V[0], N[1]), dot(V[1] - V[2], N[1])), 0.0f);
|
||||
float h2 = max(max(dot(V[2] - V[0], N[2]), dot(V[2] - V[1], N[2])), 0.0f);
|
||||
h0 = max(dot(P - V[0], N[0]) + h0, 0.0f);
|
||||
h1 = max(dot(P - V[1], N[1]) + h1, 0.0f);
|
||||
h2 = max(dot(P - V[2], N[2]) + h2, 0.0f);
|
||||
h = min(-min(min(h0, h1), h2), h * 0.5f);
|
||||
}
|
||||
|
||||
return n * h;
|
||||
}
|
||||
|
||||
/* Ray offset to avoid shadow terminator artifact. */
|
||||
|
||||
ccl_device_inline float3 ray_offset_shadow(KernelGlobals *kg, ShaderData *sd, float3 L)
|
||||
{
|
||||
float NL = dot(sd->N, L);
|
||||
bool transmit = (NL < 0.0f);
|
||||
float3 Ng = (transmit ? -sd->Ng : sd->Ng);
|
||||
float3 P = ray_offset(sd->P, Ng);
|
||||
|
||||
if ((sd->type & PRIMITIVE_ALL_TRIANGLE) && (sd->shader & SHADER_SMOOTH_NORMAL)) {
|
||||
const float offset_cutoff =
|
||||
kernel_tex_fetch(__objects, sd->object).shadow_terminator_geometry_offset;
|
||||
/* Do ray offset (heavy stuff) only for close to be terminated triangles:
|
||||
* offset_cutoff = 0.1f means that 10-20% of rays will be affected. Also
|
||||
* make a smooth transition near the threshold. */
|
||||
if (offset_cutoff > 0.0f) {
|
||||
float NgL = dot(Ng, L);
|
||||
float offset_amount = 0.0f;
|
||||
if (NL < offset_cutoff) {
|
||||
offset_amount = clamp(2.0f - (NgL + NL) / offset_cutoff, 0.0f, 1.0f);
|
||||
}
|
||||
else {
|
||||
offset_amount = clamp(1.0f - NgL / offset_cutoff, 0.0f, 1.0f);
|
||||
}
|
||||
if (offset_amount > 0.0f) {
|
||||
P += smooth_surface_offset(kg, sd, Ng) * offset_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return P;
|
||||
}
|
||||
|
||||
#if defined(__VOLUME_RECORD_ALL__) || (defined(__SHADOW_RECORD_ALL__) && defined(__KERNEL_CPU__))
|
||||
/* ToDo: Move to another file? */
|
||||
ccl_device int intersections_compare(const void *a, const void *b)
|
||||
|
@@ -462,7 +462,7 @@ ccl_device_inline int bsdf_sample(KernelGlobals *kg,
|
||||
else {
|
||||
/* Shadow terminator offset. */
|
||||
const float frequency_multiplier =
|
||||
kernel_tex_fetch(__objects, sd->object).shadow_terminator_shading_offset;
|
||||
kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
|
||||
if (frequency_multiplier > 1.0f) {
|
||||
*eval *= shift_cos_in(dot(*omega_in, sc->N), frequency_multiplier);
|
||||
}
|
||||
@@ -488,9 +488,12 @@ ccl_device_inline
|
||||
const float3 omega_in,
|
||||
float *pdf)
|
||||
{
|
||||
/* For curves use the smooth normal, particularly for ribbons the geometric
|
||||
* normal gives too much darkening otherwise. */
|
||||
const float3 Ng = (sd->type & PRIMITIVE_ALL_CURVE) ? sd->N : sd->Ng;
|
||||
float3 eval;
|
||||
|
||||
if (dot(sd->N, omega_in) >= 0.0f) {
|
||||
if (dot(Ng, omega_in) >= 0.0f) {
|
||||
switch (sc->type) {
|
||||
case CLOSURE_BSDF_DIFFUSE_ID:
|
||||
case CLOSURE_BSDF_BSSRDF_ID:
|
||||
@@ -586,7 +589,7 @@ ccl_device_inline
|
||||
}
|
||||
/* Shadow terminator offset. */
|
||||
const float frequency_multiplier =
|
||||
kernel_tex_fetch(__objects, sd->object).shadow_terminator_shading_offset;
|
||||
kernel_tex_fetch(__objects, sd->object).shadow_terminator_offset;
|
||||
if (frequency_multiplier > 1.0f) {
|
||||
eval *= shift_cos_in(dot(omega_in, sc->N), frequency_multiplier);
|
||||
}
|
||||
|
@@ -432,9 +432,9 @@ ccl_device void bssrdf_sample(const ShaderClosure *sc, float xi, float *r, float
|
||||
xi *= bssrdf->channels;
|
||||
|
||||
if (xi < 1.0f) {
|
||||
radius = (bssrdf->radius.x > 0.0f) ? bssrdf->radius.x :
|
||||
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y :
|
||||
bssrdf->radius.z;
|
||||
radius = (bssrdf->radius.x > 0.0f) ?
|
||||
bssrdf->radius.x :
|
||||
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y : bssrdf->radius.z;
|
||||
}
|
||||
else if (xi < 2.0f) {
|
||||
xi -= 1.0f;
|
||||
|
@@ -52,14 +52,15 @@ typedef struct TileInfo {
|
||||
tile_buffer_6, tile_buffer_7, tile_buffer_8, tile_buffer_9
|
||||
# define ccl_get_tile_buffer(id) \
|
||||
(id == 0 ? tile_buffer_1 : \
|
||||
id == 1 ? tile_buffer_2 : \
|
||||
id == 2 ? tile_buffer_3 : \
|
||||
id == 3 ? tile_buffer_4 : \
|
||||
id == 4 ? tile_buffer_5 : \
|
||||
id == 5 ? tile_buffer_6 : \
|
||||
id == 6 ? tile_buffer_7 : \
|
||||
id == 7 ? tile_buffer_8 : \
|
||||
tile_buffer_9)
|
||||
id == 1 ? \
|
||||
tile_buffer_2 : \
|
||||
id == 2 ? \
|
||||
tile_buffer_3 : \
|
||||
id == 3 ? tile_buffer_4 : \
|
||||
id == 4 ? tile_buffer_5 : \
|
||||
id == 5 ? tile_buffer_6 : \
|
||||
id == 6 ? tile_buffer_7 : \
|
||||
id == 7 ? tile_buffer_8 : tile_buffer_9)
|
||||
#else
|
||||
# ifdef __KERNEL_CUDA__
|
||||
# define CCL_FILTER_TILE_INFO ccl_global TileInfo *tile_info
|
||||
|
@@ -237,7 +237,7 @@ ccl_device bool curve_intersect_iterative(const float3 ray_dir,
|
||||
return false; /* Rejects NaNs */
|
||||
}
|
||||
|
||||
/* Back-face culling. */
|
||||
/* Backface culling. */
|
||||
const float3 R = normalize(Q - P);
|
||||
const float3 U = dradiusdu * R + dPdu;
|
||||
const float3 V = cross(dPdu, R);
|
||||
@@ -458,12 +458,10 @@ ccl_device_inline bool cylinder_culling_test(const float2 p1, const float2 p2, c
|
||||
return num * num <= r * r * den2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersects a ray with a quad with back-face culling
|
||||
* enabled. The quad v0,v1,v2,v3 is split into two triangles
|
||||
* v0,v1,v3 and v2,v3,v1. The edge v1,v2 decides which of the two
|
||||
* triangles gets intersected.
|
||||
*/
|
||||
/*! Intersects a ray with a quad with backface culling
|
||||
* enabled. The quad v0,v1,v2,v3 is split into two triangles
|
||||
* v0,v1,v3 and v2,v3,v1. The edge v1,v2 decides which of the two
|
||||
* triangles gets intersected. */
|
||||
ccl_device_inline bool ribbon_intersect_quad(const float ray_tfar,
|
||||
const float3 quad_v0,
|
||||
const float3 quad_v1,
|
||||
|
@@ -138,7 +138,7 @@ ccl_device_inline float4 primitive_surface_attribute_float4(KernelGlobals *kg,
|
||||
ccl_device_inline bool primitive_is_volume_attribute(const ShaderData *sd,
|
||||
const AttributeDescriptor desc)
|
||||
{
|
||||
return sd->type == PRIMITIVE_VOLUME;
|
||||
return (sd->object != OBJECT_NONE && desc.element == ATTR_ELEMENT_VOXEL);
|
||||
}
|
||||
|
||||
ccl_device_inline float primitive_volume_attribute_float(KernelGlobals *kg,
|
||||
|
@@ -75,22 +75,6 @@ ccl_device_inline void triangle_vertices(KernelGlobals *kg, int prim, float3 P[3
|
||||
P[2] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w + 2));
|
||||
}
|
||||
|
||||
/* Triangle vertex locations and vertex normals */
|
||||
|
||||
ccl_device_inline void triangle_vertices_and_normals(KernelGlobals *kg,
|
||||
int prim,
|
||||
float3 P[3],
|
||||
float3 N[3])
|
||||
{
|
||||
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim);
|
||||
P[0] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w + 0));
|
||||
P[1] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w + 1));
|
||||
P[2] = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex.w + 2));
|
||||
N[0] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.x));
|
||||
N[1] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.y));
|
||||
N[2] = float4_to_float3(kernel_tex_fetch(__tri_vnormal, tri_vindex.z));
|
||||
}
|
||||
|
||||
/* Interpolate smooth vertex normal from vertices */
|
||||
|
||||
ccl_device_inline float3
|
||||
|
@@ -72,22 +72,14 @@ ccl_device float4 volume_attribute_float4(KernelGlobals *kg,
|
||||
const ShaderData *sd,
|
||||
const AttributeDescriptor desc)
|
||||
{
|
||||
if (desc.element & (ATTR_ELEMENT_OBJECT | ATTR_ELEMENT_MESH)) {
|
||||
return kernel_tex_fetch(__attributes_float3, desc.offset);
|
||||
}
|
||||
else if (desc.element == ATTR_ELEMENT_VOXEL) {
|
||||
/* todo: optimize this so we don't have to transform both here and in
|
||||
* kernel_tex_image_interp_3d when possible. Also could optimize for the
|
||||
* common case where transform is translation/scale only. */
|
||||
float3 P = sd->P;
|
||||
object_inverse_position_transform(kg, sd, &P);
|
||||
InterpolationType interp = (sd->flag & SD_VOLUME_CUBIC) ? INTERPOLATION_CUBIC :
|
||||
INTERPOLATION_NONE;
|
||||
return kernel_tex_image_interp_3d(kg, desc.offset, P, interp);
|
||||
}
|
||||
else {
|
||||
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
/* todo: optimize this so we don't have to transform both here and in
|
||||
* kernel_tex_image_interp_3d when possible. Also could optimize for the
|
||||
* common case where transform is translation/scale only. */
|
||||
float3 P = sd->P;
|
||||
object_inverse_position_transform(kg, sd, &P);
|
||||
InterpolationType interp = (sd->flag & SD_VOLUME_CUBIC) ? INTERPOLATION_CUBIC :
|
||||
INTERPOLATION_NONE;
|
||||
return kernel_tex_image_interp_3d(kg, desc.offset, P, interp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -225,6 +225,13 @@ ccl_device_inline void path_radiance_init(KernelGlobals *kg, PathRadiance *L)
|
||||
L->denoising_albedo = zero_float3();
|
||||
L->denoising_depth = 0.0f;
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
L->debug_data.num_bvh_traversed_nodes = 0;
|
||||
L->debug_data.num_bvh_traversed_instances = 0;
|
||||
L->debug_data.num_bvh_intersections = 0;
|
||||
L->debug_data.num_ray_bounces = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
ccl_device_inline void path_radiance_bsdf_bounce(KernelGlobals *kg,
|
||||
@@ -588,9 +595,7 @@ ccl_device_inline void path_radiance_sum_shadowcatcher(KernelGlobals *kg,
|
||||
float shadow;
|
||||
|
||||
if (UNLIKELY(!isfinite_safe(path_total))) {
|
||||
# ifdef __KERNEL_DEBUG_NAN__
|
||||
kernel_assert(!"Non-finite total radiance along the path");
|
||||
# endif
|
||||
shadow = 0.0f;
|
||||
}
|
||||
else if (path_total == 0.0f) {
|
||||
@@ -636,9 +641,7 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg,
|
||||
|
||||
/* Reject invalid value */
|
||||
if (!isfinite_safe(sum)) {
|
||||
# ifdef __KERNEL_DEBUG_NAN__
|
||||
kernel_assert(!"Non-finite sum in path_radiance_clamp_and_sum!");
|
||||
# endif
|
||||
L_sum = zero_float3();
|
||||
|
||||
L->direct_diffuse = zero_float3();
|
||||
@@ -664,9 +667,7 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg,
|
||||
/* Reject invalid value */
|
||||
float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z);
|
||||
if (!isfinite_safe(sum)) {
|
||||
#ifdef __KERNEL_DEBUG_NAN__
|
||||
kernel_assert(!"Non-finite final sum in path_radiance_clamp_and_sum!");
|
||||
#endif
|
||||
L_sum = zero_float3();
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ ccl_device_noinline void compute_light_pass(
|
||||
/* Evaluate surface shader. */
|
||||
shader_eval_surface(kg, sd, &state, NULL, state.flag);
|
||||
|
||||
/* TODO: disable more closures we don't need besides transparent. */
|
||||
/* TODO, disable more closures we don't need besides transparent */
|
||||
shader_bsdf_disable_transparency(kg, sd);
|
||||
|
||||
/* Init ray. */
|
||||
|
@@ -176,7 +176,8 @@ ccl_device_noinline_cpu bool direct_emission(KernelGlobals *kg,
|
||||
|
||||
if (ls->shader & SHADER_CAST_SHADOW) {
|
||||
/* setup ray */
|
||||
ray->P = ray_offset_shadow(kg, sd, ls->D);
|
||||
bool transmit = (dot(sd->Ng, ls->D) < 0.0f);
|
||||
ray->P = ray_offset(sd->P, (transmit) ? -sd->Ng : sd->Ng);
|
||||
|
||||
if (ls->t == FLT_MAX) {
|
||||
/* distant light */
|
||||
|
@@ -122,6 +122,31 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
|
||||
}
|
||||
#endif /* __DENOISING_FEATURES__ */
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
ccl_device_inline void kernel_write_debug_passes(KernelGlobals *kg,
|
||||
ccl_global float *buffer,
|
||||
PathRadiance *L)
|
||||
{
|
||||
int flag = kernel_data.film.pass_flag;
|
||||
if (flag & PASSMASK(BVH_TRAVERSED_NODES)) {
|
||||
kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_nodes,
|
||||
L->debug_data.num_bvh_traversed_nodes);
|
||||
}
|
||||
if (flag & PASSMASK(BVH_TRAVERSED_INSTANCES)) {
|
||||
kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_traversed_instances,
|
||||
L->debug_data.num_bvh_traversed_instances);
|
||||
}
|
||||
if (flag & PASSMASK(BVH_INTERSECTIONS)) {
|
||||
kernel_write_pass_float(buffer + kernel_data.film.pass_bvh_intersections,
|
||||
L->debug_data.num_bvh_intersections);
|
||||
}
|
||||
if (flag & PASSMASK(RAY_BOUNCES)) {
|
||||
kernel_write_pass_float(buffer + kernel_data.film.pass_ray_bounces,
|
||||
L->debug_data.num_ray_bounces);
|
||||
}
|
||||
}
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
|
||||
#ifdef __KERNEL_CPU__
|
||||
# define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) \
|
||||
kernel_write_id_pass_cpu(buffer, depth * 2, id, matte_weight, kg->coverage_##name)
|
||||
@@ -364,6 +389,10 @@ ccl_device_inline void kernel_write_result(KernelGlobals *kg,
|
||||
}
|
||||
#endif /* __DENOISING_FEATURES__ */
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
kernel_write_debug_passes(kg, buffer, L);
|
||||
#endif
|
||||
|
||||
/* Adaptive Sampling. Fill the additional buffer with the odd samples and calculate our stopping
|
||||
criteria. This is the heuristic from "A hierarchical automatic stopping condition for Monte
|
||||
Carlo global illumination" except that here it is applied per pixel and not in hierarchical
|
||||
|
@@ -70,6 +70,15 @@ ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg,
|
||||
|
||||
bool hit = scene_intersect(kg, ray, visibility, isect);
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
if (state->flag & PATH_RAY_CAMERA) {
|
||||
L->debug_data.num_bvh_traversed_nodes += isect->num_traversed_nodes;
|
||||
L->debug_data.num_bvh_traversed_instances += isect->num_traversed_instances;
|
||||
L->debug_data.num_bvh_intersections += isect->num_intersections;
|
||||
}
|
||||
L->debug_data.num_ray_bounces++;
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
|
||||
return hit;
|
||||
}
|
||||
|
||||
|
@@ -1268,7 +1268,6 @@ ccl_device_inline void shader_eval_volume(KernelGlobals *kg,
|
||||
sd->num_closure_left = max_closures;
|
||||
sd->flag = 0;
|
||||
sd->object_flag = 0;
|
||||
sd->type = PRIMITIVE_VOLUME;
|
||||
|
||||
for (int i = 0; stack[i].shader != SHADER_NONE; i++) {
|
||||
/* setup shaderdata from stack. it's mostly setup already in
|
||||
|
@@ -182,8 +182,9 @@ CCL_NAMESPACE_BEGIN
|
||||
# undef __SHADER_RAYTRACE__
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CYCLES_DEBUG_NAN
|
||||
# define __KERNEL_DEBUG_NAN__
|
||||
/* Features that enable others */
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
# define __KERNEL_DEBUG__
|
||||
#endif
|
||||
|
||||
#if defined(__SUBSURFACE__) || defined(__SHADER_RAYTRACE__)
|
||||
@@ -355,6 +356,12 @@ typedef enum PassType {
|
||||
PASS_MATERIAL_ID,
|
||||
PASS_MOTION,
|
||||
PASS_MOTION_WEIGHT,
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
PASS_BVH_TRAVERSED_NODES,
|
||||
PASS_BVH_TRAVERSED_INSTANCES,
|
||||
PASS_BVH_INTERSECTIONS,
|
||||
PASS_RAY_BOUNCES,
|
||||
#endif
|
||||
PASS_RENDER_TIME,
|
||||
PASS_CRYPTOMATTE,
|
||||
PASS_AOV_COLOR,
|
||||
@@ -458,6 +465,18 @@ typedef enum DenoiseFlag {
|
||||
DENOISING_CLEAN_ALL_PASSES = (1 << 6) - 1,
|
||||
} DenoiseFlag;
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
/* NOTE: This is a runtime-only struct, alignment is not
|
||||
* really important here.
|
||||
*/
|
||||
typedef struct DebugData {
|
||||
int num_bvh_traversed_nodes;
|
||||
int num_bvh_traversed_instances;
|
||||
int num_bvh_intersections;
|
||||
int num_ray_bounces;
|
||||
} DebugData;
|
||||
#endif
|
||||
|
||||
typedef ccl_addr_space struct PathRadianceState {
|
||||
#ifdef __PASSES__
|
||||
float3 diffuse;
|
||||
@@ -533,6 +552,10 @@ typedef ccl_addr_space struct PathRadiance {
|
||||
float3 denoising_albedo;
|
||||
float denoising_depth;
|
||||
#endif /* __DENOISING_FEATURES__ */
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
DebugData debug_data;
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
} PathRadiance;
|
||||
|
||||
typedef struct BsdfEval {
|
||||
@@ -648,6 +671,12 @@ typedef struct Intersection {
|
||||
int prim;
|
||||
int object;
|
||||
int type;
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
int num_traversed_nodes;
|
||||
int num_traversed_instances;
|
||||
int num_intersections;
|
||||
#endif
|
||||
} Intersection;
|
||||
|
||||
/* Primitives */
|
||||
@@ -660,24 +689,22 @@ typedef enum PrimitiveType {
|
||||
PRIMITIVE_MOTION_CURVE_THICK = (1 << 3),
|
||||
PRIMITIVE_CURVE_RIBBON = (1 << 4),
|
||||
PRIMITIVE_MOTION_CURVE_RIBBON = (1 << 5),
|
||||
PRIMITIVE_VOLUME = (1 << 6),
|
||||
/* Lamp primitive is not included below on purpose,
|
||||
* since it is no real traceable primitive.
|
||||
*/
|
||||
PRIMITIVE_LAMP = (1 << 7),
|
||||
PRIMITIVE_LAMP = (1 << 6),
|
||||
|
||||
PRIMITIVE_ALL_TRIANGLE = (PRIMITIVE_TRIANGLE | PRIMITIVE_MOTION_TRIANGLE),
|
||||
PRIMITIVE_ALL_CURVE = (PRIMITIVE_CURVE_THICK | PRIMITIVE_MOTION_CURVE_THICK |
|
||||
PRIMITIVE_CURVE_RIBBON | PRIMITIVE_MOTION_CURVE_RIBBON),
|
||||
PRIMITIVE_ALL_VOLUME = (PRIMITIVE_VOLUME),
|
||||
PRIMITIVE_ALL_MOTION = (PRIMITIVE_MOTION_TRIANGLE | PRIMITIVE_MOTION_CURVE_THICK |
|
||||
PRIMITIVE_MOTION_CURVE_RIBBON),
|
||||
PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE | PRIMITIVE_ALL_CURVE | PRIMITIVE_ALL_VOLUME),
|
||||
PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE | PRIMITIVE_ALL_CURVE),
|
||||
|
||||
/* Total number of different traceable primitives.
|
||||
* NOTE: This is an actual value, not a bitflag.
|
||||
*/
|
||||
PRIMITIVE_NUM_TOTAL = 7,
|
||||
PRIMITIVE_NUM_TOTAL = 6,
|
||||
} PrimitiveType;
|
||||
|
||||
#define PRIMITIVE_PACK_SEGMENT(type, segment) ((segment << PRIMITIVE_NUM_TOTAL) | (type))
|
||||
@@ -1236,6 +1263,13 @@ typedef struct KernelFilm {
|
||||
int pass_bake_differential;
|
||||
int pad;
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
int pass_bvh_traversed_nodes;
|
||||
int pass_bvh_traversed_instances;
|
||||
int pass_bvh_intersections;
|
||||
int pass_ray_bounces;
|
||||
#endif
|
||||
|
||||
/* viewport rendering options */
|
||||
int display_pass_stride;
|
||||
int display_pass_components;
|
||||
@@ -1445,8 +1479,7 @@ typedef struct KernelObject {
|
||||
float cryptomatte_object;
|
||||
float cryptomatte_asset;
|
||||
|
||||
float shadow_terminator_shading_offset;
|
||||
float shadow_terminator_geometry_offset;
|
||||
float shadow_terminator_offset;
|
||||
float pad1, pad2, pad3;
|
||||
} KernelObject;
|
||||
static_assert_align(KernelObject, 16);
|
||||
|
@@ -54,18 +54,14 @@ vector4 safe_divide(vector4 a, float b)
|
||||
}
|
||||
|
||||
/*
|
||||
* Original code is under the MIT License, Copyright (c) 2013 Inigo Quilez.
|
||||
*
|
||||
* Smooth Voronoi:
|
||||
*
|
||||
* - https://wiki.blender.org/wiki/User:OmarSquircleArt/GSoC2019/Documentation/Smooth_Voronoi
|
||||
*
|
||||
* Distance To Edge based on:
|
||||
* Distance To Edge:
|
||||
*
|
||||
* - https://www.iquilezles.org/www/articles/voronoilines/voronoilines.htm
|
||||
* - https://www.shadertoy.com/view/ldl3W8
|
||||
* - https://www.shadertoy.com/view/llG3zy
|
||||
*
|
||||
* With optimization to change -2..2 scan window to -1..1 for better performance,
|
||||
* as explained in https://www.shadertoy.com/view/llG3zy.
|
||||
*/
|
||||
|
||||
/* **** 1D Voronoi **** */
|
||||
|
@@ -50,29 +50,24 @@ ccl_device void svm_node_vector_rotate(ShaderData *sd,
|
||||
}
|
||||
else {
|
||||
float3 axis;
|
||||
float axis_length;
|
||||
switch (type) {
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_X:
|
||||
axis = make_float3(1.0f, 0.0f, 0.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_Y:
|
||||
axis = make_float3(0.0f, 1.0f, 0.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_Z:
|
||||
axis = make_float3(0.0f, 0.0f, 1.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
default:
|
||||
axis = stack_load_float3(stack, axis_stack_offset);
|
||||
axis_length = len(axis);
|
||||
axis = normalize(stack_load_float3(stack, axis_stack_offset));
|
||||
break;
|
||||
}
|
||||
float angle = stack_load_float(stack, angle_stack_offset);
|
||||
angle = invert ? -angle : angle;
|
||||
result = (axis_length != 0.0f) ?
|
||||
rotate_around_axis(vector - center, axis / axis_length, angle) + center :
|
||||
result = (len_squared(axis) != 0.0f) ?
|
||||
rotate_around_axis(vector - center, axis, angle) + center :
|
||||
vector;
|
||||
}
|
||||
|
||||
|
@@ -17,19 +17,14 @@
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/*
|
||||
* Original code is under the MIT License, Copyright (c) 2013 Inigo Quilez.
|
||||
*
|
||||
* Smooth Voronoi:
|
||||
*
|
||||
* - https://wiki.blender.org/wiki/User:OmarSquircleArt/GSoC2019/Documentation/Smooth_Voronoi
|
||||
*
|
||||
* Distance To Edge based on:
|
||||
* Distance To Edge:
|
||||
*
|
||||
* - https://www.iquilezles.org/www/articles/voronoilines/voronoilines.htm
|
||||
* - https://www.shadertoy.com/view/ldl3W8
|
||||
* - https://www.shadertoy.com/view/llG3zy
|
||||
*
|
||||
* With optimization to change -2..2 scan window to -1..1 for better performance,
|
||||
* as explained in https://www.shadertoy.com/view/llG3zy.
|
||||
*/
|
||||
|
||||
/* **** 1D Voronoi **** */
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include "render/mesh.h"
|
||||
|
||||
#include "util/util_foreach.h"
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_transform.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
@@ -209,7 +208,6 @@ size_t Attribute::element_size(Geometry *geom, AttributePrimitive prim) const
|
||||
case ATTR_ELEMENT_VERTEX_MOTION:
|
||||
if (geom->geometry_type == Geometry::MESH) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
DCHECK_GT(mesh->get_motion_steps(), 0);
|
||||
size = (mesh->get_verts().size() + mesh->get_num_ngons()) * (mesh->get_motion_steps() - 1);
|
||||
if (prim == ATTR_PRIM_SUBD) {
|
||||
size -= mesh->get_num_subd_verts() * (mesh->get_motion_steps() - 1);
|
||||
@@ -254,7 +252,6 @@ size_t Attribute::element_size(Geometry *geom, AttributePrimitive prim) const
|
||||
case ATTR_ELEMENT_CURVE_KEY_MOTION:
|
||||
if (geom->geometry_type == Geometry::HAIR) {
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
DCHECK_GT(hair->get_motion_steps(), 0);
|
||||
size = hair->get_curve_keys().size() * (hair->get_motion_steps() - 1);
|
||||
}
|
||||
break;
|
||||
|
@@ -322,6 +322,15 @@ bool RenderBuffers::get_pass_rect(
|
||||
pixels[0] = saturate(f * scale_exposure);
|
||||
}
|
||||
}
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
else if (type == PASS_BVH_TRAVERSED_NODES || type == PASS_BVH_TRAVERSED_INSTANCES ||
|
||||
type == PASS_BVH_INTERSECTIONS || type == PASS_RAY_BOUNCES) {
|
||||
for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
|
||||
float f = *in;
|
||||
pixels[0] = f * scale;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
|
||||
float f = *in;
|
||||
|
@@ -81,7 +81,7 @@ class Camera : public Node {
|
||||
/* ** Rolling shutter effect. ** */
|
||||
/* Defines rolling shutter effect type. */
|
||||
NODE_SOCKET_API(RollingShutterType, rolling_shutter_type)
|
||||
/* Specifies exposure time of scan-lines when using
|
||||
/* Specifies exposure time of scanlines when using
|
||||
* rolling shutter effect.
|
||||
*/
|
||||
NODE_SOCKET_API(float, rolling_shutter_duration)
|
||||
|
@@ -385,7 +385,7 @@ void ColorSpaceManager::free_memory()
|
||||
{
|
||||
#ifdef WITH_OCIO
|
||||
map_free_memory(cached_colorspaces);
|
||||
map_free_memory(cached_processors);
|
||||
map_free_memory(cached_colorspaces);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,6 @@ void ConstantFolder::make_constant(float value) const
|
||||
|
||||
foreach (ShaderInput *sock, output->links) {
|
||||
sock->set(value);
|
||||
sock->constant_folded_in = true;
|
||||
}
|
||||
|
||||
graph->disconnect(output);
|
||||
@@ -60,7 +59,6 @@ void ConstantFolder::make_constant(float3 value) const
|
||||
|
||||
foreach (ShaderInput *sock, output->links) {
|
||||
sock->set(value);
|
||||
sock->constant_folded_in = true;
|
||||
}
|
||||
|
||||
graph->disconnect(output);
|
||||
|
@@ -51,6 +51,12 @@ static NodeEnum *get_pass_type_enum()
|
||||
pass_type_enum.insert("material_id", PASS_MATERIAL_ID);
|
||||
pass_type_enum.insert("motion", PASS_MOTION);
|
||||
pass_type_enum.insert("motion_weight", PASS_MOTION_WEIGHT);
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
pass_type_enum.insert("traversed_nodes", PASS_BVH_TRAVERSED_NODES);
|
||||
pass_type_enum.insert("traverse_instances", PASS_BVH_TRAVERSED_INSTANCES);
|
||||
pass_type_enum.insert("bvh_intersections", PASS_BVH_INTERSECTIONS);
|
||||
pass_type_enum.insert("ray_bounces", PASS_RAY_BOUNCES);
|
||||
#endif
|
||||
pass_type_enum.insert("render_time", PASS_RENDER_TIME);
|
||||
pass_type_enum.insert("cryptomatte", PASS_CRYPTOMATTE);
|
||||
pass_type_enum.insert("aov_color", PASS_AOV_COLOR);
|
||||
@@ -194,6 +200,15 @@ void Pass::add(PassType type, vector<Pass> &passes, const char *name)
|
||||
*/
|
||||
pass.components = 0;
|
||||
break;
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
case PASS_BVH_TRAVERSED_NODES:
|
||||
case PASS_BVH_TRAVERSED_INSTANCES:
|
||||
case PASS_BVH_INTERSECTIONS:
|
||||
case PASS_RAY_BOUNCES:
|
||||
pass.components = 1;
|
||||
pass.exposure = false;
|
||||
break;
|
||||
#endif
|
||||
case PASS_RENDER_TIME:
|
||||
/* This pass is handled entirely on the host side. */
|
||||
pass.components = 0;
|
||||
@@ -555,6 +570,20 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
||||
kfilm->pass_bake_differential = kfilm->pass_stride;
|
||||
break;
|
||||
|
||||
#ifdef WITH_CYCLES_DEBUG
|
||||
case PASS_BVH_TRAVERSED_NODES:
|
||||
kfilm->pass_bvh_traversed_nodes = kfilm->pass_stride;
|
||||
break;
|
||||
case PASS_BVH_TRAVERSED_INSTANCES:
|
||||
kfilm->pass_bvh_traversed_instances = kfilm->pass_stride;
|
||||
break;
|
||||
case PASS_BVH_INTERSECTIONS:
|
||||
kfilm->pass_bvh_intersections = kfilm->pass_stride;
|
||||
break;
|
||||
case PASS_RAY_BOUNCES:
|
||||
kfilm->pass_ray_bounces = kfilm->pass_stride;
|
||||
break;
|
||||
#endif
|
||||
case PASS_RENDER_TIME:
|
||||
break;
|
||||
case PASS_CRYPTOMATTE:
|
||||
|
@@ -79,11 +79,7 @@ enum ShaderNodeSpecialType {
|
||||
class ShaderInput {
|
||||
public:
|
||||
ShaderInput(const SocketType &socket_type_, ShaderNode *parent_)
|
||||
: socket_type(socket_type_),
|
||||
parent(parent_),
|
||||
link(NULL),
|
||||
stack_offset(SVM_STACK_INVALID),
|
||||
constant_folded_in(false)
|
||||
: socket_type(socket_type_), parent(parent_), link(NULL), stack_offset(SVM_STACK_INVALID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -115,10 +111,6 @@ class ShaderInput {
|
||||
ShaderNode *parent;
|
||||
ShaderOutput *link;
|
||||
int stack_offset; /* for SVM compiler */
|
||||
|
||||
/* Keeps track of whether a constant was folded in this socket, to avoid over-optimizing when the
|
||||
* link is null. */
|
||||
bool constant_folded_in;
|
||||
};
|
||||
|
||||
/* Output
|
||||
@@ -356,7 +348,7 @@ class ShaderGraph : public NodeOwner {
|
||||
/* This function is used to create a node of a specified type instead of
|
||||
* calling 'new', and sets the graph as the owner of the node.
|
||||
*/
|
||||
template<typename T, typename... Args> T *create_node(Args &&...args)
|
||||
template<typename T, typename... Args> T *create_node(Args &&... args)
|
||||
{
|
||||
T *node = new T(args...);
|
||||
node->set_owner(this);
|
||||
|
@@ -16,10 +16,8 @@
|
||||
|
||||
#include "render/image_vdb.h"
|
||||
|
||||
#include "util/util_logging.h"
|
||||
#include "util/util_openvdb.h"
|
||||
|
||||
#ifdef WITH_OPENVDB
|
||||
# include <openvdb/openvdb.h>
|
||||
# include <openvdb/tools/Dense.h>
|
||||
#endif
|
||||
#ifdef WITH_NANOVDB
|
||||
@@ -28,57 +26,6 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
#ifdef WITH_OPENVDB
|
||||
struct NumChannelsOp {
|
||||
int num_channels = 0;
|
||||
|
||||
template<typename GridType, typename FloatGridType, typename FloatDataType, int channels>
|
||||
bool operator()(const openvdb::GridBase::ConstPtr &)
|
||||
{
|
||||
num_channels = channels;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct ToDenseOp {
|
||||
openvdb::CoordBBox bbox;
|
||||
void *pixels;
|
||||
|
||||
template<typename GridType, typename FloatGridType, typename FloatDataType, int channels>
|
||||
bool operator()(const openvdb::GridBase::ConstPtr &grid)
|
||||
{
|
||||
openvdb::tools::Dense<FloatDataType, openvdb::tools::LayoutXYZ> dense(bbox,
|
||||
(FloatDataType *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<GridType>(grid), dense);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
# ifdef WITH_NANOVDB
|
||||
struct ToNanoOp {
|
||||
nanovdb::GridHandle<> nanogrid;
|
||||
|
||||
template<typename GridType, typename FloatGridType, typename FloatDataType, int channels>
|
||||
bool operator()(const openvdb::GridBase::ConstPtr &grid)
|
||||
{
|
||||
if constexpr (!std::is_same_v<GridType, openvdb::MaskGrid>) {
|
||||
try {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
FloatGridType(*openvdb::gridConstPtrCast<GridType>(grid)));
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
VLOG(1) << "Error converting OpenVDB to NanoVDB grid: " << e.what();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
VDBImageLoader::VDBImageLoader(const string &grid_name) : grid_name(grid_name)
|
||||
{
|
||||
}
|
||||
@@ -94,40 +41,98 @@ bool VDBImageLoader::load_metadata(const ImageDeviceFeatures &features, ImageMet
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Get number of channels from type. */
|
||||
NumChannelsOp op;
|
||||
if (!openvdb::grid_type_operation(grid, op)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
metadata.channels = op.num_channels;
|
||||
|
||||
/* Set data type. */
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
/* NanoVDB expects no inactive leaf nodes. */
|
||||
/*openvdb::FloatGrid &pruned_grid = *openvdb::gridPtrCast<openvdb::FloatGrid>(grid);
|
||||
openvdb::tools::pruneInactive(pruned_grid.tree());
|
||||
nanogrid = nanovdb::openToNanoVDB(pruned_grid);*/
|
||||
ToNanoOp op;
|
||||
if (!openvdb::grid_type_operation(grid, op)) {
|
||||
return false;
|
||||
}
|
||||
nanogrid = std::move(op.nanogrid);
|
||||
}
|
||||
# endif
|
||||
|
||||
/* Set dimensions. */
|
||||
bbox = grid->evalActiveVoxelBoundingBox();
|
||||
if (bbox.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set dimensions. */
|
||||
openvdb::Coord dim = bbox.dim();
|
||||
metadata.width = dim.x();
|
||||
metadata.height = dim.y();
|
||||
metadata.depth = dim.z();
|
||||
|
||||
/* Set data type. */
|
||||
if (grid->isType<openvdb::FloatGrid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(*openvdb::gridConstPtrCast<openvdb::FloatGrid>(grid));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3fGrid>()) {
|
||||
metadata.channels = 3;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(*openvdb::gridConstPtrCast<openvdb::Vec3fGrid>(grid));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::BoolGrid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::FloatGrid(*openvdb::gridConstPtrCast<openvdb::BoolGrid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::DoubleGrid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::FloatGrid(*openvdb::gridConstPtrCast<openvdb::DoubleGrid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::Int32Grid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::FloatGrid(*openvdb::gridConstPtrCast<openvdb::Int32Grid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::Int64Grid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::FloatGrid(*openvdb::gridConstPtrCast<openvdb::Int64Grid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3IGrid>()) {
|
||||
metadata.channels = 3;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::Vec3fGrid(*openvdb::gridConstPtrCast<openvdb::Vec3IGrid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3dGrid>()) {
|
||||
metadata.channels = 3;
|
||||
# ifdef WITH_NANOVDB
|
||||
if (features.has_nanovdb) {
|
||||
nanogrid = nanovdb::openToNanoVDB(
|
||||
openvdb::Vec3fGrid(*openvdb::gridConstPtrCast<openvdb::Vec3dGrid>(grid)));
|
||||
}
|
||||
# endif
|
||||
}
|
||||
else if (grid->isType<openvdb::MaskGrid>()) {
|
||||
metadata.channels = 1;
|
||||
# ifdef WITH_NANOVDB
|
||||
return false; // Unsupported
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
# ifdef WITH_NANOVDB
|
||||
if (nanogrid) {
|
||||
metadata.byte_size = nanogrid.size();
|
||||
@@ -195,10 +200,45 @@ bool VDBImageLoader::load_pixels(const ImageMetaData &, void *pixels, const size
|
||||
else
|
||||
# endif
|
||||
{
|
||||
ToDenseOp op;
|
||||
op.pixels = pixels;
|
||||
op.bbox = bbox;
|
||||
openvdb::grid_type_operation(grid, op);
|
||||
if (grid->isType<openvdb::FloatGrid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::FloatGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3fGrid>()) {
|
||||
openvdb::tools::Dense<openvdb::Vec3f, openvdb::tools::LayoutXYZ> dense(
|
||||
bbox, (openvdb::Vec3f *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::Vec3fGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::BoolGrid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::BoolGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::DoubleGrid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::DoubleGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::Int32Grid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::Int32Grid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::Int64Grid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::Int64Grid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3IGrid>()) {
|
||||
openvdb::tools::Dense<openvdb::Vec3f, openvdb::tools::LayoutXYZ> dense(
|
||||
bbox, (openvdb::Vec3f *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::Vec3IGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::Vec3dGrid>()) {
|
||||
openvdb::tools::Dense<openvdb::Vec3f, openvdb::tools::LayoutXYZ> dense(
|
||||
bbox, (openvdb::Vec3f *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::Vec3dGrid>(grid), dense);
|
||||
}
|
||||
else if (grid->isType<openvdb::MaskGrid>()) {
|
||||
openvdb::tools::Dense<float, openvdb::tools::LayoutXYZ> dense(bbox, (float *)pixels);
|
||||
openvdb::tools::copyToDense(*openvdb::gridConstPtrCast<openvdb::MaskGrid>(grid), dense);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
|
@@ -93,8 +93,7 @@ NODE_DEFINE(Object)
|
||||
SOCKET_POINT(dupli_generated, "Dupli Generated", zero_float3());
|
||||
SOCKET_POINT2(dupli_uv, "Dupli UV", zero_float2());
|
||||
SOCKET_TRANSFORM_ARRAY(motion, "Motion", array<Transform>());
|
||||
SOCKET_FLOAT(shadow_terminator_shading_offset, "Shadow Terminator Shading Offset", 0.0f);
|
||||
SOCKET_FLOAT(shadow_terminator_geometry_offset, "Shadow Terminator Geometry Offset", 0.1f);
|
||||
SOCKET_FLOAT(shadow_terminator_offset, "Terminator Offset", 0.0f);
|
||||
SOCKET_STRING(asset_name, "Asset Name", ustring());
|
||||
|
||||
SOCKET_BOOLEAN(is_shadow_catcher, "Shadow Catcher", false);
|
||||
@@ -508,9 +507,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
|
||||
kobject.cryptomatte_asset = util_hash_to_float(hash_asset);
|
||||
}
|
||||
|
||||
kobject.shadow_terminator_shading_offset = 1.0f /
|
||||
(1.0f - 0.5f * ob->shadow_terminator_shading_offset);
|
||||
kobject.shadow_terminator_geometry_offset = ob->shadow_terminator_geometry_offset;
|
||||
kobject.shadow_terminator_offset = 1.0f / (1.0f - 0.5f * ob->shadow_terminator_offset);
|
||||
|
||||
/* Object flag. */
|
||||
if (ob->use_holdout) {
|
||||
|
@@ -64,8 +64,7 @@ class Object : public Node {
|
||||
NODE_SOCKET_API(bool, hide_on_missing_motion)
|
||||
NODE_SOCKET_API(bool, use_holdout)
|
||||
NODE_SOCKET_API(bool, is_shadow_catcher)
|
||||
NODE_SOCKET_API(float, shadow_terminator_shading_offset)
|
||||
NODE_SOCKET_API(float, shadow_terminator_geometry_offset)
|
||||
NODE_SOCKET_API(float, shadow_terminator_offset)
|
||||
|
||||
NODE_SOCKET_API(float3, dupli_generated)
|
||||
NODE_SOCKET_API(float2, dupli_uv)
|
||||
|
@@ -993,7 +993,7 @@ void OSLCompiler::parameter_array(const char *name, const float f[], int arrayle
|
||||
|
||||
void OSLCompiler::parameter_color_array(const char *name, const array<float3> &f)
|
||||
{
|
||||
/* NOTE: cycles float3 type is actually 4 floats! need to use an explicit array. */
|
||||
/* NB: cycles float3 type is actually 4 floats! need to use an explicit array */
|
||||
array<float[3]> table(f.size());
|
||||
|
||||
for (int i = 0; i < f.size(); ++i) {
|
||||
|
@@ -209,7 +209,7 @@ class SceneParams {
|
||||
|
||||
int curve_subdivisions()
|
||||
{
|
||||
/* Matching the tessellation rate limit in Embree. */
|
||||
/* Matching the tesselation rate limit in Embree. */
|
||||
return clamp(1 << hair_subdivisions, 1, 16);
|
||||
}
|
||||
};
|
||||
@@ -299,7 +299,7 @@ class Scene : public NodeOwner {
|
||||
* node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate
|
||||
* manager for an update.
|
||||
*/
|
||||
template<typename T, typename... Args> T *create_node(Args &&...args)
|
||||
template<typename T, typename... Args> T *create_node(Args &&... args)
|
||||
{
|
||||
T *node = new T(args...);
|
||||
node->set_owner(this);
|
||||
|
@@ -227,25 +227,66 @@ void Session::run_gpu()
|
||||
progress.set_render_start_time();
|
||||
|
||||
while (!progress.get_cancel()) {
|
||||
const bool no_tiles = !run_update_for_next_iteration();
|
||||
/* advance to next tile */
|
||||
bool no_tiles = !tile_manager.next();
|
||||
|
||||
DeviceKernelStatus kernel_state = DEVICE_KERNEL_UNKNOWN;
|
||||
if (no_tiles) {
|
||||
if (params.background) {
|
||||
/* if no work left and in background mode, we can stop immediately */
|
||||
kernel_state = device->get_active_kernel_switch_state();
|
||||
}
|
||||
|
||||
if (params.background) {
|
||||
/* if no work left and in background mode, we can stop immediately */
|
||||
if (no_tiles) {
|
||||
progress.set_status("Finished");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (run_wait_for_work(no_tiles)) {
|
||||
continue;
|
||||
else if (no_tiles && kernel_state == DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE) {
|
||||
reset_gpu(tile_manager.params, params.samples);
|
||||
}
|
||||
|
||||
if (progress.get_cancel()) {
|
||||
break;
|
||||
else {
|
||||
/* if in interactive mode, and we are either paused or done for now,
|
||||
* wait for pause condition notify to wake up again */
|
||||
thread_scoped_lock pause_lock(pause_mutex);
|
||||
|
||||
if (!pause && !tile_manager.done()) {
|
||||
/* reset could have happened after no_tiles was set, before this lock.
|
||||
* in this case we shall not wait for pause condition
|
||||
*/
|
||||
}
|
||||
else if (pause || no_tiles) {
|
||||
update_status_time(pause, no_tiles);
|
||||
|
||||
while (1) {
|
||||
scoped_timer pause_timer;
|
||||
pause_cond.wait(pause_lock);
|
||||
if (pause) {
|
||||
progress.add_skip_time(pause_timer, params.background);
|
||||
}
|
||||
|
||||
update_status_time(pause, no_tiles);
|
||||
progress.set_update();
|
||||
|
||||
if (!pause)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (progress.get_cancel())
|
||||
break;
|
||||
}
|
||||
|
||||
if (!no_tiles) {
|
||||
/* update scene */
|
||||
scoped_timer update_timer;
|
||||
if (update_scene()) {
|
||||
profiler.reset(scene->shaders.size(), scene->objects.size());
|
||||
}
|
||||
progress.add_skip_time(update_timer, params.background);
|
||||
|
||||
if (!device->error_message().empty())
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
@@ -688,27 +729,82 @@ void Session::run_cpu()
|
||||
last_update_time = time_dt();
|
||||
last_display_time = last_update_time;
|
||||
|
||||
{
|
||||
/* reset once to start */
|
||||
thread_scoped_lock reset_lock(delayed_reset.mutex);
|
||||
thread_scoped_lock buffers_lock(buffers_mutex);
|
||||
thread_scoped_lock display_lock(display_mutex);
|
||||
|
||||
reset_(delayed_reset.params, delayed_reset.samples);
|
||||
delayed_reset.do_reset = false;
|
||||
}
|
||||
|
||||
while (!progress.get_cancel()) {
|
||||
const bool no_tiles = !run_update_for_next_iteration();
|
||||
/* advance to next tile */
|
||||
bool no_tiles = !tile_manager.next();
|
||||
bool need_copy_to_display_buffer = false;
|
||||
|
||||
DeviceKernelStatus kernel_state = DEVICE_KERNEL_UNKNOWN;
|
||||
if (no_tiles) {
|
||||
if (params.background) {
|
||||
/* if no work left and in background mode, we can stop immediately */
|
||||
kernel_state = device->get_active_kernel_switch_state();
|
||||
}
|
||||
|
||||
if (params.background) {
|
||||
/* if no work left and in background mode, we can stop immediately */
|
||||
if (no_tiles) {
|
||||
progress.set_status("Finished");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (run_wait_for_work(no_tiles)) {
|
||||
continue;
|
||||
else if (no_tiles && kernel_state == DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE) {
|
||||
reset_cpu(tile_manager.params, params.samples);
|
||||
}
|
||||
|
||||
if (progress.get_cancel()) {
|
||||
break;
|
||||
else {
|
||||
/* if in interactive mode, and we are either paused or done for now,
|
||||
* wait for pause condition notify to wake up again */
|
||||
thread_scoped_lock pause_lock(pause_mutex);
|
||||
|
||||
if (!pause && delayed_reset.do_reset) {
|
||||
/* reset once to start */
|
||||
thread_scoped_lock reset_lock(delayed_reset.mutex);
|
||||
thread_scoped_lock buffers_lock(buffers_mutex);
|
||||
thread_scoped_lock display_lock(display_mutex);
|
||||
|
||||
reset_(delayed_reset.params, delayed_reset.samples);
|
||||
delayed_reset.do_reset = false;
|
||||
}
|
||||
else if (pause || no_tiles) {
|
||||
update_status_time(pause, no_tiles);
|
||||
|
||||
while (1) {
|
||||
scoped_timer pause_timer;
|
||||
pause_cond.wait(pause_lock);
|
||||
if (pause) {
|
||||
progress.add_skip_time(pause_timer, params.background);
|
||||
}
|
||||
|
||||
update_status_time(pause, no_tiles);
|
||||
progress.set_update();
|
||||
|
||||
if (!pause)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (progress.get_cancel())
|
||||
break;
|
||||
}
|
||||
|
||||
if (!no_tiles) {
|
||||
/* update scene */
|
||||
scoped_timer update_timer;
|
||||
if (update_scene()) {
|
||||
profiler.reset(scene->shaders.size(), scene->objects.size());
|
||||
}
|
||||
progress.add_skip_time(update_timer, params.background);
|
||||
|
||||
if (!device->error_message().empty())
|
||||
progress.set_error(device->error_message());
|
||||
|
||||
@@ -798,63 +894,6 @@ void Session::run()
|
||||
progress.set_update();
|
||||
}
|
||||
|
||||
bool Session::run_update_for_next_iteration()
|
||||
{
|
||||
thread_scoped_lock scene_lock(scene->mutex);
|
||||
thread_scoped_lock reset_lock(delayed_reset.mutex);
|
||||
|
||||
if (delayed_reset.do_reset) {
|
||||
thread_scoped_lock buffers_lock(buffers_mutex);
|
||||
reset_(delayed_reset.params, delayed_reset.samples);
|
||||
delayed_reset.do_reset = false;
|
||||
}
|
||||
|
||||
const bool have_tiles = tile_manager.next();
|
||||
|
||||
if (have_tiles) {
|
||||
scoped_timer update_timer;
|
||||
if (update_scene()) {
|
||||
profiler.reset(scene->shaders.size(), scene->objects.size());
|
||||
}
|
||||
progress.add_skip_time(update_timer, params.background);
|
||||
}
|
||||
|
||||
return have_tiles;
|
||||
}
|
||||
|
||||
bool Session::run_wait_for_work(bool no_tiles)
|
||||
{
|
||||
/* In an offline rendering there is no pause, and no tiles will mean the job is fully done. */
|
||||
if (params.background) {
|
||||
return false;
|
||||
}
|
||||
|
||||
thread_scoped_lock pause_lock(pause_mutex);
|
||||
|
||||
if (!pause && !no_tiles) {
|
||||
return false;
|
||||
}
|
||||
|
||||
update_status_time(pause, no_tiles);
|
||||
|
||||
while (true) {
|
||||
scoped_timer pause_timer;
|
||||
pause_cond.wait(pause_lock);
|
||||
if (pause) {
|
||||
progress.add_skip_time(pause_timer, params.background);
|
||||
}
|
||||
|
||||
update_status_time(pause, no_tiles);
|
||||
progress.set_update();
|
||||
|
||||
if (!pause) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return no_tiles;
|
||||
}
|
||||
|
||||
bool Session::draw(BufferParams &buffer_params, DeviceDrawParams &draw_params)
|
||||
{
|
||||
if (device_use_gl)
|
||||
@@ -973,6 +1012,8 @@ void Session::wait()
|
||||
|
||||
bool Session::update_scene()
|
||||
{
|
||||
thread_scoped_lock scene_lock(scene->mutex);
|
||||
|
||||
/* update camera if dimensions changed for progressive render. the camera
|
||||
* knows nothing about progressive or cropped rendering, it just gets the
|
||||
* image dimensions passed in */
|
||||
|
@@ -178,9 +178,6 @@ class Session {
|
||||
|
||||
void run();
|
||||
|
||||
bool run_update_for_next_iteration();
|
||||
bool run_wait_for_work(bool no_tiles);
|
||||
|
||||
void update_status_time(bool show_pause = false, bool show_done = false);
|
||||
|
||||
void render(bool use_denoise);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user