Compare commits
256 Commits
geometry-n
...
windows_ma
Author | SHA1 | Date | |
---|---|---|---|
786c8bf5ce | |||
6844f7bedb | |||
![]() |
bd44e82b25 | ||
c15635bd8d | |||
04c24bec07 | |||
ff2265f0a9 | |||
8158211198 | |||
ca64bd0aac | |||
6c326ba0a2 | |||
834523e239 | |||
27b9cb7a1e | |||
03d7561708 | |||
b4f950cbbe | |||
![]() |
cc4e674e41 | ||
e844e9e8f3 | |||
0cff7c2a22 | |||
720ea8a67d | |||
be6409a748 | |||
fb1822ddeb | |||
f45860fba9 | |||
ed9759349b | |||
02e0c6f42e | |||
317f09ebf9 | |||
03e2f11d48 | |||
647a8bff06 | |||
f5acfd9c04 | |||
d8582d966f | |||
2b51124d6a | |||
450593ddf0 | |||
d3d4be1db3 | |||
d1c5e2e050 | |||
604ae5f7b6 | |||
1def985d78 | |||
438d645a36 | |||
171433e841 | |||
d6ca7ab20e | |||
07b702f828 | |||
1d1020b79f | |||
49acc52e02 | |||
8abf6efcf6 | |||
![]() |
10b9621079 | ||
ae920d789e | |||
b5bfb5f34c | |||
c18d91918f | |||
58ba75f9e3 | |||
a8185d2d74 | |||
2af789d1f3 | |||
c1730ed165 | |||
145270d8d7 | |||
e5d4a0c559 | |||
26c2c617b4 | |||
![]() |
76dcf70dac | ||
d2130c5327 | |||
add719e31a | |||
ac6b263906 | |||
557e7f135e | |||
051141acde | |||
d9a530c55e | |||
![]() |
8c21076add | ||
![]() |
c8004ab407 | ||
![]() |
b867df903f | ||
cb67bfdba2 | |||
218df99410 | |||
3b0fab6dfa | |||
effc048710 | |||
cd92b2350f | |||
10464843dd | |||
![]() |
0f45576590 | ||
26f1a5e2c8 | |||
5950b3ab73 | |||
71dc134f89 | |||
7389fd9a35 | |||
8a1c1279b3 | |||
0d2589d08c | |||
fb87d236ed | |||
18d900caca | |||
41357d556f | |||
39e914cee7 | |||
57281b73c4 | |||
652fbc2005 | |||
a25a1f39aa | |||
4e1a1821e0 | |||
391af6bea2 | |||
7724251af8 | |||
d3dd735fea | |||
cec103d5a9 | |||
0342fb5d20 | |||
dbd34a5acb | |||
b35a96e195 | |||
20d5d7b8ec | |||
c6f64d46ed | |||
![]() |
ea54cbe1b4 | ||
28b9dd7b1f | |||
c0900a64ce | |||
b1a607ce04 | |||
f8abc3fb2f | |||
d6e97a53ab | |||
b54e741a8b | |||
00b57136e4 | |||
![]() |
6f50969406 | ||
![]() |
ebd55b4acd | ||
![]() |
a53feb0aff | ||
c1a477b497 | |||
1973fd89df | |||
04c75c5ce7 | |||
223f048138 | |||
efd7c95bb2 | |||
a4813379f9 | |||
4f6f445120 | |||
8b93265c19 | |||
a2203a27d9 | |||
67d56eb71e | |||
77187718e4 | |||
eccd8af828 | |||
1062649b5e | |||
3ff5d8f719 | |||
ceb049133c | |||
d8bf332f86 | |||
![]() |
0e4f7b4a4b | ||
11cfa6c718 | |||
d60a7a8744 | |||
8edb2222ae | |||
aa60416361 | |||
06cb48e1b2 | |||
1f0d6f7635 | |||
3fd5c93f9c | |||
de91cdd930 | |||
48722e8971 | |||
1cf45fe10f | |||
![]() |
836aeebf70 | ||
79277986c2 | |||
17243337d7 | |||
2f63303e25 | |||
8063f10166 | |||
37e2fec090 | |||
7c961e716d | |||
524908146c | |||
d91c266986 | |||
e9dc6a0e09 | |||
35894dc700 | |||
54bd5efa68 | |||
549e2b7539 | |||
d2675c3c5d | |||
5762e7a679 | |||
4dbf4eb100 | |||
96fb21f3af | |||
a9ea310d30 | |||
0b10a96474 | |||
f7836019b3 | |||
9ac782b823 | |||
c1ec2e9d5f | |||
3848507511 | |||
b90887da5a | |||
3b2a6bf8e8 | |||
3316e28418 | |||
e7e9364d23 | |||
4c3d4ebefc | |||
eb2a6f454b | |||
4647ffd918 | |||
c8b7745172 | |||
5aa45c43f2 | |||
88e774aa34 | |||
![]() |
a787bcbf5c | ||
![]() |
8796a2827f | ||
b98735ec29 | |||
020431408f | |||
93eb460dd0 | |||
f81a6a2ff1 | |||
63f7eceb53 | |||
d06b03f80d | |||
9764d90fda | |||
228edcaedd | |||
a2b8dad469 | |||
ddcb6b1023 | |||
5280d4bf0b | |||
8f05520083 | |||
0b18a618b8 | |||
c7b12e31e6 | |||
cae18abef4 | |||
8f12457c25 | |||
0b0c2901f6 | |||
646f7ef73c | |||
2d3e5eda3f | |||
8cb4e3d046 | |||
49c0b9ec43 | |||
5be54cce36 | |||
b361b2f214 | |||
33322086f6 | |||
ceec7cabf5 | |||
b60e72100b | |||
21b4799793 | |||
bd2bfa469f | |||
12d93e44d0 | |||
4d28703277 | |||
![]() |
1775c39986 | ||
0f1c84f171 | |||
cafb1bc47f | |||
24ba931f40 | |||
810c88b5f1 | |||
3f84f0123e | |||
![]() |
9cc8d50a04 | ||
5116b7a4c2 | |||
0491052a96 | |||
5c9979ff03 | |||
3964785a14 | |||
a70f37bd8a | |||
d5fd09ab58 | |||
3c50687073 | |||
fd0b2b8dfd | |||
bc0a7d3fae | |||
2453dc1b0e | |||
0358951b9e | |||
8aa1c0a326 | |||
073bf8bf52 | |||
3bf9675849 | |||
40ef71f465 | |||
0088b412ff | |||
08154d237f | |||
![]() |
b304616f2a | ||
3db37075f6 | |||
b18d0244fc | |||
![]() |
31fcb934a4 | ||
f9308a585e | |||
dfc597202f | |||
7d0765cbdc | |||
8e9d06f5a0 | |||
544ddcdaac | |||
91dd1a1ba3 | |||
ce68888d1b | |||
f5cc348610 | |||
ae034d27d2 | |||
7e91a60be6 | |||
c6ba7359ae | |||
f4abd3cfc4 | |||
![]() |
4a02b9ffeb | ||
d6d44faff0 | |||
![]() |
766e67e55d | ||
07688ca2d2 | |||
db4fe8e322 | |||
e37c876cd7 | |||
58eacb8e7c | |||
b1a2abd6b2 | |||
c5e5ac4a17 | |||
5a07174ce3 | |||
b331acf477 | |||
675d8a9c43 | |||
![]() |
6ee14c966d | ||
05315af81d | |||
![]() |
6a903d9088 | ||
a4a72bffd3 | |||
e33814ef6b | |||
883fb49d4f | |||
a117794f8c | |||
cf74cd9367 | |||
![]() |
6eb94d8df2 | ||
22b03e1c68 |
@@ -110,6 +110,10 @@ if(POLICY CMP0074)
|
|||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Install CODE|SCRIPT allow the use of generator expressions.
|
||||||
|
if(POLICY CMP0087)
|
||||||
|
cmake_policy(SET CMP0087 NEW)
|
||||||
|
endif()
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Load some macros.
|
# Load some macros.
|
||||||
include(build_files/cmake/macros.cmake)
|
include(build_files/cmake/macros.cmake)
|
||||||
@@ -403,14 +407,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")
|
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)
|
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||||
unset(PLATFORM_DEFAULT)
|
unset(PLATFORM_DEFAULT)
|
||||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||||
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
|
option(WITH_CYCLES_DEBUG_NAN "Build Cycles with additional asserts for detecting NaNs and invalid values" OFF)
|
||||||
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" 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)
|
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_KERNEL_ASAN)
|
||||||
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
|
||||||
mark_as_advanced(WITH_CYCLES_LOGGING)
|
mark_as_advanced(WITH_CYCLES_LOGGING)
|
||||||
mark_as_advanced(WITH_CYCLES_DEBUG)
|
mark_as_advanced(WITH_CYCLES_DEBUG_NAN)
|
||||||
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
|
||||||
|
|
||||||
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
|
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
|
||||||
@@ -424,6 +428,10 @@ mark_as_advanced(WITH_CYCLES_NETWORK)
|
|||||||
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
|
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
|
||||||
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
mark_as_advanced(WITH_CUDA_DYNLOAD)
|
||||||
|
|
||||||
|
# Draw Manager
|
||||||
|
option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF)
|
||||||
|
mark_as_advanced(WITH_DRAW_DEBUG)
|
||||||
|
|
||||||
# LLVM
|
# LLVM
|
||||||
option(WITH_LLVM "Use LLVM" OFF)
|
option(WITH_LLVM "Use LLVM" OFF)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
34
GNUmakefile
34
GNUmakefile
@@ -63,7 +63,7 @@ Package Targets
|
|||||||
|
|
||||||
* package_debian: Build a debian package.
|
* package_debian: Build a debian package.
|
||||||
* package_pacman: Build an arch linux pacman package.
|
* package_pacman: Build an arch linux pacman package.
|
||||||
* package_archive: Build an archive package.
|
* package_archive: Build an archive package.
|
||||||
|
|
||||||
Testing Targets
|
Testing Targets
|
||||||
Not associated with building Blender.
|
Not associated with building Blender.
|
||||||
@@ -167,7 +167,7 @@ endef
|
|||||||
|
|
||||||
# This makefile is not meant for Windows
|
# This makefile is not meant for Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
$(error On Windows, use "cmd //c make.bat" instead of "make")
|
$(error On Windows, use "cmd //c make.bat" instead of "make")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# System Vars
|
# System Vars
|
||||||
@@ -379,7 +379,7 @@ deps: .FORCE
|
|||||||
|
|
||||||
@cmake -H"$(DEPS_SOURCE_DIR)" \
|
@cmake -H"$(DEPS_SOURCE_DIR)" \
|
||||||
-B"$(DEPS_BUILD_DIR)" \
|
-B"$(DEPS_BUILD_DIR)" \
|
||||||
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
|
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
|
||||||
|
|
||||||
@echo
|
@echo
|
||||||
@echo Building dependencies ...
|
@echo Building dependencies ...
|
||||||
@@ -456,7 +456,8 @@ project_eclipse: .FORCE
|
|||||||
check_cppcheck: .FORCE
|
check_cppcheck: .FORCE
|
||||||
$(CMAKE_CONFIG)
|
$(CMAKE_CONFIG)
|
||||||
cd "$(BUILD_DIR)" ; \
|
cd "$(BUILD_DIR)" ; \
|
||||||
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
|
$(PYTHON) \
|
||||||
|
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
|
||||||
"$(BLENDER_DIR)/check_cppcheck.txt"
|
"$(BLENDER_DIR)/check_cppcheck.txt"
|
||||||
@echo "written: check_cppcheck.txt"
|
@echo "written: check_cppcheck.txt"
|
||||||
|
|
||||||
@@ -518,8 +519,9 @@ source_archive: .FORCE
|
|||||||
python3 ./build_files/utils/make_source_archive.py
|
python3 ./build_files/utils/make_source_archive.py
|
||||||
|
|
||||||
source_archive_complete: .FORCE
|
source_archive_complete: .FORCE
|
||||||
cmake -S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
|
cmake \
|
||||||
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
|
-S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
|
||||||
|
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
|
||||||
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
|
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
|
||||||
python3 ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
|
python3 ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
|
||||||
|
|
||||||
@@ -527,9 +529,11 @@ source_archive_complete: .FORCE
|
|||||||
INKSCAPE_BIN?="inkscape"
|
INKSCAPE_BIN?="inkscape"
|
||||||
icons: .FORCE
|
icons: .FORCE
|
||||||
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
|
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
|
||||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||||
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
|
INKSCAPE_BIN=$(INKSCAPE_BIN) \
|
||||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||||
|
INKSCAPE_BIN=$(INKSCAPE_BIN) \
|
||||||
|
"$(BLENDER_DIR)/release/datafiles/alert_icons_update.py"
|
||||||
|
|
||||||
icons_geom: .FORCE
|
icons_geom: .FORCE
|
||||||
BLENDER_BIN=$(BLENDER_BIN) \
|
BLENDER_BIN=$(BLENDER_BIN) \
|
||||||
@@ -543,7 +547,7 @@ update_code: .FORCE
|
|||||||
|
|
||||||
format: .FORCE
|
format: .FORCE
|
||||||
PATH="../lib/${OS_NCASE}_${CPU}/llvm/bin/:../lib/${OS_NCASE}_centos7_${CPU}/llvm/bin/:../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
|
PATH="../lib/${OS_NCASE}_${CPU}/llvm/bin/:../lib/${OS_NCASE}_centos7_${CPU}/llvm/bin/:../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
|
||||||
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
|
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@@ -553,8 +557,9 @@ format: .FORCE
|
|||||||
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
||||||
doc_py: .FORCE
|
doc_py: .FORCE
|
||||||
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
|
ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
|
||||||
$(BLENDER_BIN) --background -noaudio --factory-startup \
|
$(BLENDER_BIN) \
|
||||||
--python doc/python_api/sphinx_doc_gen.py
|
--background -noaudio --factory-startup \
|
||||||
|
--python doc/python_api/sphinx_doc_gen.py
|
||||||
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
|
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
|
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
|
||||||
|
|
||||||
@@ -563,8 +568,9 @@ doc_doxy: .FORCE
|
|||||||
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
|
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
|
||||||
|
|
||||||
doc_dna: .FORCE
|
doc_dna: .FORCE
|
||||||
$(BLENDER_BIN) --background -noaudio --factory-startup \
|
$(BLENDER_BIN) \
|
||||||
--python doc/blender_file_format/BlendFileDnaExporter_25.py
|
--background -noaudio --factory-startup \
|
||||||
|
--python doc/blender_file_format/BlendFileDnaExporter_25.py
|
||||||
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
|
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
|
||||||
|
|
||||||
doc_man: .FORCE
|
doc_man: .FORCE
|
||||||
|
@@ -82,7 +82,11 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
include(cmake/openimageio.cmake)
|
include(cmake/openimageio.cmake)
|
||||||
include(cmake/tiff.cmake)
|
include(cmake/tiff.cmake)
|
||||||
include(cmake/flexbison.cmake)
|
if(WIN32)
|
||||||
|
include(cmake/flexbison.cmake)
|
||||||
|
else()
|
||||||
|
include(cmake/flex.cmake)
|
||||||
|
endif()
|
||||||
include(cmake/osl.cmake)
|
include(cmake/osl.cmake)
|
||||||
include(cmake/tbb.cmake)
|
include(cmake/tbb.cmake)
|
||||||
include(cmake/openvdb.cmake)
|
include(cmake/openvdb.cmake)
|
||||||
|
@@ -93,3 +93,4 @@ download_source(GMP)
|
|||||||
download_source(POTRACE)
|
download_source(POTRACE)
|
||||||
download_source(HARU)
|
download_source(HARU)
|
||||||
download_source(ZSTD)
|
download_source(ZSTD)
|
||||||
|
download_source(FLEX)
|
||||||
|
@@ -30,6 +30,7 @@ if(WIN32)
|
|||||||
--enable-w32threads
|
--enable-w32threads
|
||||||
--disable-pthreads
|
--disable-pthreads
|
||||||
--enable-libopenjpeg
|
--enable-libopenjpeg
|
||||||
|
--disable-mediafoundation
|
||||||
)
|
)
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
|
||||||
set(FFMPEG_EXTRA_FLAGS
|
set(FFMPEG_EXTRA_FLAGS
|
||||||
|
28
build_files/build_environment/cmake/flex.cmake
Normal file
28
build_files/build_environment/cmake/flex.cmake
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# ***** 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,6 +106,7 @@ harvest(llvm/include llvm/include "*")
|
|||||||
harvest(llvm/bin llvm/bin "llvm-config")
|
harvest(llvm/bin llvm/bin "llvm-config")
|
||||||
harvest(llvm/lib llvm/lib "libLLVM*.a")
|
harvest(llvm/lib llvm/lib "libLLVM*.a")
|
||||||
harvest(llvm/lib llvm/lib "libclang*.a")
|
harvest(llvm/lib llvm/lib "libclang*.a")
|
||||||
|
harvest(llvm/lib/clang llvm/lib/clang "*.h")
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
harvest(openmp/lib openmp/lib "*")
|
harvest(openmp/lib openmp/lib "*")
|
||||||
harvest(openmp/include openmp/include "*.h")
|
harvest(openmp/include openmp/include "*.h")
|
||||||
|
@@ -29,12 +29,13 @@ elseif(APPLE)
|
|||||||
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
||||||
set(ISPC_EXTRA_ARGS_APPLE
|
set(ISPC_EXTRA_ARGS_APPLE
|
||||||
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
|
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
|
||||||
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
|
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||||
-DARM_ENABLED=On
|
-DARM_ENABLED=On
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(ISPC_EXTRA_ARGS_APPLE
|
set(ISPC_EXTRA_ARGS_APPLE
|
||||||
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
|
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
|
||||||
|
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||||
-DARM_ENABLED=Off
|
-DARM_ENABLED=Off
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
@@ -43,6 +44,7 @@ elseif(UNIX)
|
|||||||
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
|
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
|
||||||
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
|
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
|
||||||
-DARM_ENABLED=Off
|
-DARM_ENABLED=Off
|
||||||
|
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -82,4 +84,9 @@ if(WIN32)
|
|||||||
external_ispc
|
external_ispc
|
||||||
external_flexbison
|
external_flexbison
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
add_dependencies(
|
||||||
|
external_ispc
|
||||||
|
external_flex
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -66,7 +66,11 @@ ExternalProject_Add(ll
|
|||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(BUILD_MODE STREQUAL Release)
|
if(BUILD_MODE STREQUAL Release)
|
||||||
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
|
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
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
set(LLVM_HARVEST_COMMAND
|
set(LLVM_HARVEST_COMMAND
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
|
||||||
|
@@ -45,7 +45,6 @@ ExternalProject_Add(external_openimagedenoise
|
|||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
URL_HASH ${OIDN_HASH_TYPE}=${OIDN_HASH}
|
URL_HASH ${OIDN_HASH_TYPE}=${OIDN_HASH}
|
||||||
PREFIX ${BUILD_DIR}/openimagedenoise
|
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}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/openimagedenoise
|
INSTALL_DIR ${LIBDIR}/openimagedenoise
|
||||||
)
|
)
|
||||||
|
@@ -22,9 +22,8 @@ ExternalProject_Add(external_openmp
|
|||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH}
|
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH}
|
||||||
PREFIX ${BUILD_DIR}/openmp
|
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}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
|
||||||
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_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @rpath/libomp.dylib runtime/src/libomp.dylib && make install
|
||||||
INSTALL_DIR ${LIBDIR}/openmp
|
INSTALL_DIR ${LIBDIR}/openmp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -20,12 +20,10 @@ 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_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_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_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
|
||||||
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
|
|
||||||
else()
|
else()
|
||||||
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
|
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
|
||||||
set(OSL_FLEX_BISON)
|
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_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()
|
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")
|
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")
|
||||||
@@ -51,12 +49,13 @@ set(OSL_EXTRA_ARGS
|
|||||||
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
|
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
|
||||||
-DOSL_BUILD_TESTS=OFF
|
-DOSL_BUILD_TESTS=OFF
|
||||||
-DOSL_BUILD_MATERIALX=OFF
|
-DOSL_BUILD_MATERIALX=OFF
|
||||||
|
-DPNG_ROOT=${LIBDIR}/png
|
||||||
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
||||||
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
|
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
|
||||||
${OSL_FLEX_BISON}
|
${OSL_FLEX_BISON}
|
||||||
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
|
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
|
||||||
-DBUILD_SHARED_LIBS=OFF
|
-DBUILD_SHARED_LIBS=OFF
|
||||||
${OSL_PLATFORM_FLAGS}
|
-DLINKSTATIC=ON
|
||||||
-DOSL_BUILD_PLUGINS=OFF
|
-DOSL_BUILD_PLUGINS=OFF
|
||||||
-DSTOP_ON_WARNING=OFF
|
-DSTOP_ON_WARNING=OFF
|
||||||
-DUSE_LLVM_BITCODE=OFF
|
-DUSE_LLVM_BITCODE=OFF
|
||||||
@@ -69,13 +68,9 @@ set(OSL_EXTRA_ARGS
|
|||||||
${OSL_SIMD_FLAGS}
|
${OSL_SIMD_FLAGS}
|
||||||
-Dpugixml_ROOT=${LIBDIR}/pugixml
|
-Dpugixml_ROOT=${LIBDIR}/pugixml
|
||||||
-DUSE_PYTHON=OFF
|
-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
|
ExternalProject_Add(external_osl
|
||||||
URL file://${PACKAGE_DIR}/${OSL_FILE}
|
URL file://${PACKAGE_DIR}/${OSL_FILE}
|
||||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||||
@@ -93,10 +88,20 @@ add_dependencies(
|
|||||||
ll
|
ll
|
||||||
external_openexr
|
external_openexr
|
||||||
external_zlib
|
external_zlib
|
||||||
external_flexbison
|
|
||||||
external_openimageio
|
external_openimageio
|
||||||
external_pugixml
|
external_pugixml
|
||||||
)
|
)
|
||||||
|
if(WIN32)
|
||||||
|
add_dependencies(
|
||||||
|
external_osl
|
||||||
|
external_flexbison
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_dependencies(
|
||||||
|
external_osl
|
||||||
|
external_flex
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(BUILD_MODE STREQUAL Release)
|
if(BUILD_MODE STREQUAL Release)
|
||||||
|
@@ -152,35 +152,20 @@ set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
|
|||||||
set(OPENCOLORIO_HASH_TYPE MD5)
|
set(OPENCOLORIO_HASH_TYPE MD5)
|
||||||
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
|
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
|
||||||
|
|
||||||
if(BLENDER_PLATFORM_ARM)
|
set(LLVM_VERSION 12.0.0)
|
||||||
# Newer version required by ISPC with arm support.
|
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||||
set(LLVM_VERSION 11.0.1)
|
set(LLVM_HASH 5a4fab4d7fc84aefffb118ac2c8a4fc0)
|
||||||
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.src.tar.xz)
|
set(LLVM_HASH_TYPE MD5)
|
||||||
set(LLVM_HASH e700af40ab83463e4e9ab0ba3708312e)
|
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
|
||||||
set(LLVM_HASH_TYPE MD5)
|
|
||||||
set(LLVM_FILE llvm-project-${LLVM_VERSION}.src.tar.xz)
|
|
||||||
|
|
||||||
set(OPENMP_VERSION 9.0.1)
|
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
||||||
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${OPENMP_VERSION}/openmp-${OPENMP_VERSION}.src.tar.xz)
|
set(OPENMP_HASH ac48ce3e4582ccb82f81ab59eb3fc9dc)
|
||||||
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
|
set(OPENMP_HASH_TYPE MD5)
|
||||||
set(OPENMP_HASH_TYPE MD5)
|
set(OPENMP_FILE openmp-${LLVM_VERSION}.src.tar.xz)
|
||||||
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(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
|
set(OPENIMAGEIO_VERSION 2.2.15.1)
|
||||||
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_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||||
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
|
set(OPENIMAGEIO_HASH 3db5c5f0b3dc91597c75e5df09eb9072)
|
||||||
set(OPENIMAGEIO_HASH_TYPE MD5)
|
set(OPENIMAGEIO_HASH_TYPE MD5)
|
||||||
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
|
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||||
|
|
||||||
@@ -190,9 +175,9 @@ set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
|
|||||||
set(TIFF_HASH_TYPE MD5)
|
set(TIFF_HASH_TYPE MD5)
|
||||||
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
|
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(OSL_VERSION 1.11.10.0)
|
set(OSL_VERSION 1.11.14.1)
|
||||||
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
|
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
|
||||||
set(OSL_HASH dfdc23597aeef083832cbada62211756)
|
set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
|
||||||
set(OSL_HASH_TYPE MD5)
|
set(OSL_HASH_TYPE MD5)
|
||||||
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
|
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
|
||||||
|
|
||||||
@@ -370,12 +355,18 @@ set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
|
|||||||
set(PUGIXML_HASH_TYPE MD5)
|
set(PUGIXML_HASH_TYPE MD5)
|
||||||
set(PUGIXML_FILE pugixml-${PUGIXML_VERSION}.tar.gz)
|
set(PUGIXML_FILE pugixml-${PUGIXML_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(FLEXBISON_VERSION 2.5.5)
|
set(FLEXBISON_VERSION 2.5.24)
|
||||||
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
|
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison/win_flex_bison-${FLEXBISON_VERSION}.zip)
|
||||||
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
|
set(FLEXBISON_HASH 6b549d43e34ece0e8ed05af92daa31c4)
|
||||||
set(FLEXBISON_HASH_TYPE MD5)
|
set(FLEXBISON_HASH_TYPE MD5)
|
||||||
set(FLEXBISON_FILE win_flex_bison-${FLEXBISON_VERSION}.zip)
|
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.
|
# Libraries to keep Python modules static on Linux.
|
||||||
|
|
||||||
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
|
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
|
||||||
@@ -432,9 +423,9 @@ set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
|
|||||||
set(USD_HASH_TYPE MD5)
|
set(USD_HASH_TYPE MD5)
|
||||||
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
|
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
|
||||||
|
|
||||||
set(OIDN_VERSION 1.4.0)
|
set(OIDN_VERSION 1.4.1)
|
||||||
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
||||||
set(OIDN_HASH 421824019becc5b664a22a2b98332bc5)
|
set(OIDN_HASH df4007b0ab93b1c41cdf223b075d01c0)
|
||||||
set(OIDN_HASH_TYPE MD5)
|
set(OIDN_HASH_TYPE MD5)
|
||||||
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
|
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
|
||||||
|
|
||||||
@@ -444,10 +435,10 @@ set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
|
|||||||
set(LIBGLU_HASH_TYPE MD5)
|
set(LIBGLU_HASH_TYPE MD5)
|
||||||
set(LIBGLU_FILE glu-${LIBGLU_VERSION}.tar.xz)
|
set(LIBGLU_FILE glu-${LIBGLU_VERSION}.tar.xz)
|
||||||
|
|
||||||
set(MESA_VERSION 20.3.4)
|
set(MESA_VERSION 21.1.5)
|
||||||
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
|
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa/mesa-${MESA_VERSION}.tar.xz)
|
||||||
set(MESA_HASH 556338446aef8ae947a789b3e0b5e056)
|
set(MESA_HASH 022c7293074aeeced2278c872db4fa693147c70f8595b076cf3f1ef81520766d)
|
||||||
set(MESA_HASH_TYPE MD5)
|
set(MESA_HASH_TYPE SHA256)
|
||||||
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
|
set(MESA_FILE mesa-${MESA_VERSION}.tar.xz)
|
||||||
|
|
||||||
set(NASM_VERSION 2.15.02)
|
set(NASM_VERSION 2.15.02)
|
||||||
@@ -468,19 +459,11 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/
|
|||||||
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
|
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
|
||||||
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
||||||
|
|
||||||
if(BLENDER_PLATFORM_ARM)
|
set(ISPC_VERSION v1.16.0)
|
||||||
# Unreleased version with macOS arm support.
|
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||||
set(ISPC_URI https://github.com/ispc/ispc/archive/f5949c055eb9eeb93696978a3da4bfb3a6a30b35.zip)
|
set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
|
||||||
set(ISPC_HASH d382fea18d01dbd0cd05d9e1ede36d7d)
|
set(ISPC_HASH_TYPE MD5)
|
||||||
set(ISPC_HASH_TYPE MD5)
|
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
|
||||||
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_VERSION 6.2.0)
|
||||||
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
||||||
|
@@ -474,25 +474,25 @@ OPENEXR_FORCE_REBUILD=false
|
|||||||
OPENEXR_SKIP=false
|
OPENEXR_SKIP=false
|
||||||
_with_built_openexr=false
|
_with_built_openexr=false
|
||||||
|
|
||||||
OIIO_VERSION="2.1.15.0"
|
OIIO_VERSION="2.2.15.1"
|
||||||
OIIO_VERSION_SHORT="2.1"
|
OIIO_VERSION_SHORT="2.2"
|
||||||
OIIO_VERSION_MIN="2.1.12"
|
OIIO_VERSION_MIN="2.1.12"
|
||||||
OIIO_VERSION_MAX="2.2.10"
|
OIIO_VERSION_MAX="2.3.0"
|
||||||
OIIO_FORCE_BUILD=false
|
OIIO_FORCE_BUILD=false
|
||||||
OIIO_FORCE_REBUILD=false
|
OIIO_FORCE_REBUILD=false
|
||||||
OIIO_SKIP=false
|
OIIO_SKIP=false
|
||||||
|
|
||||||
LLVM_VERSION="9.0.1"
|
LLVM_VERSION="12.0.0"
|
||||||
LLVM_VERSION_SHORT="9.0"
|
LLVM_VERSION_SHORT="12.0"
|
||||||
LLVM_VERSION_MIN="6.0"
|
LLVM_VERSION_MIN="11.0"
|
||||||
LLVM_VERSION_MAX="12.0"
|
LLVM_VERSION_MAX="13.0"
|
||||||
LLVM_VERSION_FOUND=""
|
LLVM_VERSION_FOUND=""
|
||||||
LLVM_FORCE_BUILD=false
|
LLVM_FORCE_BUILD=false
|
||||||
LLVM_FORCE_REBUILD=false
|
LLVM_FORCE_REBUILD=false
|
||||||
LLVM_SKIP=false
|
LLVM_SKIP=false
|
||||||
|
|
||||||
# OSL needs to be compiled for now!
|
# OSL needs to be compiled for now!
|
||||||
OSL_VERSION="1.11.10.0"
|
OSL_VERSION="1.11.14.1"
|
||||||
OSL_VERSION_SHORT="1.11"
|
OSL_VERSION_SHORT="1.11"
|
||||||
OSL_VERSION_MIN="1.11"
|
OSL_VERSION_MIN="1.11"
|
||||||
OSL_VERSION_MAX="2.0"
|
OSL_VERSION_MAX="2.0"
|
||||||
@@ -553,7 +553,7 @@ EMBREE_FORCE_BUILD=false
|
|||||||
EMBREE_FORCE_REBUILD=false
|
EMBREE_FORCE_REBUILD=false
|
||||||
EMBREE_SKIP=false
|
EMBREE_SKIP=false
|
||||||
|
|
||||||
OIDN_VERSION="1.4.0"
|
OIDN_VERSION="1.4.1"
|
||||||
OIDN_VERSION_SHORT="1.4"
|
OIDN_VERSION_SHORT="1.4"
|
||||||
OIDN_VERSION_MIN="1.4.0"
|
OIDN_VERSION_MIN="1.4.0"
|
||||||
OIDN_VERSION_MAX="1.5"
|
OIDN_VERSION_MAX="1.5"
|
||||||
@@ -561,7 +561,7 @@ OIDN_FORCE_BUILD=false
|
|||||||
OIDN_FORCE_REBUILD=false
|
OIDN_FORCE_REBUILD=false
|
||||||
OIDN_SKIP=false
|
OIDN_SKIP=false
|
||||||
|
|
||||||
ISPC_VERSION="1.14.1"
|
ISPC_VERSION="1.16.0"
|
||||||
|
|
||||||
FFMPEG_VERSION="4.4"
|
FFMPEG_VERSION="4.4"
|
||||||
FFMPEG_VERSION_SHORT="4.4"
|
FFMPEG_VERSION_SHORT="4.4"
|
||||||
@@ -1129,7 +1129,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
|||||||
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
||||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||||
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
|
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
|
||||||
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
|
||||||
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\""
|
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\""
|
||||||
|
|
||||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||||
@@ -1447,9 +1447,7 @@ compile_Python() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
|
ERROR "Python--$PYTHON_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -1465,6 +1463,9 @@ compile_Python() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-python option."
|
INFO "If you want to force rebuild of this lib, use the --force-python option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "python-$PYTHON_VERSION_SHORT"
|
run_ldconfig "python-$PYTHON_VERSION_SHORT"
|
||||||
|
|
||||||
# Extra step: install required modules with pip.
|
# Extra step: install required modules with pip.
|
||||||
@@ -1558,9 +1559,7 @@ compile_Boost() {
|
|||||||
--prefix=$_inst --disable-icu boost.locale.icu=off install
|
--prefix=$_inst --disable-icu boost.locale.icu=off install
|
||||||
./b2 --clean
|
./b2 --clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
|
ERROR "Boost-$BOOST_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -1574,7 +1573,9 @@ compile_Boost() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-boost option."
|
INFO "If you want to force rebuild of this lib, use the --force-boost option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Just always run it, much simpler this way!
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "boost"
|
run_ldconfig "boost"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1687,9 +1688,7 @@ compile_TBB() {
|
|||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "TBB-$TBB_VERSION$TBB_VERSION_UPDATE failed to compile, exiting"
|
ERROR "TBB-$TBB_VERSION$TBB_VERSION_UPDATE failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -1703,6 +1702,9 @@ compile_TBB() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-tbb option."
|
INFO "If you want to force rebuild of this lib, use the --force-tbb option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "tbb"
|
run_ldconfig "tbb"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1822,9 +1824,7 @@ compile_OCIO() {
|
|||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
|
ERROR "OpenColorIO-$OCIO_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -1838,6 +1838,9 @@ compile_OCIO() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-ocio option."
|
INFO "If you want to force rebuild of this lib, use the --force-ocio option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "ocio"
|
run_ldconfig "ocio"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1953,9 +1956,7 @@ compile_OPENEXR() {
|
|||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
|
ERROR "OpenEXR-$OPENEXR_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -1971,7 +1972,9 @@ compile_OPENEXR() {
|
|||||||
|
|
||||||
_with_built_openexr=true
|
_with_built_openexr=true
|
||||||
|
|
||||||
# Just always run it, much simpler this way!
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "openexr"
|
run_ldconfig "openexr"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2112,9 +2115,7 @@ compile_OIIO() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
|
ERROR "OpenImageIO-$OIIO_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2128,7 +2129,9 @@ compile_OIIO() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-oiio option."
|
INFO "If you want to force rebuild of this lib, use the --force-oiio option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Just always run it, much simpler this way!
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "oiio"
|
run_ldconfig "oiio"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2237,9 +2240,7 @@ compile_LLVM() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
|
ERROR "LLVM-$LLVM_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2252,6 +2253,10 @@ compile_LLVM() {
|
|||||||
INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to do!"
|
INFO "Own LLVM-$LLVM_VERSION (CLANG included) is up to date, nothing to do!"
|
||||||
INFO "If you want to force rebuild of this lib, use the --force-llvm option."
|
INFO "If you want to force rebuild of this lib, use the --force-llvm option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -2316,6 +2321,7 @@ compile_OSL() {
|
|||||||
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
||||||
-xf $_src.tar.gz
|
-xf $_src.tar.gz
|
||||||
fi
|
fi
|
||||||
|
patch -d $_src -p1 < $SCRIPT_DIR/patches/osl.diff
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $_src
|
cd $_src
|
||||||
@@ -2338,7 +2344,6 @@ compile_OSL() {
|
|||||||
|
|
||||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
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 STOP_ON_WARNING=OFF"
|
||||||
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
|
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
|
||||||
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
|
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
|
||||||
@@ -2346,7 +2351,10 @@ compile_OSL() {
|
|||||||
cmake_d="$cmake_d -D USE_PARTIO=OFF"
|
cmake_d="$cmake_d -D USE_PARTIO=OFF"
|
||||||
cmake_d="$cmake_d -D OSL_BUILD_MATERIALX=OFF"
|
cmake_d="$cmake_d -D OSL_BUILD_MATERIALX=OFF"
|
||||||
cmake_d="$cmake_d -D USE_QT=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_PYTHON=OFF"
|
||||||
|
cmake_d="$cmake_d -D USE_PARTIO=OFF"
|
||||||
|
cmake_d="$cmake_d -D INSTALL_DOCS=OFF"
|
||||||
|
|
||||||
if [ $(uname -m) != "aarch64" ]; then
|
if [ $(uname -m) != "aarch64" ]; then
|
||||||
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
cmake_d="$cmake_d -D USE_SIMD=sse2"
|
||||||
@@ -2368,10 +2376,7 @@ compile_OSL() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $INST/oiio ]; then
|
if [ -d $INST/oiio ]; then
|
||||||
cmake_d="$cmake_d -D OPENIMAGEIO_ROOT_DIR=$INST/oiio"
|
cmake_d="$cmake_d -D OpenImageIO_ROOT=$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
|
fi
|
||||||
|
|
||||||
if [ ! -z $LLVM_VERSION_FOUND ]; then
|
if [ ! -z $LLVM_VERSION_FOUND ]; then
|
||||||
@@ -2390,9 +2395,7 @@ compile_OSL() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
|
ERROR "OpenShadingLanguage-$OSL_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2406,6 +2409,9 @@ compile_OSL() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-osl option."
|
INFO "If you want to force rebuild of this lib, use the --force-osl option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "osl"
|
run_ldconfig "osl"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2506,9 +2512,7 @@ compile_OSD() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
|
ERROR "OpenSubdiv-$OSD_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2522,6 +2526,9 @@ compile_OSD() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-osd option."
|
INFO "If you want to force rebuild of this lib, use the --force-osd option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "osd"
|
run_ldconfig "osd"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2611,9 +2618,7 @@ compile_BLOSC() {
|
|||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "Blosc-$OPENVDB_BLOSC_VERSION failed to compile, exiting"
|
ERROR "Blosc-$OPENVDB_BLOSC_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2626,6 +2631,9 @@ compile_BLOSC() {
|
|||||||
|
|
||||||
magic_compile_set blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
|
magic_compile_set blosc-$OPENVDB_BLOSC_VERSION $blosc_magic
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "blosc"
|
run_ldconfig "blosc"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2716,9 +2724,7 @@ install_NanoVDB() {
|
|||||||
#~ mkdir -p $_inst
|
#~ mkdir -p $_inst
|
||||||
#~ cp -r $_src/include $_inst/include
|
#~ cp -r $_src/include $_inst/include
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "NanoVDB-v$OPENVDB_VERSION failed to install, exiting"
|
ERROR "NanoVDB-v$OPENVDB_VERSION failed to install, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2730,6 +2736,10 @@ install_NanoVDB() {
|
|||||||
else
|
else
|
||||||
INFO "Own NanoVDB-v$OPENVDB_VERSION is up to date, nothing to do!"
|
INFO "Own NanoVDB-v$OPENVDB_VERSION is up to date, nothing to do!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2849,9 +2859,7 @@ compile_OPENVDB() {
|
|||||||
make -j$THREADS install
|
make -j$THREADS install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenVDB-$OPENVDB_VERSION failed to compile, exiting"
|
ERROR "OpenVDB-$OPENVDB_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2865,6 +2873,9 @@ compile_OPENVDB() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-openvdb option."
|
INFO "If you want to force rebuild of this lib, use the --force-openvdb option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "openvdb"
|
run_ldconfig "openvdb"
|
||||||
|
|
||||||
if [ "$WITH_NANOVDB" = true ]; then
|
if [ "$WITH_NANOVDB" = true ]; then
|
||||||
@@ -2962,9 +2973,7 @@ compile_ALEMBIC() {
|
|||||||
make -j$THREADS install
|
make -j$THREADS install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
|
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -2978,6 +2987,9 @@ compile_ALEMBIC() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
|
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "alembic"
|
run_ldconfig "alembic"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3062,9 +3074,7 @@ compile_USD() {
|
|||||||
make -j$THREADS install
|
make -j$THREADS install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "USD-$USD_VERSION failed to compile, exiting"
|
ERROR "USD-$USD_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3078,6 +3088,9 @@ compile_USD() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-usd option."
|
INFO "If you want to force rebuild of this lib, use the --force-usd option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "usd"
|
run_ldconfig "usd"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3171,9 +3184,7 @@ compile_OpenCOLLADA() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
|
ERROR "OpenCOLLADA-$OPENCOLLADA_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3186,6 +3197,10 @@ compile_OpenCOLLADA() {
|
|||||||
INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
|
INFO "Own OpenCOLLADA-$OPENCOLLADA_VERSION is up to date, nothing to do!"
|
||||||
INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
|
INFO "If you want to force rebuild of this lib, use the --force-opencollada option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -3286,9 +3301,7 @@ compile_Embree() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "Embree-$EMBREE_VERSION failed to compile, exiting"
|
ERROR "Embree-$EMBREE_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3301,6 +3314,10 @@ compile_Embree() {
|
|||||||
INFO "Own Embree-$EMBREE_VERSION is up to date, nothing to do!"
|
INFO "Own Embree-$EMBREE_VERSION is up to date, nothing to do!"
|
||||||
INFO "If you want to force rebuild of this lib, use the --force-embree option."
|
INFO "If you want to force rebuild of this lib, use the --force-embree option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -3363,9 +3380,7 @@ install_ISPC() {
|
|||||||
mkdir -p $_inst
|
mkdir -p $_inst
|
||||||
cp -r $_src/bin $_inst/bin
|
cp -r $_src/bin $_inst/bin
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "ISPC-v$ISPC_VERSION failed to install, exiting"
|
ERROR "ISPC-v$ISPC_VERSION failed to install, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3378,6 +3393,10 @@ install_ISPC() {
|
|||||||
INFO "Own ISPC-v$ISPC_VERSION is up to date, nothing to do!"
|
INFO "Own ISPC-v$ISPC_VERSION is up to date, nothing to do!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
|
|
||||||
_ispc_path_bin=$_inst/bin
|
_ispc_path_bin=$_inst/bin
|
||||||
run_ldconfig "ispc"
|
run_ldconfig "ispc"
|
||||||
}
|
}
|
||||||
@@ -3477,9 +3496,7 @@ compile_OIDN() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "OpenImageDenoise-$OIDN_VERSION failed to compile, exiting"
|
ERROR "OpenImageDenoise-$OIDN_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3493,6 +3510,9 @@ compile_OIDN() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-oidn option."
|
INFO "If you want to force rebuild of this lib, use the --force-oidn option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "oidn"
|
run_ldconfig "oidn"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3609,9 +3629,7 @@ compile_FFmpeg() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "FFmpeg-$FFMPEG_VERSION failed to compile, exiting"
|
ERROR "FFmpeg-$FFMPEG_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3624,6 +3642,10 @@ compile_FFmpeg() {
|
|||||||
INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
|
INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
|
||||||
INFO "If you want to force rebuild of this lib, use the --force-ffmpeg option."
|
INFO "If you want to force rebuild of this lib, use the --force-ffmpeg option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
@@ -3722,9 +3744,7 @@ compile_XR_OpenXR_SDK() {
|
|||||||
make -j$THREADS && make install
|
make -j$THREADS && make install
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
if [ -d $_inst ]; then
|
if [ ! -d $_inst ]; then
|
||||||
_create_inst_shortcut
|
|
||||||
else
|
|
||||||
ERROR "XR-OpenXR-SDK-$XR_OPENXR_VERSION failed to compile, exiting"
|
ERROR "XR-OpenXR-SDK-$XR_OPENXR_VERSION failed to compile, exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -3738,6 +3758,9 @@ compile_XR_OpenXR_SDK() {
|
|||||||
INFO "If you want to force rebuild of this lib, use the --force-xr-openxr option."
|
INFO "If you want to force rebuild of this lib, use the --force-xr-openxr option."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $_inst ]; then
|
||||||
|
_create_inst_shortcut
|
||||||
|
fi
|
||||||
run_ldconfig "xr-openxr-sdk"
|
run_ldconfig "xr-openxr-sdk"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3844,7 +3867,7 @@ install_DEB() {
|
|||||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||||
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
|
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
|
||||||
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev"
|
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev"
|
||||||
# libglewmx-dev (broken in deb testing currently...)
|
# libglewmx-dev (broken in deb testing currently...)
|
||||||
|
|
||||||
VORBIS_USE=true
|
VORBIS_USE=true
|
||||||
@@ -4112,6 +4135,8 @@ install_DEB() {
|
|||||||
|
|
||||||
|
|
||||||
PRINT ""
|
PRINT ""
|
||||||
|
# Debian OIIO includes again libopencv, without even properly dealing with this dependency...
|
||||||
|
OIIO_FORCE_BUILD=true
|
||||||
if [ "$OIIO_SKIP" = true ]; then
|
if [ "$OIIO_SKIP" = true ]; then
|
||||||
WARNING "Skipping OpenImageIO installation, as requested..."
|
WARNING "Skipping OpenImageIO installation, as requested..."
|
||||||
elif [ "$OIIO_FORCE_BUILD" = true ]; then
|
elif [ "$OIIO_FORCE_BUILD" = true ]; then
|
||||||
@@ -4514,7 +4539,7 @@ install_RPM() {
|
|||||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||||
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
||||||
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
|
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
|
||||||
gmp-devel pugixml-devel potrace-devel libharu-devel"
|
gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel"
|
||||||
|
|
||||||
OPENJPEG_USE=true
|
OPENJPEG_USE=true
|
||||||
VORBIS_USE=true
|
VORBIS_USE=true
|
||||||
@@ -5092,10 +5117,11 @@ install_ARCH() {
|
|||||||
BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
|
BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_packages="$BASE_DEVEL git cmake fontconfig \
|
_packages="$BASE_DEVEL git cmake fontconfig flex \
|
||||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
||||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu"
|
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \
|
||||||
|
zstd"
|
||||||
|
|
||||||
OPENJPEG_USE=true
|
OPENJPEG_USE=true
|
||||||
VORBIS_USE=true
|
VORBIS_USE=true
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
--- 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,24 +34,3 @@ diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/incl
|
|||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
#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
|
|
@@ -1,23 +0,0 @@
|
|||||||
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,18 +1,3 @@
|
|||||||
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
|
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
|
--- 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
|
+++ external_osl/src/include/OSL/llvm_util.h 2018-08-25 14:05:00 -0600
|
||||||
@@ -63,19 +48,50 @@ 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")
|
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
||||||
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
||||||
diff --git a/src/liboslexec/llvm_util.cpp b/src/liboslexec/llvm_util.cpp
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index 445f6400..3d468de2 100644
|
index 990f50d69..46ef7351d 100644
|
||||||
--- a/src/liboslexec/llvm_util.cpp
|
--- a/CMakeLists.txt
|
||||||
+++ b/src/liboslexec/llvm_util.cpp
|
+++ b/CMakeLists.txt
|
||||||
@@ -3430,8 +3430,9 @@ LLVM_Util::call_function (llvm::Value *func, cspan<llvm::Value *> args)
|
@@ -252,11 +252,9 @@ install (EXPORT OSL_EXPORTED_TARGETS
|
||||||
#endif
|
FILE ${OSL_TARGETS_EXPORT_NAME}
|
||||||
//llvm_gen_debug_printf (std::string("start ") + std::string(name));
|
NAMESPACE ${PROJECT_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,
|
-osl_add_all_tests()
|
||||||
+ llvm::ArrayRef<llvm::Value*>(args.data(), args.size()));
|
-
|
||||||
#else
|
+if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT)
|
||||||
llvm::Value *r = builder().CreateCall (func, llvm::ArrayRef<llvm::Value *>(args.data(), args.size()));
|
+ 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
|
||||||
#endif
|
#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>
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
set(WITH_ASSERT_ABORT ON CACHE BOOL "" FORCE)
|
set(WITH_ASSERT_ABORT ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_COMPILER_ASAN ON 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_CYCLES_NATIVE_ONLY ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
|
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_GTESTS ON CACHE BOOL "" FORCE)
|
set(WITH_GTESTS ON CACHE BOOL "" FORCE)
|
||||||
|
@@ -411,25 +411,9 @@ if(WITH_OPENMP)
|
|||||||
set(OPENMP_FOUND ON)
|
set(OPENMP_FOUND ON)
|
||||||
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||||
set(OpenMP_LINKER_FLAGS "-L'${LIBDIR}/openmp/lib' -lomp")
|
set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
|
||||||
|
set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
|
||||||
# Copy libomp.dylib to allow executables like datatoc and tests to work.
|
set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
|
||||||
# `@executable_path/../Resources/lib/` `LC_ID_DYLIB` is added by the deps builder.
|
|
||||||
# For single config generator datatoc, tests etc.
|
|
||||||
execute_process(
|
|
||||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
|
|
||||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
|
|
||||||
)
|
|
||||||
# For multi-config generator datatoc, etc.
|
|
||||||
execute_process(
|
|
||||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
|
|
||||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
|
|
||||||
)
|
|
||||||
# For multi-config generator tests.
|
|
||||||
execute_process(
|
|
||||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
|
|
||||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -511,3 +495,22 @@ if(WITH_COMPILER_CCACHE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# For binaries that are built but not installed (also not distributed) (datatoc,
|
||||||
|
# makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
|
||||||
|
# CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next to each binary.
|
||||||
|
#
|
||||||
|
# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
|
||||||
|
# to locate the dylibs at @executable_path, next to the Blender executable.
|
||||||
|
#
|
||||||
|
# For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
|
||||||
|
# dylib in an adjacent folder.
|
||||||
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
|
list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
|
||||||
|
|
||||||
|
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
||||||
|
list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
|
||||||
|
|
||||||
|
if(WITH_PYTHON_MODULE)
|
||||||
|
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
|
||||||
|
endif()
|
||||||
|
@@ -217,8 +217,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_WINDOWS_PDB)
|
if(WITH_WINDOWS_PDB)
|
||||||
set(PDB_INFO_OVERRIDE_FLAGS "${SYMBOL_FORMAT_RELEASE}")
|
set(PDB_INFO_OVERRIDE_FLAGS "${SYMBOL_FORMAT_RELEASE}")
|
||||||
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /MDd ${SYMBOL_FORMAT}")
|
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /MDd ${SYMBOL_FORMAT}")
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
Pipeline Config
|
Pipeline Config
|
||||||
===============
|
===============
|
||||||
|
|
||||||
This configuration file is used by buildbot new pipeline for the `update-code` step.
|
The `yaml` configuration file is used by buildbot build pipeline `update-code` step.
|
||||||
|
|
||||||
It will soon be used by the ../utils/make_update.py script.
|
The file allows to set branches or specific commits for both git submodules and svn artifacts. Can also define various build package versions for use by build workers. Especially useful in experimental and release branches.
|
||||||
|
|
||||||
Both buildbot and developers will eventually use the same configuration file.
|
NOTE:
|
||||||
|
* The configuration file is ```NOT``` used by the `../utils/make_update.py` script.
|
||||||
|
* That will implemented in the future.
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
"update-code":
|
|
||||||
{
|
|
||||||
"git" :
|
|
||||||
{
|
|
||||||
"submodules":
|
|
||||||
[
|
|
||||||
{ "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", "branch": "master", "commit_id": "HEAD" }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"svn":
|
|
||||||
{
|
|
||||||
"tests": { "path": "lib/tests", "branch": "trunk", "commit_id": "HEAD" },
|
|
||||||
"libraries":
|
|
||||||
{
|
|
||||||
"darwin-x86_64": { "path": "lib/darwin", "branch": "trunk", "commit_id": "HEAD" },
|
|
||||||
"darwin-arm64": { "path": "lib/darwin_arm64", "branch": "trunk", "commit_id": "HEAD" },
|
|
||||||
"linux-x86_64": { "path": "lib/linux_centos7_x86_64", "branch": "trunk", "commit_id": "HEAD" },
|
|
||||||
"windows-amd64": { "path": "lib/win64_vc15", "branch": "trunk", "commit_id": "HEAD" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"buildbot":
|
|
||||||
{
|
|
||||||
"gcc":
|
|
||||||
{
|
|
||||||
"version": "9.0"
|
|
||||||
},
|
|
||||||
"sdks":
|
|
||||||
{
|
|
||||||
"optix":
|
|
||||||
{
|
|
||||||
"version": "7.1.0"
|
|
||||||
},
|
|
||||||
"cuda10":
|
|
||||||
{
|
|
||||||
"version": "10.1"
|
|
||||||
},
|
|
||||||
"cuda11":
|
|
||||||
{
|
|
||||||
"version": "11.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"cmake":
|
|
||||||
{
|
|
||||||
"default":
|
|
||||||
{
|
|
||||||
"version": "any",
|
|
||||||
"overrides":
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"darwin-x86_64":
|
|
||||||
{
|
|
||||||
"overrides":
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"darwin-arm64":
|
|
||||||
{
|
|
||||||
"overrides":
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"linux-x86_64":
|
|
||||||
{
|
|
||||||
"overrides":
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"windows-amd64":
|
|
||||||
{
|
|
||||||
"overrides":
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
70
build_files/config/pipeline_config.yaml
Normal file
70
build_files/config/pipeline_config.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
#
|
||||||
|
# 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: {}
|
34
build_files/windows/doc_py.cmd
Normal file
34
build_files/windows/doc_py.cmd
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
set SOURCEDIR=%BLENDER_DIR%/doc/python_api/sphinx-in
|
||||||
|
set BUILDDIR=%BLENDER_DIR%/doc/python_api/sphinx-out
|
||||||
|
if "%BF_LANG%" == "" set BF_LANG=en
|
||||||
|
set SPHINXOPTS=-j auto -D language=%BF_LANG%
|
||||||
|
|
||||||
|
call "%~dp0\find_sphinx.cmd"
|
||||||
|
|
||||||
|
if EXIST "%SPHINX_BIN%" (
|
||||||
|
goto detect_sphinx_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo unable to locate sphinx-build, run "set sphinx_BIN=full_path_to_sphinx-build.exe"
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_sphinx_done
|
||||||
|
|
||||||
|
call "%~dp0\find_blender.cmd"
|
||||||
|
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe"
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_blender_done
|
||||||
|
|
||||||
|
%BLENDER_BIN% ^
|
||||||
|
--background -noaudio --factory-startup ^
|
||||||
|
--python %BLENDER_DIR%/doc/python_api/sphinx_doc_gen.py
|
||||||
|
|
||||||
|
%SPHINX_BIN% -b html %SPHINXOPTS% %O% %SOURCEDIR% %BUILDDIR%
|
||||||
|
|
||||||
|
:EOF
|
28
build_files/windows/find_blender.cmd
Normal file
28
build_files/windows/find_blender.cmd
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
REM First see if there is an environment variable set
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Check the build folder next, if ninja was used there will be no
|
||||||
|
REM debug/release folder
|
||||||
|
set BLENDER_BIN=%BUILD_DIR%\bin\blender.exe
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Check the release folder next
|
||||||
|
set BLENDER_BIN=%BUILD_DIR%\bin\release\blender.exe
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Check the debug folder next
|
||||||
|
set BLENDER_BIN=%BUILD_DIR%\bin\debug\blender.exe
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM at this point, we don't know where blender is, clear the variable
|
||||||
|
set BLENDER_BIN=
|
||||||
|
|
||||||
|
:detect_blender_done
|
21
build_files/windows/find_inkscape.cmd
Normal file
21
build_files/windows/find_inkscape.cmd
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
REM First see if there is an environment variable set
|
||||||
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
goto detect_inkscape_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Then see if inkscape is available in the path
|
||||||
|
for %%X in (inkscape.exe) do (set INKSCAPE_BIN=%%~$PATH:X)
|
||||||
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
goto detect_inkscape_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Finally see if it is perhaps installed at the default location
|
||||||
|
set INKSCAPE_BIN=%ProgramFiles%\Inkscape\bin\inkscape.exe
|
||||||
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
goto detect_inkscape_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM If still not found clear the variable
|
||||||
|
set INKSCAPE_BIN=
|
||||||
|
|
||||||
|
:detect_inkscape_done
|
29
build_files/windows/find_sphinx.cmd
Normal file
29
build_files/windows/find_sphinx.cmd
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
REM First see if there is an environment variable set
|
||||||
|
if EXIST "%SPHINX_BIN%" (
|
||||||
|
goto detect_sphinx_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Then see if inkscape is available in the path
|
||||||
|
for %%X in (sphinx-build.exe) do (set SPHINX_BIN=%%~$PATH:X)
|
||||||
|
if EXIST "%SPHINX_BIN%" (
|
||||||
|
goto detect_sphinx_done
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Finally see if it is perhaps installed at the default location
|
||||||
|
set SPHINX_BIN=%ProgramFiles%\Inkscape\bin\inkscape.exe
|
||||||
|
if EXIST "%SPHINX_BIN%" (
|
||||||
|
goto detect_sphinx_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||||
|
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||||
|
echo.may add the Sphinx directory to PATH.
|
||||||
|
echo.
|
||||||
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
|
echo.http://sphinx-doc.org/
|
||||||
|
|
||||||
|
REM If still not found clear the variable
|
||||||
|
set SPHINX_BIN=
|
||||||
|
|
||||||
|
:detect_sphinx_done
|
42
build_files/windows/icons.cmd
Normal file
42
build_files/windows/icons.cmd
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo python not found at %PYTHON%
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_python_done
|
||||||
|
echo found python (%PYTHON%)
|
||||||
|
|
||||||
|
call "%~dp0\find_inkscape.cmd"
|
||||||
|
|
||||||
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
goto detect_inkscape_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo unable to locate inkscape, run "set inkscape_BIN=full_path_to_inkscape.exe"
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_inkscape_done
|
||||||
|
|
||||||
|
call "%~dp0\find_blender.cmd"
|
||||||
|
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe"
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_blender_done
|
||||||
|
|
||||||
|
%PYTHON% -B %BLENDER_DIR%\release\datafiles\blender_icons_update.py
|
||||||
|
%PYTHON% -B %BLENDER_DIR%\release\datafiles\prvicons_update.py
|
||||||
|
%PYTHON% -B %BLENDER_DIR%\release\datafiles\alert_icons_update.py
|
||||||
|
|
||||||
|
:EOF
|
29
build_files/windows/icons_geom.cmd
Normal file
29
build_files/windows/icons_geom.cmd
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo python not found at %PYTHON%
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_python_done
|
||||||
|
echo found python (%PYTHON%)
|
||||||
|
|
||||||
|
call "%~dp0\find_blender.cmd"
|
||||||
|
|
||||||
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
goto detect_blender_done
|
||||||
|
)
|
||||||
|
|
||||||
|
echo unable to locate blender, run "set BLENDER_BIN=full_path_to_blender.exe"
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:detect_blender_done
|
||||||
|
|
||||||
|
%PYTHON% -B %BLENDER_DIR%\release\datafiles\blender_icons_geom_update.py
|
||||||
|
|
||||||
|
:EOF
|
@@ -107,6 +107,15 @@ if NOT "%1" == "" (
|
|||||||
set FORMAT=1
|
set FORMAT=1
|
||||||
set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
|
set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
|
||||||
goto EOF
|
goto EOF
|
||||||
|
) else if "%1" == "icons" (
|
||||||
|
set ICONS=1
|
||||||
|
goto EOF
|
||||||
|
) else if "%1" == "icons_geom" (
|
||||||
|
set ICONS_GEOM=1
|
||||||
|
goto EOF
|
||||||
|
) else if "%1" == "doc_py" (
|
||||||
|
set DOC_PY=1
|
||||||
|
goto EOF
|
||||||
) else (
|
) else (
|
||||||
echo Command "%1" unknown, aborting!
|
echo Command "%1" unknown, aborting!
|
||||||
goto ERR
|
goto ERR
|
||||||
|
@@ -31,3 +31,6 @@ set PYDEBUG_CMAKE_ARGS=
|
|||||||
set FORMAT=
|
set FORMAT=
|
||||||
set TEST=
|
set TEST=
|
||||||
set BUILD_WITH_SCCACHE=
|
set BUILD_WITH_SCCACHE=
|
||||||
|
set ICONS=
|
||||||
|
set ICONS_GEOM=
|
||||||
|
set DOC_PY=
|
||||||
|
@@ -31,6 +31,10 @@ echo - 2019 ^(build with visual studio 2019^)
|
|||||||
echo - 2019pre ^(build with visual studio 2019 pre-release^)
|
echo - 2019pre ^(build with visual studio 2019 pre-release^)
|
||||||
echo - 2019b ^(build with visual studio 2019 Build Tools^)
|
echo - 2019b ^(build with visual studio 2019 Build Tools^)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Documentation Targets ^(Not associated with building^)
|
||||||
|
echo -doc_py ^(Generate sphinx python api docs^)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Experimental options
|
echo Experimental options
|
||||||
echo - with_opengl_tests ^(enable both the render and draw opengl test suites^)
|
echo - with_opengl_tests ^(enable both the render and draw opengl test suites^)
|
||||||
|
@@ -31,7 +31,8 @@ def draw():
|
|||||||
context.space_data,
|
context.space_data,
|
||||||
context.region,
|
context.region,
|
||||||
view_matrix,
|
view_matrix,
|
||||||
projection_matrix)
|
projection_matrix,
|
||||||
|
True)
|
||||||
|
|
||||||
gpu.state.depth_mask_set(False)
|
gpu.state.depth_mask_set(False)
|
||||||
draw_texture_2d(offscreen.texture_color, (10, 10), WIDTH, HEIGHT)
|
draw_texture_2d(offscreen.texture_color, (10, 10), WIDTH, HEIGHT)
|
||||||
|
2
extern/CMakeLists.txt
vendored
2
extern/CMakeLists.txt
vendored
@@ -111,5 +111,5 @@ if(WITH_MOD_FLUID)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_COMPOSITOR)
|
if (WITH_COMPOSITOR)
|
||||||
add_subdirectory(smaa_areatex)
|
add_subdirectory(smaa_areatex)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -307,9 +307,9 @@ if(WITH_CYCLES_LOGGING)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Debugging capabilities (debug passes etc).
|
# NaN debugging
|
||||||
if(WITH_CYCLES_DEBUG)
|
if(WITH_CYCLES_DEBUG_NAN)
|
||||||
add_definitions(-DWITH_CYCLES_DEBUG)
|
add_definitions(-DWITH_CYCLES_DEBUG_NAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT OPENIMAGEIO_PUGIXML_FOUND)
|
if(NOT OPENIMAGEIO_PUGIXML_FOUND)
|
||||||
|
@@ -235,9 +235,12 @@ def system_info():
|
|||||||
|
|
||||||
|
|
||||||
def list_render_passes(scene, srl):
|
def list_render_passes(scene, srl):
|
||||||
# Builtin Blender passes.
|
crl = srl.cycles
|
||||||
|
|
||||||
|
# Combined pass.
|
||||||
yield ("Combined", "RGBA", 'COLOR')
|
yield ("Combined", "RGBA", 'COLOR')
|
||||||
|
|
||||||
|
# Data passes.
|
||||||
if srl.use_pass_z: yield ("Depth", "Z", 'VALUE')
|
if srl.use_pass_z: yield ("Depth", "Z", 'VALUE')
|
||||||
if srl.use_pass_mist: yield ("Mist", "Z", 'VALUE')
|
if srl.use_pass_mist: yield ("Mist", "Z", 'VALUE')
|
||||||
if srl.use_pass_normal: yield ("Normal", "XYZ", 'VECTOR')
|
if srl.use_pass_normal: yield ("Normal", "XYZ", 'VECTOR')
|
||||||
@@ -245,8 +248,8 @@ def list_render_passes(scene, srl):
|
|||||||
if srl.use_pass_uv: yield ("UV", "UVA", 'VECTOR')
|
if srl.use_pass_uv: yield ("UV", "UVA", 'VECTOR')
|
||||||
if srl.use_pass_object_index: yield ("IndexOB", "X", 'VALUE')
|
if srl.use_pass_object_index: yield ("IndexOB", "X", 'VALUE')
|
||||||
if srl.use_pass_material_index: yield ("IndexMA", "X", 'VALUE')
|
if srl.use_pass_material_index: yield ("IndexMA", "X", 'VALUE')
|
||||||
if srl.use_pass_shadow: yield ("Shadow", "RGB", 'COLOR')
|
|
||||||
if srl.use_pass_ambient_occlusion: yield ("AO", "RGB", 'COLOR')
|
# Light passes.
|
||||||
if srl.use_pass_diffuse_direct: yield ("DiffDir", "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_indirect: yield ("DiffInd", "RGB", 'COLOR')
|
||||||
if srl.use_pass_diffuse_color: yield ("DiffCol", "RGB", 'COLOR')
|
if srl.use_pass_diffuse_color: yield ("DiffCol", "RGB", 'COLOR')
|
||||||
@@ -256,19 +259,16 @@ def list_render_passes(scene, srl):
|
|||||||
if srl.use_pass_transmission_direct: yield ("TransDir", "RGB", 'COLOR')
|
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_indirect: yield ("TransInd", "RGB", 'COLOR')
|
||||||
if srl.use_pass_transmission_color: yield ("TransCol", "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_emit: yield ("Emit", "RGB", 'COLOR')
|
||||||
if srl.use_pass_environment: yield ("Env", "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')
|
||||||
|
|
||||||
# Cycles specific passes.
|
# Debug passes.
|
||||||
crl = srl.cycles
|
|
||||||
if crl.pass_debug_render_time: yield ("Debug Render Time", "X", 'VALUE')
|
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.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.
|
# Cryptomatte passes.
|
||||||
crypto_depth = (srl.pass_cryptomatte_depth + 1) // 2
|
crypto_depth = (srl.pass_cryptomatte_depth + 1) // 2
|
||||||
|
@@ -263,6 +263,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||||||
name="Use Denoising",
|
name="Use Denoising",
|
||||||
description="Denoise the rendered image",
|
description="Denoise the rendered image",
|
||||||
default=False,
|
default=False,
|
||||||
|
update=update_render_passes,
|
||||||
)
|
)
|
||||||
use_preview_denoising: BoolProperty(
|
use_preview_denoising: BoolProperty(
|
||||||
name="Use Viewport Denoising",
|
name="Use Viewport Denoising",
|
||||||
@@ -1163,12 +1164,6 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def register(cls):
|
def register(cls):
|
||||||
bpy.types.Object.cycles_visibility = PointerProperty(
|
|
||||||
name="Cycles Visibility Settings",
|
|
||||||
description="Cycles visibility settings",
|
|
||||||
type=cls,
|
|
||||||
)
|
|
||||||
|
|
||||||
bpy.types.World.cycles_visibility = PointerProperty(
|
bpy.types.World.cycles_visibility = PointerProperty(
|
||||||
name="Cycles Visibility Settings",
|
name="Cycles Visibility Settings",
|
||||||
description="Cycles visibility settings",
|
description="Cycles visibility settings",
|
||||||
@@ -1177,7 +1172,6 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def unregister(cls):
|
def unregister(cls):
|
||||||
del bpy.types.Object.cycles_visibility
|
|
||||||
del bpy.types.World.cycles_visibility
|
del bpy.types.World.cycles_visibility
|
||||||
|
|
||||||
|
|
||||||
@@ -1267,18 +1261,12 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
|
|||||||
default=0.1,
|
default=0.1,
|
||||||
)
|
)
|
||||||
|
|
||||||
is_shadow_catcher: BoolProperty(
|
ao_distance: FloatProperty(
|
||||||
name="Shadow Catcher",
|
name="AO Distance",
|
||||||
description="Only render shadows on this object, for compositing renders into real footage",
|
description="AO distance used for approximate global illumination (0 means use world setting)",
|
||||||
default=False,
|
min=0.0,
|
||||||
)
|
default=0.0,
|
||||||
|
subtype='DISTANCE',
|
||||||
is_holdout: BoolProperty(
|
|
||||||
name="Holdout",
|
|
||||||
description="Render objects as a holdout or matte, creating a "
|
|
||||||
"hole in the image with zero alpha, to fill out in "
|
|
||||||
"compositing with real footage or another render",
|
|
||||||
default=False,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -1324,30 +1312,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
|||||||
|
|
||||||
class CyclesRenderLayerSettings(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(
|
pass_debug_render_time: BoolProperty(
|
||||||
name="Debug Render Time",
|
name="Debug Render Time",
|
||||||
description="Render time in milliseconds per sample and pixel",
|
description="Render time in milliseconds per sample and pixel",
|
||||||
|
@@ -936,29 +936,6 @@ class CYCLES_RENDER_PT_passes_crypto(CyclesButtonsPanel, ViewLayerCryptomattePan
|
|||||||
bl_parent_id = "CYCLES_RENDER_PT_passes"
|
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):
|
class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, ViewLayerAOVPanel):
|
||||||
bl_label = "Shader AOV"
|
bl_label = "Shader AOV"
|
||||||
bl_context = "view_layer"
|
bl_context = "view_layer"
|
||||||
@@ -1125,7 +1102,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
if ob:
|
if ob:
|
||||||
is_sortable = len(ob.material_slots) > 1
|
is_sortable = len(ob.material_slots) > 1
|
||||||
rows = 1
|
rows = 3
|
||||||
if (is_sortable):
|
if (is_sortable):
|
||||||
rows = 4
|
rows = 4
|
||||||
|
|
||||||
@@ -1251,6 +1228,26 @@ class CYCLES_OBJECT_PT_shading_shadow_terminator(CyclesButtonsPanel, Panel):
|
|||||||
flow.prop(cob, "shadow_terminator_offset", text="Shading Offset")
|
flow.prop(cob, "shadow_terminator_offset", text="Shading Offset")
|
||||||
|
|
||||||
|
|
||||||
|
class CYCLES_OBJECT_PT_shading_gi_approximation(CyclesButtonsPanel, Panel):
|
||||||
|
bl_label = "Fast GI Approximation"
|
||||||
|
bl_parent_id = "CYCLES_OBJECT_PT_shading"
|
||||||
|
bl_context = "object"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
layout.use_property_split = True
|
||||||
|
|
||||||
|
scene = context.scene
|
||||||
|
ob = context.object
|
||||||
|
|
||||||
|
cob = ob.cycles
|
||||||
|
cscene = scene.cycles
|
||||||
|
|
||||||
|
col = layout.column()
|
||||||
|
col.active = cscene.use_fast_gi
|
||||||
|
col.prop(cob, "ao_distance")
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
||||||
bl_label = "Visibility"
|
bl_label = "Visibility"
|
||||||
bl_context = "object"
|
bl_context = "object"
|
||||||
@@ -1273,10 +1270,9 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
|
|||||||
col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False)
|
col.prop(ob, "hide_render", text="Renders", invert_checkbox=True, toggle=False)
|
||||||
|
|
||||||
if has_geometry_visibility(ob):
|
if has_geometry_visibility(ob):
|
||||||
cob = ob.cycles
|
|
||||||
col = layout.column(heading="Mask")
|
col = layout.column(heading="Mask")
|
||||||
col.prop(cob, "is_shadow_catcher")
|
col.prop(ob, "is_shadow_catcher")
|
||||||
col.prop(cob, "is_holdout")
|
col.prop(ob, "is_holdout")
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
|
class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
|
||||||
@@ -1296,19 +1292,17 @@ class CYCLES_OBJECT_PT_visibility_ray_visibility(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
ob = context.object
|
ob = context.object
|
||||||
cob = ob.cycles
|
|
||||||
visibility = ob.cycles_visibility
|
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(visibility, "camera")
|
col.prop(ob, "visible_camera", text="Camera")
|
||||||
col.prop(visibility, "diffuse")
|
col.prop(ob, "visible_diffuse", text="Diffuse")
|
||||||
col.prop(visibility, "glossy")
|
col.prop(ob, "visible_glossy", text="Glossy")
|
||||||
col.prop(visibility, "transmission")
|
col.prop(ob, "visible_transmission", text="Transmission")
|
||||||
col.prop(visibility, "scatter")
|
col.prop(ob, "visible_volume_scatter", text="Volume Scatter")
|
||||||
|
|
||||||
if ob.type != 'LIGHT':
|
if ob.type != 'LIGHT':
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.prop(visibility, "shadow")
|
sub.prop(ob, "visible_shadow", text="Shadow")
|
||||||
|
|
||||||
|
|
||||||
class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):
|
class CYCLES_OBJECT_PT_visibility_culling(CyclesButtonsPanel, Panel):
|
||||||
@@ -2317,7 +2311,6 @@ classes = (
|
|||||||
CYCLES_RENDER_PT_passes_data,
|
CYCLES_RENDER_PT_passes_data,
|
||||||
CYCLES_RENDER_PT_passes_light,
|
CYCLES_RENDER_PT_passes_light,
|
||||||
CYCLES_RENDER_PT_passes_crypto,
|
CYCLES_RENDER_PT_passes_crypto,
|
||||||
CYCLES_RENDER_PT_passes_debug,
|
|
||||||
CYCLES_RENDER_PT_passes_aov,
|
CYCLES_RENDER_PT_passes_aov,
|
||||||
CYCLES_RENDER_PT_filter,
|
CYCLES_RENDER_PT_filter,
|
||||||
CYCLES_RENDER_PT_override,
|
CYCLES_RENDER_PT_override,
|
||||||
@@ -2329,6 +2322,7 @@ classes = (
|
|||||||
CYCLES_OBJECT_PT_motion_blur,
|
CYCLES_OBJECT_PT_motion_blur,
|
||||||
CYCLES_OBJECT_PT_shading,
|
CYCLES_OBJECT_PT_shading,
|
||||||
CYCLES_OBJECT_PT_shading_shadow_terminator,
|
CYCLES_OBJECT_PT_shading_shadow_terminator,
|
||||||
|
CYCLES_OBJECT_PT_shading_gi_approximation,
|
||||||
CYCLES_OBJECT_PT_visibility,
|
CYCLES_OBJECT_PT_visibility,
|
||||||
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
CYCLES_OBJECT_PT_visibility_ray_visibility,
|
||||||
CYCLES_OBJECT_PT_visibility_culling,
|
CYCLES_OBJECT_PT_visibility_culling,
|
||||||
|
@@ -1055,10 +1055,45 @@ static BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object &b_ob)
|
|||||||
return BL::MeshSequenceCacheModifier(PointerRNA_NULL);
|
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)
|
static void sync_mesh_cached_velocities(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
||||||
{
|
{
|
||||||
if (scene->need_motion() == Scene::MOTION_NONE)
|
if (!mesh_need_motion_attribute(b_ob, scene)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BL::MeshSequenceCacheModifier b_mesh_cache = object_mesh_cache_find(b_ob);
|
BL::MeshSequenceCacheModifier b_mesh_cache = object_mesh_cache_find(b_ob);
|
||||||
|
|
||||||
@@ -1102,8 +1137,9 @@ 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)
|
static void sync_mesh_fluid_motion(BL::Object &b_ob, Scene *scene, Mesh *mesh)
|
||||||
{
|
{
|
||||||
if (scene->need_motion() == Scene::MOTION_NONE)
|
if (!mesh_need_motion_attribute(b_ob, scene)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BL::FluidDomainSettings b_fluid_domain = object_fluid_liquid_domain_find(b_ob);
|
BL::FluidDomainSettings b_fluid_domain = object_fluid_liquid_domain_find(b_ob);
|
||||||
|
|
||||||
|
@@ -199,8 +199,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
|
|
||||||
/* Visibility flags for both parent and child. */
|
/* Visibility flags for both parent and child. */
|
||||||
PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
|
PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
|
||||||
bool use_holdout = get_boolean(cobject, "is_holdout") ||
|
bool use_holdout = b_parent.holdout_get(PointerRNA_NULL, b_view_layer);
|
||||||
b_parent.holdout_get(PointerRNA_NULL, b_view_layer);
|
|
||||||
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
|
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
|
||||||
|
|
||||||
if (b_parent.ptr.data != b_ob.ptr.data) {
|
if (b_parent.ptr.data != b_ob.ptr.data) {
|
||||||
@@ -287,8 +286,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
|
|
||||||
object->set_visibility(visibility);
|
object->set_visibility(visibility);
|
||||||
|
|
||||||
bool is_shadow_catcher = get_boolean(cobject, "is_shadow_catcher");
|
object->set_is_shadow_catcher(b_ob.is_shadow_catcher());
|
||||||
object->set_is_shadow_catcher(is_shadow_catcher);
|
|
||||||
|
|
||||||
float shadow_terminator_shading_offset = get_float(cobject, "shadow_terminator_offset");
|
float shadow_terminator_shading_offset = get_float(cobject, "shadow_terminator_offset");
|
||||||
object->set_shadow_terminator_shading_offset(shadow_terminator_shading_offset);
|
object->set_shadow_terminator_shading_offset(shadow_terminator_shading_offset);
|
||||||
@@ -297,6 +295,13 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
|
|||||||
"shadow_terminator_geometry_offset");
|
"shadow_terminator_geometry_offset");
|
||||||
object->set_shadow_terminator_geometry_offset(shadow_terminator_geometry_offset);
|
object->set_shadow_terminator_geometry_offset(shadow_terminator_geometry_offset);
|
||||||
|
|
||||||
|
float ao_distance = get_float(cobject, "ao_distance");
|
||||||
|
if (ao_distance == 0.0f && b_parent.ptr.data != b_ob.ptr.data) {
|
||||||
|
PointerRNA cparent = RNA_pointer_get(&b_parent.ptr, "cycles");
|
||||||
|
ao_distance = get_float(cparent, "ao_distance");
|
||||||
|
}
|
||||||
|
object->set_ao_distance(ao_distance);
|
||||||
|
|
||||||
/* sync the asset name for Cryptomatte */
|
/* sync the asset name for Cryptomatte */
|
||||||
BL::Object parent = b_ob.parent();
|
BL::Object parent = b_ob.parent();
|
||||||
ustring parent_name;
|
ustring parent_name;
|
||||||
|
@@ -1098,14 +1098,6 @@ void *CCL_python_module_init()
|
|||||||
PyModule_AddStringConstant(mod, "osl_version_string", "unknown");
|
PyModule_AddStringConstant(mod, "osl_version_string", "unknown");
|
||||||
#endif
|
#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
|
#ifdef WITH_NETWORK
|
||||||
PyModule_AddObject(mod, "with_network", Py_True);
|
PyModule_AddObject(mod, "with_network", Py_True);
|
||||||
Py_INCREF(Py_True);
|
Py_INCREF(Py_True);
|
||||||
|
@@ -538,12 +538,6 @@ PassType BlenderSync::get_pass_type(BL::RenderPass &b_pass)
|
|||||||
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE);
|
MAP_PASS("BakePrimitive", PASS_BAKE_PRIMITIVE);
|
||||||
MAP_PASS("BakeDifferential", PASS_BAKE_DIFFERENTIAL);
|
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("Debug Render Time", PASS_RENDER_TIME);
|
||||||
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
|
MAP_PASS("AdaptiveAuxBuffer", PASS_ADAPTIVE_AUX_BUFFER);
|
||||||
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
|
MAP_PASS("Debug Sample Count", PASS_SAMPLE_COUNT);
|
||||||
@@ -641,24 +635,6 @@ 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")) {
|
if (get_boolean(crl, "pass_debug_render_time")) {
|
||||||
b_engine.add_pass("Debug Render Time", 1, "X", b_view_layer.name().c_str());
|
b_engine.add_pass("Debug Render Time", 1, "X", b_view_layer.name().c_str());
|
||||||
Pass::add(PASS_RENDER_TIME, passes, "Debug Render Time");
|
Pass::add(PASS_RENDER_TIME, passes, "Debug Render Time");
|
||||||
|
@@ -596,15 +596,14 @@ static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob,
|
|||||||
|
|
||||||
static inline uint object_ray_visibility(BL::Object &b_ob)
|
static inline uint object_ray_visibility(BL::Object &b_ob)
|
||||||
{
|
{
|
||||||
PointerRNA cvisibility = RNA_pointer_get(&b_ob.ptr, "cycles_visibility");
|
|
||||||
uint flag = 0;
|
uint flag = 0;
|
||||||
|
|
||||||
flag |= get_boolean(cvisibility, "camera") ? PATH_RAY_CAMERA : 0;
|
flag |= b_ob.visible_camera() ? PATH_RAY_CAMERA : 0;
|
||||||
flag |= get_boolean(cvisibility, "diffuse") ? PATH_RAY_DIFFUSE : 0;
|
flag |= b_ob.visible_diffuse() ? PATH_RAY_DIFFUSE : 0;
|
||||||
flag |= get_boolean(cvisibility, "glossy") ? PATH_RAY_GLOSSY : 0;
|
flag |= b_ob.visible_glossy() ? PATH_RAY_GLOSSY : 0;
|
||||||
flag |= get_boolean(cvisibility, "transmission") ? PATH_RAY_TRANSMIT : 0;
|
flag |= b_ob.visible_transmission() ? PATH_RAY_TRANSMIT : 0;
|
||||||
flag |= get_boolean(cvisibility, "shadow") ? PATH_RAY_SHADOW : 0;
|
flag |= b_ob.visible_shadow() ? PATH_RAY_SHADOW : 0;
|
||||||
flag |= get_boolean(cvisibility, "scatter") ? PATH_RAY_VOLUME_SCATTER : 0;
|
flag |= b_ob.visible_volume_scatter() ? PATH_RAY_VOLUME_SCATTER : 0;
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
@@ -351,9 +351,6 @@ string CUDADevice::compile_kernel_get_common_cflags(
|
|||||||
if (extra_cflags) {
|
if (extra_cflags) {
|
||||||
cflags += string(" ") + string(extra_cflags);
|
cflags += string(" ") + string(extra_cflags);
|
||||||
}
|
}
|
||||||
# ifdef WITH_CYCLES_DEBUG
|
|
||||||
cflags += " -D__KERNEL_DEBUG__";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (split) {
|
if (split) {
|
||||||
cflags += " -D__SPLIT__";
|
cflags += " -D__SPLIT__";
|
||||||
@@ -461,18 +458,19 @@ string CUDADevice::compile_kernel(const DeviceRequestedFeatures &requested_featu
|
|||||||
|
|
||||||
const int nvcc_cuda_version = cuewCompilerVersion();
|
const int nvcc_cuda_version = cuewCompilerVersion();
|
||||||
VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << ".";
|
VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << ".";
|
||||||
if (nvcc_cuda_version < 80) {
|
if (nvcc_cuda_version < 101) {
|
||||||
printf(
|
printf(
|
||||||
"Unsupported CUDA version %d.%d detected, "
|
"Unsupported CUDA version %d.%d detected, "
|
||||||
"you need CUDA 8.0 or newer.\n",
|
"you need CUDA 10.1 or newer.\n",
|
||||||
nvcc_cuda_version / 10,
|
nvcc_cuda_version / 10,
|
||||||
nvcc_cuda_version % 10);
|
nvcc_cuda_version % 10);
|
||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102)) {
|
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)) {
|
||||||
printf(
|
printf(
|
||||||
"CUDA version %d.%d detected, build may succeed but only "
|
"CUDA version %d.%d detected, build may succeed but only "
|
||||||
"CUDA 10.1 and 10.2 are officially supported.\n",
|
"CUDA 10.1 to 11.4 are officially supported.\n",
|
||||||
nvcc_cuda_version / 10,
|
nvcc_cuda_version / 10,
|
||||||
nvcc_cuda_version % 10);
|
nvcc_cuda_version % 10);
|
||||||
}
|
}
|
||||||
|
@@ -57,8 +57,8 @@
|
|||||||
#include "util/util_function.h"
|
#include "util/util_function.h"
|
||||||
#include "util/util_logging.h"
|
#include "util/util_logging.h"
|
||||||
#include "util/util_map.h"
|
#include "util/util_map.h"
|
||||||
#include "util/util_openimagedenoise.h"
|
|
||||||
#include "util/util_opengl.h"
|
#include "util/util_opengl.h"
|
||||||
|
#include "util/util_openimagedenoise.h"
|
||||||
#include "util/util_optimization.h"
|
#include "util/util_optimization.h"
|
||||||
#include "util/util_progress.h"
|
#include "util/util_progress.h"
|
||||||
#include "util/util_system.h"
|
#include "util/util_system.h"
|
||||||
|
@@ -233,9 +233,6 @@ class OptiXDevice : public CUDADevice {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
# endif
|
|
||||||
# if OPTIX_ABI_VERSION >= 41 && defined(WITH_CYCLES_DEBUG)
|
|
||||||
options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
|
|
||||||
# endif
|
# endif
|
||||||
check_result_optix(optixDeviceContextCreate(cuContext, &options, &context));
|
check_result_optix(optixDeviceContextCreate(cuContext, &options, &context));
|
||||||
# ifdef WITH_CYCLES_LOGGING
|
# ifdef WITH_CYCLES_LOGGING
|
||||||
@@ -369,13 +366,8 @@ class OptiXDevice : public CUDADevice {
|
|||||||
|
|
||||||
OptixModuleCompileOptions module_options = {};
|
OptixModuleCompileOptions module_options = {};
|
||||||
module_options.maxRegisterCount = 0; // Do not set an explicit register limit
|
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.optLevel = OPTIX_COMPILE_OPTIMIZATION_LEVEL_3;
|
||||||
module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
|
module_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
|
||||||
# endif
|
|
||||||
|
|
||||||
# if OPTIX_ABI_VERSION >= 41
|
# if OPTIX_ABI_VERSION >= 41
|
||||||
module_options.boundValues = nullptr;
|
module_options.boundValues = nullptr;
|
||||||
@@ -578,11 +570,7 @@ class OptiXDevice : public CUDADevice {
|
|||||||
|
|
||||||
OptixPipelineLinkOptions link_options = {};
|
OptixPipelineLinkOptions link_options = {};
|
||||||
link_options.maxTraceDepth = 1;
|
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;
|
link_options.debugLevel = OPTIX_COMPILE_DEBUG_LEVEL_LINEINFO;
|
||||||
# endif
|
|
||||||
# if OPTIX_ABI_VERSION < 24
|
# if OPTIX_ABI_VERSION < 24
|
||||||
link_options.overrideUsesMotionBlur = motion_blur;
|
link_options.overrideUsesMotionBlur = motion_blur;
|
||||||
# endif
|
# endif
|
||||||
|
@@ -1968,10 +1968,6 @@ string OpenCLDevice::kernel_build_options(const string *debug_src)
|
|||||||
build_options += "-D__KERNEL_OPENCL_DEBUG__ ";
|
build_options += "-D__KERNEL_OPENCL_DEBUG__ ";
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef WITH_CYCLES_DEBUG
|
|
||||||
build_options += "-D__KERNEL_DEBUG__ ";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef WITH_NANOVDB
|
# ifdef WITH_NANOVDB
|
||||||
if (info.has_nanovdb) {
|
if (info.has_nanovdb) {
|
||||||
build_options += "-DWITH_NANOVDB ";
|
build_options += "-DWITH_NANOVDB ";
|
||||||
|
@@ -380,11 +380,16 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
|||||||
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
||||||
|
|
||||||
# warn for other versions
|
# warn for other versions
|
||||||
if((CUDA_VERSION MATCHES "101") OR (CUDA_VERSION MATCHES "102") OR (CUDA_VERSION MATCHES "111"))
|
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"))
|
||||||
else()
|
else()
|
||||||
message(WARNING
|
message(WARNING
|
||||||
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
|
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
|
||||||
"build may succeed but only CUDA 10.1, 10.2 and 11.1 are officially supported")
|
"build may succeed but only CUDA 10.1 to 11.4 are officially supported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# build for each arch
|
# build for each arch
|
||||||
@@ -439,10 +444,6 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
|||||||
set(name ${name}_experimental)
|
set(name ${name}_experimental)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_DEBUG)
|
|
||||||
set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_NANOVDB)
|
if(WITH_NANOVDB)
|
||||||
set(cuda_flags ${cuda_flags}
|
set(cuda_flags ${cuda_flags}
|
||||||
-D WITH_NANOVDB
|
-D WITH_NANOVDB
|
||||||
@@ -557,11 +558,6 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
|||||||
--use_fast_math
|
--use_fast_math
|
||||||
-o ${output})
|
-o ${output})
|
||||||
|
|
||||||
if(WITH_CYCLES_DEBUG)
|
|
||||||
set(cuda_flags ${cuda_flags}
|
|
||||||
-D __KERNEL_DEBUG__)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_NANOVDB)
|
if(WITH_NANOVDB)
|
||||||
set(cuda_flags ${cuda_flags}
|
set(cuda_flags ${cuda_flags}
|
||||||
-D WITH_NANOVDB
|
-D WITH_NANOVDB
|
||||||
|
@@ -67,8 +67,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
isect->prim = PRIM_NONE;
|
isect->prim = PRIM_NONE;
|
||||||
isect->object = OBJECT_NONE;
|
isect->object = OBJECT_NONE;
|
||||||
|
|
||||||
BVH_DEBUG_INIT();
|
|
||||||
|
|
||||||
/* traversal loop */
|
/* traversal loop */
|
||||||
do {
|
do {
|
||||||
do {
|
do {
|
||||||
@@ -118,7 +116,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
--stack_ptr;
|
--stack_ptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BVH_DEBUG_NEXT_NODE();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if node is leaf, fetch triangle list */
|
/* if node is leaf, fetch triangle list */
|
||||||
@@ -138,7 +135,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
switch (type & PRIMITIVE_ALL) {
|
switch (type & PRIMITIVE_ALL) {
|
||||||
case PRIMITIVE_TRIANGLE: {
|
case PRIMITIVE_TRIANGLE: {
|
||||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||||
BVH_DEBUG_NEXT_INTERSECTION();
|
|
||||||
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
||||||
if (triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) {
|
if (triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr)) {
|
||||||
/* shadow ray early termination */
|
/* shadow ray early termination */
|
||||||
@@ -151,7 +147,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
#if BVH_FEATURE(BVH_MOTION)
|
#if BVH_FEATURE(BVH_MOTION)
|
||||||
case PRIMITIVE_MOTION_TRIANGLE: {
|
case PRIMITIVE_MOTION_TRIANGLE: {
|
||||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||||
BVH_DEBUG_NEXT_INTERSECTION();
|
|
||||||
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type);
|
||||||
if (motion_triangle_intersect(
|
if (motion_triangle_intersect(
|
||||||
kg, isect, P, dir, ray->time, visibility, object, prim_addr)) {
|
kg, isect, P, dir, ray->time, visibility, object, prim_addr)) {
|
||||||
@@ -169,7 +164,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
case PRIMITIVE_CURVE_RIBBON:
|
case PRIMITIVE_CURVE_RIBBON:
|
||||||
case PRIMITIVE_MOTION_CURVE_RIBBON: {
|
case PRIMITIVE_MOTION_CURVE_RIBBON: {
|
||||||
for (; prim_addr < prim_addr2; prim_addr++) {
|
for (; prim_addr < prim_addr2; prim_addr++) {
|
||||||
BVH_DEBUG_NEXT_INTERSECTION();
|
|
||||||
const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr);
|
const uint curve_type = kernel_tex_fetch(__prim_type, prim_addr);
|
||||||
kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
|
kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
|
||||||
const bool hit = curve_intersect(
|
const bool hit = curve_intersect(
|
||||||
@@ -201,8 +195,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
|||||||
traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL;
|
traversal_stack[stack_ptr] = ENTRYPOINT_SENTINEL;
|
||||||
|
|
||||||
node_addr = kernel_tex_fetch(__object_node, object);
|
node_addr = kernel_tex_fetch(__object_node, object);
|
||||||
|
|
||||||
BVH_DEBUG_NEXT_INSTANCE();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (node_addr != ENTRYPOINT_SENTINEL);
|
} while (node_addr != ENTRYPOINT_SENTINEL);
|
||||||
|
@@ -42,33 +42,6 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
#define BVH_FEATURE(f) (((BVH_FUNCTION_FEATURES) & (f)) != 0)
|
#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
|
CCL_NAMESPACE_END
|
||||||
|
|
||||||
#endif /* __BVH_TYPES__ */
|
#endif /* __BVH_TYPES__ */
|
||||||
|
@@ -239,4 +239,14 @@ ccl_device_forceinline int intersection_get_shader(KernelGlobals *ccl_restrict k
|
|||||||
return shader & SHADER_MASK;
|
return shader & SHADER_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ccl_device_forceinline int intersection_get_object(KernelGlobals *ccl_restrict kg,
|
||||||
|
const Intersection *ccl_restrict isect)
|
||||||
|
{
|
||||||
|
if (isect->object != OBJECT_NONE) {
|
||||||
|
return isect->object;
|
||||||
|
}
|
||||||
|
|
||||||
|
return kernel_tex_fetch(__prim_object, isect->prim);
|
||||||
|
}
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
CCL_NAMESPACE_END
|
||||||
|
@@ -432,9 +432,9 @@ ccl_device void bssrdf_sample(const ShaderClosure *sc, float xi, float *r, float
|
|||||||
xi *= bssrdf->channels;
|
xi *= bssrdf->channels;
|
||||||
|
|
||||||
if (xi < 1.0f) {
|
if (xi < 1.0f) {
|
||||||
radius = (bssrdf->radius.x > 0.0f) ?
|
radius = (bssrdf->radius.x > 0.0f) ? bssrdf->radius.x :
|
||||||
bssrdf->radius.x :
|
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y :
|
||||||
(bssrdf->radius.y > 0.0f) ? bssrdf->radius.y : bssrdf->radius.z;
|
bssrdf->radius.z;
|
||||||
}
|
}
|
||||||
else if (xi < 2.0f) {
|
else if (xi < 2.0f) {
|
||||||
xi -= 1.0f;
|
xi -= 1.0f;
|
||||||
|
@@ -52,15 +52,14 @@ typedef struct TileInfo {
|
|||||||
tile_buffer_6, tile_buffer_7, tile_buffer_8, tile_buffer_9
|
tile_buffer_6, tile_buffer_7, tile_buffer_8, tile_buffer_9
|
||||||
# define ccl_get_tile_buffer(id) \
|
# define ccl_get_tile_buffer(id) \
|
||||||
(id == 0 ? tile_buffer_1 : \
|
(id == 0 ? tile_buffer_1 : \
|
||||||
id == 1 ? \
|
id == 1 ? tile_buffer_2 : \
|
||||||
tile_buffer_2 : \
|
id == 2 ? tile_buffer_3 : \
|
||||||
id == 2 ? \
|
id == 3 ? tile_buffer_4 : \
|
||||||
tile_buffer_3 : \
|
id == 4 ? tile_buffer_5 : \
|
||||||
id == 3 ? tile_buffer_4 : \
|
id == 5 ? tile_buffer_6 : \
|
||||||
id == 4 ? tile_buffer_5 : \
|
id == 6 ? tile_buffer_7 : \
|
||||||
id == 5 ? tile_buffer_6 : \
|
id == 7 ? tile_buffer_8 : \
|
||||||
id == 6 ? tile_buffer_7 : \
|
tile_buffer_9)
|
||||||
id == 7 ? tile_buffer_8 : tile_buffer_9)
|
|
||||||
#else
|
#else
|
||||||
# ifdef __KERNEL_CUDA__
|
# ifdef __KERNEL_CUDA__
|
||||||
# define CCL_FILTER_TILE_INFO ccl_global TileInfo *tile_info
|
# define CCL_FILTER_TILE_INFO ccl_global TileInfo *tile_info
|
||||||
|
@@ -225,13 +225,6 @@ ccl_device_inline void path_radiance_init(KernelGlobals *kg, PathRadiance *L)
|
|||||||
L->denoising_albedo = zero_float3();
|
L->denoising_albedo = zero_float3();
|
||||||
L->denoising_depth = 0.0f;
|
L->denoising_depth = 0.0f;
|
||||||
#endif
|
#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,
|
ccl_device_inline void path_radiance_bsdf_bounce(KernelGlobals *kg,
|
||||||
@@ -595,7 +588,9 @@ ccl_device_inline void path_radiance_sum_shadowcatcher(KernelGlobals *kg,
|
|||||||
float shadow;
|
float shadow;
|
||||||
|
|
||||||
if (UNLIKELY(!isfinite_safe(path_total))) {
|
if (UNLIKELY(!isfinite_safe(path_total))) {
|
||||||
|
# ifdef __KERNEL_DEBUG_NAN__
|
||||||
kernel_assert(!"Non-finite total radiance along the path");
|
kernel_assert(!"Non-finite total radiance along the path");
|
||||||
|
# endif
|
||||||
shadow = 0.0f;
|
shadow = 0.0f;
|
||||||
}
|
}
|
||||||
else if (path_total == 0.0f) {
|
else if (path_total == 0.0f) {
|
||||||
@@ -641,7 +636,9 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg,
|
|||||||
|
|
||||||
/* Reject invalid value */
|
/* Reject invalid value */
|
||||||
if (!isfinite_safe(sum)) {
|
if (!isfinite_safe(sum)) {
|
||||||
|
# ifdef __KERNEL_DEBUG_NAN__
|
||||||
kernel_assert(!"Non-finite sum in path_radiance_clamp_and_sum!");
|
kernel_assert(!"Non-finite sum in path_radiance_clamp_and_sum!");
|
||||||
|
# endif
|
||||||
L_sum = zero_float3();
|
L_sum = zero_float3();
|
||||||
|
|
||||||
L->direct_diffuse = zero_float3();
|
L->direct_diffuse = zero_float3();
|
||||||
@@ -667,7 +664,9 @@ ccl_device_inline float3 path_radiance_clamp_and_sum(KernelGlobals *kg,
|
|||||||
/* Reject invalid value */
|
/* Reject invalid value */
|
||||||
float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z);
|
float sum = fabsf((L_sum).x) + fabsf((L_sum).y) + fabsf((L_sum).z);
|
||||||
if (!isfinite_safe(sum)) {
|
if (!isfinite_safe(sum)) {
|
||||||
|
#ifdef __KERNEL_DEBUG_NAN__
|
||||||
kernel_assert(!"Non-finite final sum in path_radiance_clamp_and_sum!");
|
kernel_assert(!"Non-finite final sum in path_radiance_clamp_and_sum!");
|
||||||
|
#endif
|
||||||
L_sum = zero_float3();
|
L_sum = zero_float3();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -81,7 +81,8 @@ ccl_device_noinline void compute_light_pass(
|
|||||||
kg, sd, emission_sd, L, &state, &ray, &throughput, &ss_indirect)) {
|
kg, sd, emission_sd, L, &state, &ray, &throughput, &ss_indirect)) {
|
||||||
while (ss_indirect.num_rays) {
|
while (ss_indirect.num_rays) {
|
||||||
kernel_path_subsurface_setup_indirect(kg, &ss_indirect, &state, &ray, L, &throughput);
|
kernel_path_subsurface_setup_indirect(kg, &ss_indirect, &state, &ray, L, &throughput);
|
||||||
kernel_path_indirect(kg, &indirect_sd, emission_sd, &ray, throughput, &state, L);
|
kernel_path_indirect(
|
||||||
|
kg, &indirect_sd, emission_sd, &ray, throughput, &state, L, sd->object);
|
||||||
}
|
}
|
||||||
is_sss_sample = true;
|
is_sss_sample = true;
|
||||||
}
|
}
|
||||||
@@ -97,7 +98,8 @@ ccl_device_noinline void compute_light_pass(
|
|||||||
state.ray_t = 0.0f;
|
state.ray_t = 0.0f;
|
||||||
# endif
|
# endif
|
||||||
/* compute indirect light */
|
/* compute indirect light */
|
||||||
kernel_path_indirect(kg, &indirect_sd, emission_sd, &ray, throughput, &state, L);
|
kernel_path_indirect(
|
||||||
|
kg, &indirect_sd, emission_sd, &ray, throughput, &state, L, sd->object);
|
||||||
|
|
||||||
/* sum and reset indirect light pass variables for the next samples */
|
/* sum and reset indirect light pass variables for the next samples */
|
||||||
path_radiance_sum_indirect(L);
|
path_radiance_sum_indirect(L);
|
||||||
|
@@ -122,31 +122,6 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
|
|||||||
}
|
}
|
||||||
#endif /* __DENOISING_FEATURES__ */
|
#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__
|
#ifdef __KERNEL_CPU__
|
||||||
# define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) \
|
# define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) \
|
||||||
kernel_write_id_pass_cpu(buffer, depth * 2, id, matte_weight, kg->coverage_##name)
|
kernel_write_id_pass_cpu(buffer, depth * 2, id, matte_weight, kg->coverage_##name)
|
||||||
@@ -389,10 +364,6 @@ ccl_device_inline void kernel_write_result(KernelGlobals *kg,
|
|||||||
}
|
}
|
||||||
#endif /* __DENOISING_FEATURES__ */
|
#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
|
/* 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
|
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
|
Carlo global illumination" except that here it is applied per pixel and not in hierarchical
|
||||||
|
@@ -58,7 +58,8 @@ ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg,
|
|||||||
ccl_addr_space PathState *state,
|
ccl_addr_space PathState *state,
|
||||||
Ray *ray,
|
Ray *ray,
|
||||||
Intersection *isect,
|
Intersection *isect,
|
||||||
PathRadiance *L)
|
PathRadiance *L,
|
||||||
|
const int last_object)
|
||||||
{
|
{
|
||||||
PROFILING_INIT(kg, PROFILING_SCENE_INTERSECT);
|
PROFILING_INIT(kg, PROFILING_SCENE_INTERSECT);
|
||||||
|
|
||||||
@@ -66,19 +67,16 @@ ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg,
|
|||||||
|
|
||||||
if (path_state_ao_bounce(kg, state)) {
|
if (path_state_ao_bounce(kg, state)) {
|
||||||
ray->t = kernel_data.background.ao_distance;
|
ray->t = kernel_data.background.ao_distance;
|
||||||
|
if (last_object != OBJECT_NONE) {
|
||||||
|
const float object_ao_distance = kernel_tex_fetch(__objects, last_object).ao_distance;
|
||||||
|
if (object_ao_distance != 0.0f) {
|
||||||
|
ray->t = object_ao_distance;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hit = scene_intersect(kg, ray, visibility, isect);
|
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;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +260,7 @@ ccl_device_forceinline bool kernel_path_shader_apply(KernelGlobals *kg,
|
|||||||
PROFILING_INIT(kg, PROFILING_SHADER_APPLY);
|
PROFILING_INIT(kg, PROFILING_SHADER_APPLY);
|
||||||
|
|
||||||
#ifdef __SHADOW_TRICKS__
|
#ifdef __SHADOW_TRICKS__
|
||||||
if ((sd->object_flag & SD_OBJECT_SHADOW_CATCHER)) {
|
if (sd->object_flag & SD_OBJECT_SHADOW_CATCHER) {
|
||||||
if (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND) {
|
if (state->flag & PATH_RAY_TRANSPARENT_BACKGROUND) {
|
||||||
state->flag |= (PATH_RAY_SHADOW_CATCHER | PATH_RAY_STORE_SHADOW_INFO);
|
state->flag |= (PATH_RAY_SHADOW_CATCHER | PATH_RAY_STORE_SHADOW_INFO);
|
||||||
|
|
||||||
@@ -378,7 +376,8 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
|
|||||||
Ray *ray,
|
Ray *ray,
|
||||||
float3 throughput,
|
float3 throughput,
|
||||||
PathState *state,
|
PathState *state,
|
||||||
PathRadiance *L)
|
PathRadiance *L,
|
||||||
|
const int last_object)
|
||||||
{
|
{
|
||||||
# ifdef __SUBSURFACE__
|
# ifdef __SUBSURFACE__
|
||||||
SubsurfaceIndirectRays ss_indirect;
|
SubsurfaceIndirectRays ss_indirect;
|
||||||
@@ -391,7 +390,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
/* Find intersection with objects in scene. */
|
/* Find intersection with objects in scene. */
|
||||||
Intersection isect;
|
Intersection isect;
|
||||||
bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L);
|
bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L, last_object);
|
||||||
|
|
||||||
/* Find intersection with lamps and compute emission for MIS. */
|
/* Find intersection with lamps and compute emission for MIS. */
|
||||||
kernel_path_lamp_emission(kg, state, ray, throughput, &isect, sd, L);
|
kernel_path_lamp_emission(kg, state, ray, throughput, &isect, sd, L);
|
||||||
@@ -535,7 +534,7 @@ ccl_device_forceinline void kernel_path_integrate(KernelGlobals *kg,
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
/* Find intersection with objects in scene. */
|
/* Find intersection with objects in scene. */
|
||||||
Intersection isect;
|
Intersection isect;
|
||||||
bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L);
|
bool hit = kernel_path_scene_intersect(kg, state, ray, &isect, L, sd.object);
|
||||||
|
|
||||||
/* Find intersection with lamps and compute emission for MIS. */
|
/* Find intersection with lamps and compute emission for MIS. */
|
||||||
kernel_path_lamp_emission(kg, state, ray, throughput, &isect, &sd, L);
|
kernel_path_lamp_emission(kg, state, ray, throughput, &isect, &sd, L);
|
||||||
|
@@ -92,6 +92,7 @@ ccl_device_forceinline void kernel_branched_path_volume(KernelGlobals *kg,
|
|||||||
volume_ray.t = (hit) ? isect->t : FLT_MAX;
|
volume_ray.t = (hit) ? isect->t : FLT_MAX;
|
||||||
|
|
||||||
float step_size = volume_stack_step_size(kg, state->volume_stack);
|
float step_size = volume_stack_step_size(kg, state->volume_stack);
|
||||||
|
const int object = sd->object;
|
||||||
|
|
||||||
# ifdef __VOLUME_DECOUPLED__
|
# ifdef __VOLUME_DECOUPLED__
|
||||||
/* decoupled ray marching only supported on CPU */
|
/* decoupled ray marching only supported on CPU */
|
||||||
@@ -134,7 +135,8 @@ ccl_device_forceinline void kernel_branched_path_volume(KernelGlobals *kg,
|
|||||||
|
|
||||||
if (result == VOLUME_PATH_SCATTERED &&
|
if (result == VOLUME_PATH_SCATTERED &&
|
||||||
kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) {
|
kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) {
|
||||||
kernel_path_indirect(kg, indirect_sd, emission_sd, &pray, tp * num_samples_inv, &ps, L);
|
kernel_path_indirect(
|
||||||
|
kg, indirect_sd, emission_sd, &pray, tp * num_samples_inv, &ps, L, object);
|
||||||
|
|
||||||
/* for render passes, sum and reset indirect light pass variables
|
/* for render passes, sum and reset indirect light pass variables
|
||||||
* for the next samples */
|
* for the next samples */
|
||||||
@@ -180,7 +182,7 @@ ccl_device_forceinline void kernel_branched_path_volume(KernelGlobals *kg,
|
|||||||
kernel_path_volume_connect_light(kg, sd, emission_sd, tp, state, L);
|
kernel_path_volume_connect_light(kg, sd, emission_sd, tp, state, L);
|
||||||
|
|
||||||
if (kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) {
|
if (kernel_path_volume_bounce(kg, sd, &tp, &ps, &L->state, &pray)) {
|
||||||
kernel_path_indirect(kg, indirect_sd, emission_sd, &pray, tp, &ps, L);
|
kernel_path_indirect(kg, indirect_sd, emission_sd, &pray, tp, &ps, L, object);
|
||||||
|
|
||||||
/* for render passes, sum and reset indirect light pass variables
|
/* for render passes, sum and reset indirect light pass variables
|
||||||
* for the next samples */
|
* for the next samples */
|
||||||
@@ -266,7 +268,8 @@ ccl_device_noinline_cpu void kernel_branched_path_surface_indirect_light(KernelG
|
|||||||
|
|
||||||
ps.rng_hash = state->rng_hash;
|
ps.rng_hash = state->rng_hash;
|
||||||
|
|
||||||
kernel_path_indirect(kg, indirect_sd, emission_sd, &bsdf_ray, tp * num_samples_inv, &ps, L);
|
kernel_path_indirect(
|
||||||
|
kg, indirect_sd, emission_sd, &bsdf_ray, tp * num_samples_inv, &ps, L, sd->object);
|
||||||
|
|
||||||
/* for render passes, sum and reset indirect light pass variables
|
/* for render passes, sum and reset indirect light pass variables
|
||||||
* for the next samples */
|
* for the next samples */
|
||||||
@@ -395,7 +398,7 @@ ccl_device void kernel_branched_path_integrate(KernelGlobals *kg,
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
/* Find intersection with objects in scene. */
|
/* Find intersection with objects in scene. */
|
||||||
Intersection isect;
|
Intersection isect;
|
||||||
bool hit = kernel_path_scene_intersect(kg, &state, &ray, &isect, L);
|
bool hit = kernel_path_scene_intersect(kg, &state, &ray, &isect, L, sd.object);
|
||||||
|
|
||||||
# ifdef __VOLUME__
|
# ifdef __VOLUME__
|
||||||
/* Volume integration. */
|
/* Volume integration. */
|
||||||
|
@@ -182,9 +182,8 @@ CCL_NAMESPACE_BEGIN
|
|||||||
# undef __SHADER_RAYTRACE__
|
# undef __SHADER_RAYTRACE__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Features that enable others */
|
#ifdef WITH_CYCLES_DEBUG_NAN
|
||||||
#ifdef WITH_CYCLES_DEBUG
|
# define __KERNEL_DEBUG_NAN__
|
||||||
# define __KERNEL_DEBUG__
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__SUBSURFACE__) || defined(__SHADER_RAYTRACE__)
|
#if defined(__SUBSURFACE__) || defined(__SHADER_RAYTRACE__)
|
||||||
@@ -356,12 +355,6 @@ typedef enum PassType {
|
|||||||
PASS_MATERIAL_ID,
|
PASS_MATERIAL_ID,
|
||||||
PASS_MOTION,
|
PASS_MOTION,
|
||||||
PASS_MOTION_WEIGHT,
|
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_RENDER_TIME,
|
||||||
PASS_CRYPTOMATTE,
|
PASS_CRYPTOMATTE,
|
||||||
PASS_AOV_COLOR,
|
PASS_AOV_COLOR,
|
||||||
@@ -465,18 +458,6 @@ typedef enum DenoiseFlag {
|
|||||||
DENOISING_CLEAN_ALL_PASSES = (1 << 6) - 1,
|
DENOISING_CLEAN_ALL_PASSES = (1 << 6) - 1,
|
||||||
} DenoiseFlag;
|
} 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 {
|
typedef ccl_addr_space struct PathRadianceState {
|
||||||
#ifdef __PASSES__
|
#ifdef __PASSES__
|
||||||
float3 diffuse;
|
float3 diffuse;
|
||||||
@@ -552,10 +533,6 @@ typedef ccl_addr_space struct PathRadiance {
|
|||||||
float3 denoising_albedo;
|
float3 denoising_albedo;
|
||||||
float denoising_depth;
|
float denoising_depth;
|
||||||
#endif /* __DENOISING_FEATURES__ */
|
#endif /* __DENOISING_FEATURES__ */
|
||||||
|
|
||||||
#ifdef __KERNEL_DEBUG__
|
|
||||||
DebugData debug_data;
|
|
||||||
#endif /* __KERNEL_DEBUG__ */
|
|
||||||
} PathRadiance;
|
} PathRadiance;
|
||||||
|
|
||||||
typedef struct BsdfEval {
|
typedef struct BsdfEval {
|
||||||
@@ -671,12 +648,6 @@ typedef struct Intersection {
|
|||||||
int prim;
|
int prim;
|
||||||
int object;
|
int object;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
#ifdef __KERNEL_DEBUG__
|
|
||||||
int num_traversed_nodes;
|
|
||||||
int num_traversed_instances;
|
|
||||||
int num_intersections;
|
|
||||||
#endif
|
|
||||||
} Intersection;
|
} Intersection;
|
||||||
|
|
||||||
/* Primitives */
|
/* Primitives */
|
||||||
@@ -1265,13 +1236,6 @@ typedef struct KernelFilm {
|
|||||||
int pass_bake_differential;
|
int pass_bake_differential;
|
||||||
int pad;
|
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 */
|
/* viewport rendering options */
|
||||||
int display_pass_stride;
|
int display_pass_stride;
|
||||||
int display_pass_components;
|
int display_pass_components;
|
||||||
@@ -1483,7 +1447,10 @@ typedef struct KernelObject {
|
|||||||
|
|
||||||
float shadow_terminator_shading_offset;
|
float shadow_terminator_shading_offset;
|
||||||
float shadow_terminator_geometry_offset;
|
float shadow_terminator_geometry_offset;
|
||||||
float pad1, pad2, pad3;
|
|
||||||
|
float ao_distance;
|
||||||
|
|
||||||
|
float pad1, pad2;
|
||||||
} KernelObject;
|
} KernelObject;
|
||||||
static_assert_align(KernelObject, 16);
|
static_assert_align(KernelObject, 16);
|
||||||
|
|
||||||
|
@@ -54,14 +54,18 @@ vector4 safe_divide(vector4 a, float b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Smooth Voronoi:
|
* 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
|
* - https://wiki.blender.org/wiki/User:OmarSquircleArt/GSoC2019/Documentation/Smooth_Voronoi
|
||||||
*
|
*
|
||||||
* Distance To Edge:
|
* Distance To Edge based on:
|
||||||
*
|
*
|
||||||
* - https://www.shadertoy.com/view/llG3zy
|
* - https://www.iquilezles.org/www/articles/voronoilines/voronoilines.htm
|
||||||
|
* - https://www.shadertoy.com/view/ldl3W8
|
||||||
*
|
*
|
||||||
|
* 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 **** */
|
/* **** 1D Voronoi **** */
|
||||||
|
@@ -65,7 +65,10 @@ ccl_device void kernel_scene_intersect(KernelGlobals *kg)
|
|||||||
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
|
||||||
|
|
||||||
Intersection isect;
|
Intersection isect;
|
||||||
bool hit = kernel_path_scene_intersect(kg, state, &ray, &isect, L);
|
const int last_object = state->bounce > 0 ?
|
||||||
|
intersection_get_object(kg, &kernel_split_state.isect[ray_index]) :
|
||||||
|
OBJECT_NONE;
|
||||||
|
bool hit = kernel_path_scene_intersect(kg, state, &ray, &isect, L, last_object);
|
||||||
kernel_split_state.isect[ray_index] = isect;
|
kernel_split_state.isect[ray_index] = isect;
|
||||||
|
|
||||||
if (!hit) {
|
if (!hit) {
|
||||||
|
@@ -17,14 +17,19 @@
|
|||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Original code is under the MIT License, Copyright (c) 2013 Inigo Quilez.
|
||||||
|
*
|
||||||
* Smooth Voronoi:
|
* Smooth Voronoi:
|
||||||
*
|
*
|
||||||
* - https://wiki.blender.org/wiki/User:OmarSquircleArt/GSoC2019/Documentation/Smooth_Voronoi
|
* - https://wiki.blender.org/wiki/User:OmarSquircleArt/GSoC2019/Documentation/Smooth_Voronoi
|
||||||
*
|
*
|
||||||
* Distance To Edge:
|
* Distance To Edge based on:
|
||||||
*
|
*
|
||||||
* - https://www.shadertoy.com/view/llG3zy
|
* - https://www.iquilezles.org/www/articles/voronoilines/voronoilines.htm
|
||||||
|
* - https://www.shadertoy.com/view/ldl3W8
|
||||||
*
|
*
|
||||||
|
* 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 **** */
|
/* **** 1D Voronoi **** */
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include "render/mesh.h"
|
#include "render/mesh.h"
|
||||||
|
|
||||||
#include "util/util_foreach.h"
|
#include "util/util_foreach.h"
|
||||||
|
#include "util/util_logging.h"
|
||||||
#include "util/util_transform.h"
|
#include "util/util_transform.h"
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
@@ -208,6 +209,7 @@ size_t Attribute::element_size(Geometry *geom, AttributePrimitive prim) const
|
|||||||
case ATTR_ELEMENT_VERTEX_MOTION:
|
case ATTR_ELEMENT_VERTEX_MOTION:
|
||||||
if (geom->geometry_type == Geometry::MESH) {
|
if (geom->geometry_type == Geometry::MESH) {
|
||||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
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);
|
size = (mesh->get_verts().size() + mesh->get_num_ngons()) * (mesh->get_motion_steps() - 1);
|
||||||
if (prim == ATTR_PRIM_SUBD) {
|
if (prim == ATTR_PRIM_SUBD) {
|
||||||
size -= mesh->get_num_subd_verts() * (mesh->get_motion_steps() - 1);
|
size -= mesh->get_num_subd_verts() * (mesh->get_motion_steps() - 1);
|
||||||
@@ -252,6 +254,7 @@ size_t Attribute::element_size(Geometry *geom, AttributePrimitive prim) const
|
|||||||
case ATTR_ELEMENT_CURVE_KEY_MOTION:
|
case ATTR_ELEMENT_CURVE_KEY_MOTION:
|
||||||
if (geom->geometry_type == Geometry::HAIR) {
|
if (geom->geometry_type == Geometry::HAIR) {
|
||||||
Hair *hair = static_cast<Hair *>(geom);
|
Hair *hair = static_cast<Hair *>(geom);
|
||||||
|
DCHECK_GT(hair->get_motion_steps(), 0);
|
||||||
size = hair->get_curve_keys().size() * (hair->get_motion_steps() - 1);
|
size = hair->get_curve_keys().size() * (hair->get_motion_steps() - 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -322,15 +322,6 @@ bool RenderBuffers::get_pass_rect(
|
|||||||
pixels[0] = saturate(f * scale_exposure);
|
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 {
|
else {
|
||||||
for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
|
for (int i = 0; i < size; i++, in += pass_stride, pixels++) {
|
||||||
float f = *in;
|
float f = *in;
|
||||||
|
@@ -51,12 +51,6 @@ static NodeEnum *get_pass_type_enum()
|
|||||||
pass_type_enum.insert("material_id", PASS_MATERIAL_ID);
|
pass_type_enum.insert("material_id", PASS_MATERIAL_ID);
|
||||||
pass_type_enum.insert("motion", PASS_MOTION);
|
pass_type_enum.insert("motion", PASS_MOTION);
|
||||||
pass_type_enum.insert("motion_weight", PASS_MOTION_WEIGHT);
|
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("render_time", PASS_RENDER_TIME);
|
||||||
pass_type_enum.insert("cryptomatte", PASS_CRYPTOMATTE);
|
pass_type_enum.insert("cryptomatte", PASS_CRYPTOMATTE);
|
||||||
pass_type_enum.insert("aov_color", PASS_AOV_COLOR);
|
pass_type_enum.insert("aov_color", PASS_AOV_COLOR);
|
||||||
@@ -200,15 +194,6 @@ void Pass::add(PassType type, vector<Pass> &passes, const char *name)
|
|||||||
*/
|
*/
|
||||||
pass.components = 0;
|
pass.components = 0;
|
||||||
break;
|
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:
|
case PASS_RENDER_TIME:
|
||||||
/* This pass is handled entirely on the host side. */
|
/* This pass is handled entirely on the host side. */
|
||||||
pass.components = 0;
|
pass.components = 0;
|
||||||
@@ -570,20 +555,6 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
|||||||
kfilm->pass_bake_differential = kfilm->pass_stride;
|
kfilm->pass_bake_differential = kfilm->pass_stride;
|
||||||
break;
|
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:
|
case PASS_RENDER_TIME:
|
||||||
break;
|
break;
|
||||||
case PASS_CRYPTOMATTE:
|
case PASS_CRYPTOMATTE:
|
||||||
|
@@ -356,7 +356,7 @@ class ShaderGraph : public NodeOwner {
|
|||||||
/* This function is used to create a node of a specified type instead of
|
/* 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.
|
* 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...);
|
T *node = new T(args...);
|
||||||
node->set_owner(this);
|
node->set_owner(this);
|
||||||
|
@@ -102,6 +102,8 @@ NODE_DEFINE(Object)
|
|||||||
SOCKET_NODE(particle_system, "Particle System", ParticleSystem::get_node_type());
|
SOCKET_NODE(particle_system, "Particle System", ParticleSystem::get_node_type());
|
||||||
SOCKET_INT(particle_index, "Particle Index", 0);
|
SOCKET_INT(particle_index, "Particle Index", 0);
|
||||||
|
|
||||||
|
SOCKET_FLOAT(ao_distance, "AO Distance", 0.0f);
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,6 +430,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
|
|||||||
kobject.random_number = random_number;
|
kobject.random_number = random_number;
|
||||||
kobject.particle_index = particle_index;
|
kobject.particle_index = particle_index;
|
||||||
kobject.motion_offset = 0;
|
kobject.motion_offset = 0;
|
||||||
|
kobject.ao_distance = ob->ao_distance;
|
||||||
|
|
||||||
if (geom->get_use_motion_blur()) {
|
if (geom->get_use_motion_blur()) {
|
||||||
state->have_motion = true;
|
state->have_motion = true;
|
||||||
|
@@ -73,6 +73,8 @@ class Object : public Node {
|
|||||||
NODE_SOCKET_API(ParticleSystem *, particle_system);
|
NODE_SOCKET_API(ParticleSystem *, particle_system);
|
||||||
NODE_SOCKET_API(int, particle_index);
|
NODE_SOCKET_API(int, particle_index);
|
||||||
|
|
||||||
|
NODE_SOCKET_API(float, ao_distance)
|
||||||
|
|
||||||
Object();
|
Object();
|
||||||
~Object();
|
~Object();
|
||||||
|
|
||||||
|
@@ -299,7 +299,7 @@ class Scene : public NodeOwner {
|
|||||||
* node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate
|
* node array (e.g. Scene::geometry for Geometry nodes) and tag the appropriate
|
||||||
* manager for an update.
|
* 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...);
|
T *node = new T(args...);
|
||||||
node->set_owner(this);
|
node->set_owner(this);
|
||||||
|
@@ -57,7 +57,7 @@ struct avxb {
|
|||||||
: m256(_mm256_insertf128_ps(_mm256_castps128_ps256(a), b, 1))
|
: m256(_mm256_insertf128_ps(_mm256_castps128_ps256(a), b, 1))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
__forceinline operator const __m256 &(void)const
|
__forceinline operator const __m256 &(void) const
|
||||||
{
|
{
|
||||||
return m256;
|
return m256;
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ struct avxi {
|
|||||||
__forceinline avxi(const __m256i a) : m256(a)
|
__forceinline avxi(const __m256i a) : m256(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
__forceinline operator const __m256i &(void)const
|
__forceinline operator const __m256i &(void) const
|
||||||
{
|
{
|
||||||
return m256;
|
return m256;
|
||||||
}
|
}
|
||||||
|
@@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
CCL_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
#ifdef WITH_CYCLES_LOGGING
|
||||||
static bool is_verbosity_set()
|
static bool is_verbosity_set()
|
||||||
{
|
{
|
||||||
#ifdef WITH_CYCLES_LOGGING
|
|
||||||
using CYCLES_GFLAGS_NAMESPACE::GetCommandLineOption;
|
using CYCLES_GFLAGS_NAMESPACE::GetCommandLineOption;
|
||||||
|
|
||||||
std::string verbosity;
|
std::string verbosity;
|
||||||
@@ -36,10 +36,8 @@ static bool is_verbosity_set()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return verbosity != "0";
|
return verbosity != "0";
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void util_logging_init(const char *argv0)
|
void util_logging_init(const char *argv0)
|
||||||
{
|
{
|
||||||
|
@@ -40,7 +40,7 @@ class LogMessageVoidify {
|
|||||||
LogMessageVoidify()
|
LogMessageVoidify()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
void operator&(StubStream &)
|
void operator&(const StubStream &)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -49,6 +49,36 @@ class LogMessageVoidify {
|
|||||||
# define LOG(severity) LOG_SUPPRESS()
|
# define LOG(severity) LOG_SUPPRESS()
|
||||||
# define VLOG(severity) LOG_SUPPRESS()
|
# define VLOG(severity) LOG_SUPPRESS()
|
||||||
# define VLOG_IF(severity, condition) LOG_SUPPRESS()
|
# define VLOG_IF(severity, condition) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define CHECK(expression) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define CHECK_NOTNULL(expression) LOG_SUPPRESS()
|
||||||
|
# define CHECK_NULL(expression) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define CHECK_NEAR(actual, expected, eps) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define CHECK_GE(a, b) LOG_SUPPRESS()
|
||||||
|
# define CHECK_NE(a, b) LOG_SUPPRESS()
|
||||||
|
# define CHECK_EQ(a, b) LOG_SUPPRESS()
|
||||||
|
# define CHECK_GT(a, b) LOG_SUPPRESS()
|
||||||
|
# define CHECK_LT(a, b) LOG_SUPPRESS()
|
||||||
|
# define CHECK_LE(a, b) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define DCHECK(expression) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define DCHECK_NOTNULL(expression) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_NULL(expression) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define DCHECK_NEAR(actual, expected, eps) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define DCHECK_GE(a, b) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_NE(a, b) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_EQ(a, b) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_GT(a, b) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_LT(a, b) LOG_SUPPRESS()
|
||||||
|
# define DCHECK_LE(a, b) LOG_SUPPRESS()
|
||||||
|
|
||||||
|
# define LOG_ASSERT(expression) LOG_SUPPRESS()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VLOG_ONCE(level, flag) \
|
#define VLOG_ONCE(level, flag) \
|
||||||
|
@@ -103,7 +103,7 @@ ccl_device float fast_sinf(float x)
|
|||||||
* 1.19209e-07 max error
|
* 1.19209e-07 max error
|
||||||
*/
|
*/
|
||||||
int q = fast_rint(x * M_1_PI_F);
|
int q = fast_rint(x * M_1_PI_F);
|
||||||
float qf = q;
|
float qf = (float)q;
|
||||||
x = madd(qf, -0.78515625f * 4, x);
|
x = madd(qf, -0.78515625f * 4, x);
|
||||||
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
||||||
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
||||||
@@ -132,7 +132,7 @@ ccl_device float fast_cosf(float x)
|
|||||||
{
|
{
|
||||||
/* Same argument reduction as fast_sinf(). */
|
/* Same argument reduction as fast_sinf(). */
|
||||||
int q = fast_rint(x * M_1_PI_F);
|
int q = fast_rint(x * M_1_PI_F);
|
||||||
float qf = q;
|
float qf = (float)q;
|
||||||
x = madd(qf, -0.78515625f * 4, x);
|
x = madd(qf, -0.78515625f * 4, x);
|
||||||
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
||||||
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
||||||
@@ -160,7 +160,7 @@ ccl_device void fast_sincosf(float x, float *sine, float *cosine)
|
|||||||
{
|
{
|
||||||
/* Same argument reduction as fast_sin. */
|
/* Same argument reduction as fast_sin. */
|
||||||
int q = fast_rint(x * M_1_PI_F);
|
int q = fast_rint(x * M_1_PI_F);
|
||||||
float qf = q;
|
float qf = (float)q;
|
||||||
x = madd(qf, -0.78515625f * 4, x);
|
x = madd(qf, -0.78515625f * 4, x);
|
||||||
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
x = madd(qf, -0.00024187564849853515625f * 4, x);
|
||||||
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
x = madd(qf, -3.7747668102383613586e-08f * 4, x);
|
||||||
@@ -207,7 +207,7 @@ ccl_device float fast_tanf(float x)
|
|||||||
* we sometimes need to take the reciprocal of the polynomial
|
* we sometimes need to take the reciprocal of the polynomial
|
||||||
*/
|
*/
|
||||||
int q = fast_rint(x * 2.0f * M_1_PI_F);
|
int q = fast_rint(x * 2.0f * M_1_PI_F);
|
||||||
float qf = q;
|
float qf = (float)q;
|
||||||
x = madd(qf, -0.78515625f * 2, x);
|
x = madd(qf, -0.78515625f * 2, x);
|
||||||
x = madd(qf, -0.00024187564849853515625f * 2, x);
|
x = madd(qf, -0.00024187564849853515625f * 2, x);
|
||||||
x = madd(qf, -3.7747668102383613586e-08f * 2, x);
|
x = madd(qf, -3.7747668102383613586e-08f * 2, x);
|
||||||
@@ -407,7 +407,7 @@ ccl_device float fast_logb(float x)
|
|||||||
x = fabsf(x);
|
x = fabsf(x);
|
||||||
x = clamp(x, FLT_MIN, FLT_MAX);
|
x = clamp(x, FLT_MIN, FLT_MAX);
|
||||||
unsigned bits = __float_as_uint(x);
|
unsigned bits = __float_as_uint(x);
|
||||||
return (int)(bits >> 23) - 127;
|
return (float)((int)(bits >> 23) - 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device float fast_exp2f(float x)
|
ccl_device float fast_exp2f(float x)
|
||||||
|
@@ -57,7 +57,7 @@ struct sseb {
|
|||||||
__forceinline sseb(const __m128 input) : m128(input)
|
__forceinline sseb(const __m128 input) : m128(input)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
__forceinline operator const __m128 &(void)const
|
__forceinline operator const __m128 &(void) const
|
||||||
{
|
{
|
||||||
return m128;
|
return m128;
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ struct ssei {
|
|||||||
__forceinline ssei(const __m128i a) : m128(a)
|
__forceinline ssei(const __m128i a) : m128(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
__forceinline operator const __m128i &(void)const
|
__forceinline operator const __m128i &(void) const
|
||||||
{
|
{
|
||||||
return m128;
|
return m128;
|
||||||
}
|
}
|
||||||
|
@@ -1066,22 +1066,6 @@ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_context,
|
|||||||
uint32_t count,
|
uint32_t count,
|
||||||
const char *const *action_names);
|
const char *const *action_names);
|
||||||
|
|
||||||
/**
|
|
||||||
* Create spaces for pose-based OpenXR actions.
|
|
||||||
*/
|
|
||||||
int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_context,
|
|
||||||
const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy previously created spaces for OpenXR actions.
|
|
||||||
*/
|
|
||||||
void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_context,
|
|
||||||
const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create input/output path bindings for OpenXR actions.
|
* Create input/output path bindings for OpenXR actions.
|
||||||
*/
|
*/
|
||||||
@@ -1096,7 +1080,8 @@ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_context,
|
|||||||
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_context,
|
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_context,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos);
|
const char *const *action_names,
|
||||||
|
const char *const *profile_paths);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attach all created action sets to the current OpenXR session.
|
* Attach all created action sets to the current OpenXR session.
|
||||||
@@ -1117,6 +1102,7 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_context, const char *action_set
|
|||||||
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context,
|
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path,
|
||||||
const int64_t *duration,
|
const int64_t *duration,
|
||||||
const float *frequency,
|
const float *frequency,
|
||||||
const float *amplitude);
|
const float *amplitude);
|
||||||
@@ -1126,7 +1112,8 @@ int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context,
|
|||||||
*/
|
*/
|
||||||
void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_context,
|
void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_context,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
const char *action_name);
|
const char *action_name,
|
||||||
|
const char **subaction_path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get action set custom data (owned by Blender, not GHOST).
|
* Get action set custom data (owned by Blender, not GHOST).
|
||||||
@@ -1141,6 +1128,18 @@ void *GHOST_XrGetActionCustomdata(GHOST_XrContextHandle xr_context,
|
|||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
const char *action_name);
|
const char *action_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of actions in an action set.
|
||||||
|
*/
|
||||||
|
unsigned int GHOST_XrGetActionCount(GHOST_XrContextHandle xr_context, const char *action_set_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get custom data for all actions in an action set.
|
||||||
|
*/
|
||||||
|
void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_context,
|
||||||
|
const char *action_set_name,
|
||||||
|
void **r_customdata_array);
|
||||||
|
|
||||||
#endif /* WITH_XR_OPENXR */
|
#endif /* WITH_XR_OPENXR */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -719,29 +719,27 @@ typedef struct GHOST_XrActionInfo {
|
|||||||
const char **subaction_paths;
|
const char **subaction_paths;
|
||||||
/** States for each subaction path. */
|
/** States for each subaction path. */
|
||||||
void *states;
|
void *states;
|
||||||
|
/** Input thresholds/regions for each subaction path. */
|
||||||
|
float *float_thresholds;
|
||||||
|
int16_t *axis_flags;
|
||||||
|
|
||||||
GHOST_XrCustomdataFreeFn customdata_free_fn;
|
GHOST_XrCustomdataFreeFn customdata_free_fn;
|
||||||
void *customdata; /* wmXrAction */
|
void *customdata; /* wmXrAction */
|
||||||
} GHOST_XrActionInfo;
|
} GHOST_XrActionInfo;
|
||||||
|
|
||||||
typedef struct GHOST_XrActionSpaceInfo {
|
|
||||||
const char *action_name;
|
|
||||||
uint32_t count_subaction_paths;
|
|
||||||
const char **subaction_paths;
|
|
||||||
/** Poses for each subaction path. */
|
|
||||||
const GHOST_XrPose *poses;
|
|
||||||
} GHOST_XrActionSpaceInfo;
|
|
||||||
|
|
||||||
typedef struct GHOST_XrActionBindingInfo {
|
typedef struct GHOST_XrActionBindingInfo {
|
||||||
const char *action_name;
|
const char *component_path;
|
||||||
uint32_t count_interaction_paths;
|
float float_threshold;
|
||||||
/** Interaction path: User (sub-action) path + component path. */
|
int16_t axis_flag;
|
||||||
const char **interaction_paths;
|
GHOST_XrPose pose;
|
||||||
} GHOST_XrActionBindingInfo;
|
} GHOST_XrActionBindingInfo;
|
||||||
|
|
||||||
typedef struct GHOST_XrActionProfileInfo {
|
typedef struct GHOST_XrActionProfileInfo {
|
||||||
|
const char *action_name;
|
||||||
const char *profile_path;
|
const char *profile_path;
|
||||||
uint32_t count_bindings;
|
uint32_t count_subaction_paths;
|
||||||
|
const char **subaction_paths;
|
||||||
|
/* Bindings for each subaction path. */
|
||||||
const GHOST_XrActionBindingInfo *bindings;
|
const GHOST_XrActionBindingInfo *bindings;
|
||||||
} GHOST_XrActionProfileInfo;
|
} GHOST_XrActionProfileInfo;
|
||||||
|
|
||||||
|
@@ -961,28 +961,6 @@ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle,
|
|||||||
GHOST_XR_CAPI_CALL(xr_session->destroyActions(action_set_name, count, action_names), xr_context);
|
GHOST_XR_CAPI_CALL(xr_session->destroyActions(action_set_name, count, action_names), xr_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_contexthandle,
|
|
||||||
const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos)
|
|
||||||
{
|
|
||||||
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
|
||||||
GHOST_XrSession *xr_session = xr_context->getSession();
|
|
||||||
GHOST_XR_CAPI_CALL_RET(xr_session->createActionSpaces(action_set_name, count, infos),
|
|
||||||
xr_context);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_contexthandle,
|
|
||||||
const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos)
|
|
||||||
{
|
|
||||||
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
|
||||||
GHOST_XrSession *xr_session = xr_context->getSession();
|
|
||||||
GHOST_XR_CAPI_CALL(xr_session->destroyActionSpaces(action_set_name, count, infos), xr_context);
|
|
||||||
}
|
|
||||||
|
|
||||||
int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
|
int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
@@ -998,11 +976,14 @@ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
|
|||||||
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle,
|
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos)
|
const char *const *action_names,
|
||||||
|
const char *const *profile_paths)
|
||||||
{
|
{
|
||||||
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
||||||
GHOST_XrSession *xr_session = xr_context->getSession();
|
GHOST_XrSession *xr_session = xr_context->getSession();
|
||||||
GHOST_XR_CAPI_CALL(xr_session->destroyActionBindings(action_set_name, count, infos), xr_context);
|
GHOST_XR_CAPI_CALL(
|
||||||
|
xr_session->destroyActionBindings(action_set_name, count, action_names, profile_paths),
|
||||||
|
xr_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GHOST_XrAttachActionSets(GHOST_XrContextHandle xr_contexthandle)
|
int GHOST_XrAttachActionSets(GHOST_XrContextHandle xr_contexthandle)
|
||||||
@@ -1024,25 +1005,29 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_contexthandle, const char *acti
|
|||||||
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle,
|
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path,
|
||||||
const int64_t *duration,
|
const int64_t *duration,
|
||||||
const float *frequency,
|
const float *frequency,
|
||||||
const float *amplitude)
|
const float *amplitude)
|
||||||
{
|
{
|
||||||
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
||||||
GHOST_XrSession *xr_session = xr_context->getSession();
|
GHOST_XrSession *xr_session = xr_context->getSession();
|
||||||
GHOST_XR_CAPI_CALL_RET(xr_session->applyHapticAction(
|
GHOST_XR_CAPI_CALL_RET(
|
||||||
action_set_name, action_name, *duration, *frequency, *amplitude),
|
xr_session->applyHapticAction(
|
||||||
xr_context);
|
action_set_name, action_name, subaction_path, *duration, *frequency, *amplitude),
|
||||||
|
xr_context);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_contexthandle,
|
void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_contexthandle,
|
||||||
const char *action_set_name,
|
const char *action_set_name,
|
||||||
const char *action_name)
|
const char *action_name,
|
||||||
|
const char **subaction_path)
|
||||||
{
|
{
|
||||||
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
||||||
GHOST_XrSession *xr_session = xr_context->getSession();
|
GHOST_XrSession *xr_session = xr_context->getSession();
|
||||||
GHOST_XR_CAPI_CALL(xr_session->stopHapticAction(action_set_name, action_name), xr_context);
|
GHOST_XR_CAPI_CALL(xr_session->stopHapticAction(action_set_name, action_name, subaction_path),
|
||||||
|
xr_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *GHOST_XrGetActionSetCustomdata(GHOST_XrContextHandle xr_contexthandle,
|
void *GHOST_XrGetActionSetCustomdata(GHOST_XrContextHandle xr_contexthandle,
|
||||||
@@ -1065,4 +1050,23 @@ void *GHOST_XrGetActionCustomdata(GHOST_XrContextHandle xr_contexthandle,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int GHOST_XrGetActionCount(GHOST_XrContextHandle xr_contexthandle,
|
||||||
|
const char *action_set_name)
|
||||||
|
{
|
||||||
|
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
||||||
|
GHOST_XrSession *xr_session = xr_context->getSession();
|
||||||
|
GHOST_XR_CAPI_CALL_RET(xr_session->getActionCount(action_set_name), xr_context);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_contexthandle,
|
||||||
|
const char *action_set_name,
|
||||||
|
void **r_customdata_array)
|
||||||
|
{
|
||||||
|
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
|
||||||
|
GHOST_XrSession *xr_session = xr_context->getSession();
|
||||||
|
GHOST_XR_CAPI_CALL(xr_session->getActionCustomdataArray(action_set_name, r_customdata_array),
|
||||||
|
xr_context);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* WITH_XR_OPENXR */
|
#endif /* WITH_XR_OPENXR */
|
||||||
|
@@ -402,7 +402,9 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
|
|||||||
if (!EGL_CHK(::eglInitialize(m_display, &egl_major, &egl_minor)))
|
if (!EGL_CHK(::eglInitialize(m_display, &egl_major, &egl_minor)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
#ifdef WITH_GHOST_DEBUG
|
||||||
fprintf(stderr, "EGL Version %d.%d\n", egl_major, egl_minor);
|
fprintf(stderr, "EGL Version %d.%d\n", egl_major, egl_minor);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!EGL_CHK(::eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)))
|
if (!EGL_CHK(::eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)))
|
||||||
goto error;
|
goto error;
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
/* needed for intel drivers (works w/ mesa-swrast & nvidia) */
|
/* Needed for Intel drivers (works with MESA-software-rasterizer (`swrast`) & NVIDIA). */
|
||||||
#define USE_GLXEW_INIT_WORKAROUND
|
#define USE_GLXEW_INIT_WORKAROUND
|
||||||
|
|
||||||
#ifdef USE_GLXEW_INIT_WORKAROUND
|
#ifdef USE_GLXEW_INIT_WORKAROUND
|
||||||
@@ -295,8 +295,8 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
|
|||||||
|
|
||||||
glXMakeCurrent(m_display, m_window, m_context);
|
glXMakeCurrent(m_display, m_window, m_context);
|
||||||
|
|
||||||
// Seems that this has to be called after MakeCurrent,
|
/* Seems that this has to be called after #glXMakeCurrent,
|
||||||
// which means we cannot use glX extensions until after we create a context
|
* which means we cannot use `glX` extensions until after we create a context. */
|
||||||
initContextGLXEW();
|
initContextGLXEW();
|
||||||
|
|
||||||
if (m_window) {
|
if (m_window) {
|
||||||
|
@@ -475,16 +475,15 @@ int GHOST_ContextWGL::choose_pixel_format(bool stereoVisual, bool needAlpha)
|
|||||||
PIXELFORMATDESCRIPTOR preferredPFD = {
|
PIXELFORMATDESCRIPTOR preferredPFD = {
|
||||||
sizeof(PIXELFORMATDESCRIPTOR), /* size */
|
sizeof(PIXELFORMATDESCRIPTOR), /* size */
|
||||||
1, /* version */
|
1, /* version */
|
||||||
(DWORD)(
|
(DWORD)(PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW |
|
||||||
PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW |
|
PFD_DOUBLEBUFFER | /* support double-buffering */
|
||||||
PFD_DOUBLEBUFFER | /* support double-buffering */
|
(stereoVisual ? PFD_STEREO : 0) | /* support stereo */
|
||||||
(stereoVisual ? PFD_STEREO : 0) | /* support stereo */
|
(
|
||||||
(
|
|
||||||
#ifdef WIN32_COMPOSITING
|
#ifdef WIN32_COMPOSITING
|
||||||
needAlpha ?
|
/* Support composition for transparent background. */
|
||||||
PFD_SUPPORT_COMPOSITION : /* support composition for transparent background */
|
needAlpha ? PFD_SUPPORT_COMPOSITION :
|
||||||
#endif
|
#endif
|
||||||
0)),
|
0)),
|
||||||
PFD_TYPE_RGBA, /* color type */
|
PFD_TYPE_RGBA, /* color type */
|
||||||
(BYTE)(needAlpha ? 32 : 24), /* preferred color depth */
|
(BYTE)(needAlpha ? 32 : 24), /* preferred color depth */
|
||||||
0,
|
0,
|
||||||
|
@@ -141,22 +141,26 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(
|
|||||||
printf(" setting.frequency=%d\n", setting.frequency);
|
printf(" setting.frequency=%d\n", setting.frequency);
|
||||||
#endif // GHOST_DEBUG
|
#endif // GHOST_DEBUG
|
||||||
|
|
||||||
// Display configuration is no more available in 10.6
|
/* Display configuration is no more available in 10.6. */
|
||||||
|
|
||||||
/* CFDictionaryRef displayModeValues = ::CGDisplayBestModeForParametersAndRefreshRate(
|
#if 0
|
||||||
m_displayIDs[display],
|
CFDictionaryRef displayModeValues = ::CGDisplayBestModeForParametersAndRefreshRate(
|
||||||
(size_t)setting.bpp,
|
m_displayIDs[display],
|
||||||
(size_t)setting.xPixels,
|
(size_t)setting.bpp,
|
||||||
(size_t)setting.yPixels,
|
(size_t)setting.xPixels,
|
||||||
(CGRefreshRate)setting.frequency,
|
(size_t)setting.yPixels,
|
||||||
NULL);*/
|
(CGRefreshRate)setting.frequency,
|
||||||
|
NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GHOST_DEBUG
|
#ifdef GHOST_DEBUG
|
||||||
/* printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
|
# if 0
|
||||||
|
printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
|
||||||
printf(" setting.xPixels=%d\n", getValue(displayModeValues, kCGDisplayWidth));
|
printf(" setting.xPixels=%d\n", getValue(displayModeValues, kCGDisplayWidth));
|
||||||
printf(" setting.yPixels=%d\n", getValue(displayModeValues, kCGDisplayHeight));
|
printf(" setting.yPixels=%d\n", getValue(displayModeValues, kCGDisplayHeight));
|
||||||
printf(" setting.bpp=%d\n", getValue(displayModeValues, kCGDisplayBitsPerPixel));
|
printf(" setting.bpp=%d\n", getValue(displayModeValues, kCGDisplayBitsPerPixel));
|
||||||
printf(" setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate)); */
|
printf(" setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate));
|
||||||
|
# endif
|
||||||
#endif // GHOST_DEBUG
|
#endif // GHOST_DEBUG
|
||||||
|
|
||||||
// CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
|
// CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
|
||||||
|
@@ -32,8 +32,9 @@
|
|||||||
|
|
||||||
GHOST_ImeWin32::GHOST_ImeWin32()
|
GHOST_ImeWin32::GHOST_ImeWin32()
|
||||||
: is_composing_(false),
|
: is_composing_(false),
|
||||||
ime_status_(false),
|
|
||||||
input_language_id_(LANG_USER_DEFAULT),
|
input_language_id_(LANG_USER_DEFAULT),
|
||||||
|
conversion_modes_(IME_CMODE_ALPHANUMERIC),
|
||||||
|
sentence_mode_(IME_SMODE_NONE),
|
||||||
system_caret_(false),
|
system_caret_(false),
|
||||||
caret_rect_(-1, -1, 0, 0),
|
caret_rect_(-1, -1, 0, 0),
|
||||||
is_first(true),
|
is_first(true),
|
||||||
@@ -45,18 +46,70 @@ GHOST_ImeWin32::~GHOST_ImeWin32()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GHOST_ImeWin32::SetInputLanguage()
|
void GHOST_ImeWin32::UpdateInputLanguage()
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Retrieve the current keyboard layout from Windows and determine whether
|
* Store the current input language.
|
||||||
* or not the current input context has IMEs.
|
|
||||||
* Also save its input language for language-specific operations required
|
|
||||||
* while composing a text.
|
|
||||||
*/
|
*/
|
||||||
HKL keyboard_layout = ::GetKeyboardLayout(0);
|
HKL input_locale = ::GetKeyboardLayout(0);
|
||||||
input_language_id_ = LOWORD(keyboard_layout);
|
input_language_id_ = LOWORD(input_locale);
|
||||||
ime_status_ = ::ImmIsIME(keyboard_layout);
|
}
|
||||||
return ime_status_;
|
|
||||||
|
WORD GHOST_ImeWin32::GetInputLanguage()
|
||||||
|
{
|
||||||
|
return input_language_id_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GHOST_ImeWin32::UpdateConversionStatus(HWND window_handle)
|
||||||
|
{
|
||||||
|
HIMC imm_context = ::ImmGetContext(window_handle);
|
||||||
|
if (imm_context) {
|
||||||
|
if (::ImmGetOpenStatus(imm_context)) {
|
||||||
|
::ImmGetConversionStatus(imm_context, &conversion_modes_, &sentence_mode_);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
conversion_modes_ = IME_CMODE_ALPHANUMERIC;
|
||||||
|
sentence_mode_ = IME_SMODE_NONE;
|
||||||
|
}
|
||||||
|
::ImmReleaseContext(window_handle, imm_context);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
conversion_modes_ = IME_CMODE_ALPHANUMERIC;
|
||||||
|
sentence_mode_ = IME_SMODE_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GHOST_ImeWin32::IsEnglishMode()
|
||||||
|
{
|
||||||
|
return (conversion_modes_ & IME_CMODE_NOCONVERSION) ||
|
||||||
|
!(conversion_modes_ & (IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GHOST_ImeWin32::IsImeKeyEvent(char ascii)
|
||||||
|
{
|
||||||
|
if (!(IsEnglishMode())) {
|
||||||
|
/* In Chinese, Japanese, Korean, all alpha keys are processed by IME. */
|
||||||
|
if ((ascii >= 'A' && ascii <= 'Z') || (ascii >= 'a' && ascii <= 'z')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
switch (PRIMARYLANGID(GetInputLanguage())) {
|
||||||
|
/* In Japanese, all symbolic characters are also processed by IME. */
|
||||||
|
case LANG_JAPANESE: {
|
||||||
|
if (ascii >= ' ' && ascii <= '~') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* In Chinese, some symbolic characters are also processed by IME. */
|
||||||
|
case LANG_CHINESE: {
|
||||||
|
if (ascii && strchr("!\"$'(),.:;<>?[\\]^_`", ascii)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_ImeWin32::CreateImeWindow(HWND window_handle)
|
void GHOST_ImeWin32::CreateImeWindow(HWND window_handle)
|
||||||
|
@@ -88,7 +88,7 @@ class GHOST_EventIME : public GHOST_Event {
|
|||||||
* An application CAN call ::DefWindowProc().
|
* An application CAN call ::DefWindowProc().
|
||||||
* 2.5. WM_INPUTLANGCHANGE (0x0051)
|
* 2.5. WM_INPUTLANGCHANGE (0x0051)
|
||||||
* Call the functions listed below:
|
* Call the functions listed below:
|
||||||
* - GHOST_ImeWin32::SetInputLanguage().
|
* - GHOST_ImeWin32::UpdateInputLanguage().
|
||||||
* An application CAN call ::DefWindowProc().
|
* An application CAN call ::DefWindowProc().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -148,13 +148,20 @@ class GHOST_ImeWin32 {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the input language from Windows and update it.
|
* Retrieves the input language from Windows and update it.
|
||||||
* Return values
|
|
||||||
* * true
|
|
||||||
* The given input language has IMEs.
|
|
||||||
* * false
|
|
||||||
* The given input language does not have IMEs.
|
|
||||||
*/
|
*/
|
||||||
bool SetInputLanguage();
|
void UpdateInputLanguage();
|
||||||
|
|
||||||
|
/* Returns the current input language id. */
|
||||||
|
WORD GetInputLanguage();
|
||||||
|
|
||||||
|
/* Saves the current conversion status. */
|
||||||
|
void UpdateConversionStatus(HWND window_handle);
|
||||||
|
|
||||||
|
/* Is the IME currently in conversion mode? */
|
||||||
|
bool IsEnglishMode();
|
||||||
|
|
||||||
|
/* Checks a key whether IME has to do handling. */
|
||||||
|
bool IsImeKeyEvent(char ascii);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the IME windows, and allocate required resources for them.
|
* Create the IME windows, and allocate required resources for them.
|
||||||
@@ -338,15 +345,6 @@ class GHOST_ImeWin32 {
|
|||||||
*/
|
*/
|
||||||
bool is_composing_;
|
bool is_composing_;
|
||||||
|
|
||||||
/**
|
|
||||||
* This value represents whether or not the current input context has IMEs.
|
|
||||||
* The following table shows the list of IME status:
|
|
||||||
* Value Description
|
|
||||||
* false The current input language does not have IMEs.
|
|
||||||
* true The current input language has IMEs.
|
|
||||||
*/
|
|
||||||
bool ime_status_;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current input Language ID retrieved from Windows, which consists of:
|
* The current input Language ID retrieved from Windows, which consists of:
|
||||||
* * Primary Language ID (bit 0 to bit 9), which shows a natural language
|
* * Primary Language ID (bit 0 to bit 9), which shows a natural language
|
||||||
@@ -371,6 +369,12 @@ class GHOST_ImeWin32 {
|
|||||||
*/
|
*/
|
||||||
LANGID input_language_id_;
|
LANGID input_language_id_;
|
||||||
|
|
||||||
|
/* Current Conversion Mode Values. Retrieved with ImmGetConversionStatus. */
|
||||||
|
DWORD conversion_modes_;
|
||||||
|
|
||||||
|
/* Current Sentence Mode. Retrieved with ImmGetConversionStatus. */
|
||||||
|
DWORD sentence_mode_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents whether or not the current input context has created a system
|
* Represents whether or not the current input context has created a system
|
||||||
* caret to set the position of its IME candidate window.
|
* caret to set the position of its IME candidate window.
|
||||||
|
@@ -1587,7 +1587,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
|||||||
{
|
{
|
||||||
NSTimeInterval timestamp = [event timestamp];
|
NSTimeInterval timestamp = [event timestamp];
|
||||||
if (timestamp < m_last_warp_timestamp) {
|
if (timestamp < m_last_warp_timestamp) {
|
||||||
/* After warping we can still receive older unwarped mouse events,
|
/* After warping we can still receive older unwrapped mouse events,
|
||||||
* ignore those. */
|
* ignore those. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -473,7 +473,7 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
|
|||||||
GHOST_TKey gkey = convertSDLKey(sdl_sub_evt.keysym.scancode);
|
GHOST_TKey gkey = convertSDLKey(sdl_sub_evt.keysym.scancode);
|
||||||
/* NOTE: the `sdl_sub_evt.keysym.sym` is truncated,
|
/* NOTE: the `sdl_sub_evt.keysym.sym` is truncated,
|
||||||
* for unicode support ghost has to be modified. */
|
* for unicode support ghost has to be modified. */
|
||||||
/* printf("%d\n", sym); */
|
// printf("%d\n", sym);
|
||||||
if (sym > 127) {
|
if (sym > 127) {
|
||||||
switch (sym) {
|
switch (sym) {
|
||||||
case SDLK_KP_DIVIDE:
|
case SDLK_KP_DIVIDE:
|
||||||
|
@@ -1219,6 +1219,12 @@ GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RA
|
|||||||
ascii = utf8_char[0] & 0x80 ? '?' : utf8_char[0];
|
ascii = utf8_char[0] & 0x80 ? '?' : utf8_char[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_INPUT_IME
|
||||||
|
if (window->getImeInput()->IsImeKeyEvent(ascii)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif /* WITH_INPUT_IME */
|
||||||
|
|
||||||
event = new GHOST_EventKey(system->getMilliSeconds(),
|
event = new GHOST_EventKey(system->getMilliSeconds(),
|
||||||
keyDown ? GHOST_kEventKeyDown : GHOST_kEventKeyUp,
|
keyDown ? GHOST_kEventKeyDown : GHOST_kEventKeyUp,
|
||||||
window,
|
window,
|
||||||
@@ -1418,7 +1424,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
|||||||
case WM_INPUTLANGCHANGE: {
|
case WM_INPUTLANGCHANGE: {
|
||||||
system->handleKeyboardChange();
|
system->handleKeyboardChange();
|
||||||
#ifdef WITH_INPUT_IME
|
#ifdef WITH_INPUT_IME
|
||||||
window->getImeInput()->SetInputLanguage();
|
window->getImeInput()->UpdateInputLanguage();
|
||||||
|
window->getImeInput()->UpdateConversionStatus(hwnd);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1455,9 +1462,16 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// IME events, processed, read more in GHOST_IME.h
|
// IME events, processed, read more in GHOST_IME.h
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
case WM_IME_NOTIFY: {
|
||||||
|
/* Update conversion status when IME is changed or input mode is changed. */
|
||||||
|
if (wParam == IMN_SETOPENSTATUS || wParam == IMN_SETCONVERSIONMODE) {
|
||||||
|
window->getImeInput()->UpdateConversionStatus(hwnd);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case WM_IME_SETCONTEXT: {
|
case WM_IME_SETCONTEXT: {
|
||||||
GHOST_ImeWin32 *ime = window->getImeInput();
|
GHOST_ImeWin32 *ime = window->getImeInput();
|
||||||
ime->SetInputLanguage();
|
ime->UpdateInputLanguage();
|
||||||
ime->CreateImeWindow(hwnd);
|
ime->CreateImeWindow(hwnd);
|
||||||
ime->CleanupComposition(hwnd);
|
ime->CleanupComposition(hwnd);
|
||||||
ime->CheckFirst(hwnd);
|
ime->CheckFirst(hwnd);
|
||||||
@@ -1466,8 +1480,6 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
|||||||
case WM_IME_STARTCOMPOSITION: {
|
case WM_IME_STARTCOMPOSITION: {
|
||||||
GHOST_ImeWin32 *ime = window->getImeInput();
|
GHOST_ImeWin32 *ime = window->getImeInput();
|
||||||
eventHandled = true;
|
eventHandled = true;
|
||||||
/* remove input event before start comp event, avoid redundant input */
|
|
||||||
eventManager->removeTypeEvents(GHOST_kEventKeyDown, window);
|
|
||||||
ime->CreateImeWindow(hwnd);
|
ime->CreateImeWindow(hwnd);
|
||||||
ime->ResetComposition(hwnd);
|
ime->ResetComposition(hwnd);
|
||||||
event = processImeEvent(GHOST_kEventImeCompositionStart, window, &ime->eventImeData);
|
event = processImeEvent(GHOST_kEventImeCompositionStart, window, &ime->eventImeData);
|
||||||
@@ -2111,10 +2123,9 @@ GHOST_TSuccess GHOST_SystemWin32::showMessageBox(const char *title,
|
|||||||
config.cbSize = sizeof(config);
|
config.cbSize = sizeof(config);
|
||||||
config.hInstance = 0;
|
config.hInstance = 0;
|
||||||
config.dwCommonButtons = 0;
|
config.dwCommonButtons = 0;
|
||||||
config.pszMainIcon = (dialog_options & GHOST_DialogError ?
|
config.pszMainIcon = (dialog_options & GHOST_DialogError ? TD_ERROR_ICON :
|
||||||
TD_ERROR_ICON :
|
dialog_options & GHOST_DialogWarning ? TD_WARNING_ICON :
|
||||||
dialog_options & GHOST_DialogWarning ? TD_WARNING_ICON :
|
TD_INFORMATION_ICON);
|
||||||
TD_INFORMATION_ICON);
|
|
||||||
config.pszWindowTitle = L"Blender";
|
config.pszWindowTitle = L"Blender";
|
||||||
config.pszMainInstruction = title_16;
|
config.pszMainInstruction = title_16;
|
||||||
config.pszContent = message_16;
|
config.pszContent = message_16;
|
||||||
|
@@ -802,8 +802,7 @@ static bool checkTabletProximity(Display *display, XDevice *device)
|
|||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
XInputClass *cls = state->data;
|
XInputClass *cls = state->data;
|
||||||
// printf("%d class%s :\n", state->num_classes,
|
// printf("%d class%s :\n", state->num_classes, (state->num_classes > 1) ? "es" : "");
|
||||||
// (state->num_classes > 1) ? "es" : "");
|
|
||||||
for (int loop = 0; loop < state->num_classes; loop++) {
|
for (int loop = 0; loop < state->num_classes; loop++) {
|
||||||
switch (cls->c_class) {
|
switch (cls->c_class) {
|
||||||
case ValuatorClass:
|
case ValuatorClass:
|
||||||
@@ -1189,9 +1188,9 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
|
|||||||
else {
|
else {
|
||||||
printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
|
printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
|
||||||
(unsigned int)key_sym,
|
(unsigned int)key_sym,
|
||||||
(status == XLookupNone ?
|
(status == XLookupNone ? "XLookupNone" :
|
||||||
"XLookupNone" :
|
status == XLookupKeySym ? "XLookupKeySym" :
|
||||||
status == XLookupKeySym ? "XLookupKeySym" : "Unknown status"));
|
"Unknown status"));
|
||||||
|
|
||||||
printf("'%.*s' %p %p\n", len, utf8_buf, xic, m_xim);
|
printf("'%.*s' %p %p\n", len, utf8_buf, xic, m_xim);
|
||||||
}
|
}
|
||||||
|
@@ -403,7 +403,7 @@ GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (natom) {
|
if (natom) {
|
||||||
/* printf("Register atoms: %d\n", natom); */
|
// printf("Register atoms: %d\n", natom);
|
||||||
XSetWMProtocols(m_display, m_window, atoms, natom);
|
XSetWMProtocols(m_display, m_window, atoms, natom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1275,15 +1275,15 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
|
|||||||
{
|
{
|
||||||
if (type == GHOST_kDrawingContextTypeOpenGL) {
|
if (type == GHOST_kDrawingContextTypeOpenGL) {
|
||||||
|
|
||||||
// During development:
|
/* During development:
|
||||||
// try 4.x compatibility profile
|
* - Try 4.x compatibility profile.
|
||||||
// try 3.3 compatibility profile
|
* - Try 3.3 compatibility profile.
|
||||||
// fall back to 3.0 if needed
|
* - Fall back to 3.0 if needed.
|
||||||
//
|
*
|
||||||
// Final Blender 2.8:
|
* Final Blender 2.8:
|
||||||
// try 4.x core profile
|
* - Try 4.x core profile
|
||||||
// try 3.3 core profile
|
* - Try 3.3 core profile
|
||||||
// no fallbacks
|
* - No fall-backs. */
|
||||||
|
|
||||||
#if defined(WITH_GL_PROFILE_CORE)
|
#if defined(WITH_GL_PROFILE_CORE)
|
||||||
{
|
{
|
||||||
|
@@ -33,24 +33,22 @@
|
|||||||
*
|
*
|
||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GHOST_XrActionSpace::GHOST_XrActionSpace(XrInstance instance,
|
GHOST_XrActionSpace::GHOST_XrActionSpace(XrSession session,
|
||||||
XrSession session,
|
|
||||||
XrAction action,
|
XrAction action,
|
||||||
const GHOST_XrActionSpaceInfo &info,
|
const char *action_name,
|
||||||
uint32_t subaction_idx)
|
const char *profile_path,
|
||||||
|
XrPath subaction_path,
|
||||||
|
const char *subaction_path_str,
|
||||||
|
const GHOST_XrPose &pose)
|
||||||
{
|
{
|
||||||
const char *subaction_path = info.subaction_paths[subaction_idx];
|
|
||||||
CHECK_XR(xrStringToPath(instance, subaction_path, &m_subaction_path),
|
|
||||||
(std::string("Failed to get user path \"") + subaction_path + "\".").data());
|
|
||||||
|
|
||||||
XrActionSpaceCreateInfo action_space_info{XR_TYPE_ACTION_SPACE_CREATE_INFO};
|
XrActionSpaceCreateInfo action_space_info{XR_TYPE_ACTION_SPACE_CREATE_INFO};
|
||||||
action_space_info.action = action;
|
action_space_info.action = action;
|
||||||
action_space_info.subactionPath = m_subaction_path;
|
action_space_info.subactionPath = subaction_path;
|
||||||
copy_ghost_pose_to_openxr_pose(info.poses[subaction_idx], action_space_info.poseInActionSpace);
|
copy_ghost_pose_to_openxr_pose(pose, action_space_info.poseInActionSpace);
|
||||||
|
|
||||||
CHECK_XR(xrCreateActionSpace(session, &action_space_info, &m_space),
|
CHECK_XR(xrCreateActionSpace(session, &action_space_info, &m_space),
|
||||||
(std::string("Failed to create space \"") + subaction_path + "\" for action \"" +
|
(std::string("Failed to create space \"") + subaction_path_str + "\" for action \"" +
|
||||||
info.action_name + "\".")
|
action_name + "\" and profile \"" + profile_path + "\".")
|
||||||
.data());
|
.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,11 +64,6 @@ XrSpace GHOST_XrActionSpace::getSpace() const
|
|||||||
return m_space;
|
return m_space;
|
||||||
}
|
}
|
||||||
|
|
||||||
const XrPath &GHOST_XrActionSpace::getSubactionPath() const
|
|
||||||
{
|
|
||||||
return m_subaction_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
@@ -79,13 +72,19 @@ const XrPath &GHOST_XrActionSpace::getSubactionPath() const
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
GHOST_XrActionProfile::GHOST_XrActionProfile(XrInstance instance,
|
GHOST_XrActionProfile::GHOST_XrActionProfile(XrInstance instance,
|
||||||
|
XrSession session,
|
||||||
XrAction action,
|
XrAction action,
|
||||||
const char *profile_path,
|
GHOST_XrActionType type,
|
||||||
const GHOST_XrActionBindingInfo &info)
|
const GHOST_XrActionProfileInfo &info)
|
||||||
{
|
{
|
||||||
CHECK_XR(
|
CHECK_XR(xrStringToPath(instance, info.profile_path, &m_profile),
|
||||||
xrStringToPath(instance, profile_path, &m_profile),
|
(std::string("Failed to get interaction profile path \"") + info.profile_path + "\".")
|
||||||
(std::string("Failed to get interaction profile path \"") + profile_path + "\".").data());
|
.data());
|
||||||
|
|
||||||
|
const bool is_float_action = (type == GHOST_kXrActionTypeFloatInput ||
|
||||||
|
type == GHOST_kXrActionTypeVector2fInput);
|
||||||
|
const bool is_button_action = (is_float_action || type == GHOST_kXrActionTypeBooleanInput);
|
||||||
|
const bool is_pose_action = (type == GHOST_kXrActionTypePoseInput);
|
||||||
|
|
||||||
/* Create bindings. */
|
/* Create bindings. */
|
||||||
XrInteractionProfileSuggestedBinding bindings_info{
|
XrInteractionProfileSuggestedBinding bindings_info{
|
||||||
@@ -93,31 +92,80 @@ GHOST_XrActionProfile::GHOST_XrActionProfile(XrInstance instance,
|
|||||||
bindings_info.interactionProfile = m_profile;
|
bindings_info.interactionProfile = m_profile;
|
||||||
bindings_info.countSuggestedBindings = 1;
|
bindings_info.countSuggestedBindings = 1;
|
||||||
|
|
||||||
for (uint32_t interaction_idx = 0; interaction_idx < info.count_interaction_paths;
|
for (uint32_t subaction_idx = 0; subaction_idx < info.count_subaction_paths; ++subaction_idx) {
|
||||||
++interaction_idx) {
|
const char *subaction_path_str = info.subaction_paths[subaction_idx];
|
||||||
const char *interaction_path = info.interaction_paths[interaction_idx];
|
const GHOST_XrActionBindingInfo &binding_info = info.bindings[subaction_idx];
|
||||||
|
|
||||||
|
const std::string interaction_path = std::string(subaction_path_str) +
|
||||||
|
binding_info.component_path;
|
||||||
if (m_bindings.find(interaction_path) != m_bindings.end()) {
|
if (m_bindings.find(interaction_path) != m_bindings.end()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
XrActionSuggestedBinding sbinding;
|
XrActionSuggestedBinding sbinding;
|
||||||
sbinding.action = action;
|
sbinding.action = action;
|
||||||
CHECK_XR(xrStringToPath(instance, interaction_path, &sbinding.binding),
|
CHECK_XR(xrStringToPath(instance, interaction_path.data(), &sbinding.binding),
|
||||||
(std::string("Failed to get interaction path \"") + interaction_path + "\".").data());
|
(std::string("Failed to get interaction path \"") + interaction_path + "\".").data());
|
||||||
bindings_info.suggestedBindings = &sbinding;
|
bindings_info.suggestedBindings = &sbinding;
|
||||||
|
|
||||||
/* Although the bindings will be re-suggested in GHOST_XrSession::attachActionSets(), it
|
/* Although the bindings will be re-suggested in GHOST_XrSession::attachActionSets(), it
|
||||||
* greatly improves error checking to suggest them here first. */
|
* greatly improves error checking to suggest them here first. */
|
||||||
CHECK_XR(xrSuggestInteractionProfileBindings(instance, &bindings_info),
|
CHECK_XR(xrSuggestInteractionProfileBindings(instance, &bindings_info),
|
||||||
(std::string("Failed to create binding for profile \"") + profile_path +
|
(std::string("Failed to create binding for action \"") + info.action_name +
|
||||||
"\" and action \"" + info.action_name +
|
"\" and profile \"" + info.profile_path +
|
||||||
"\". Are the profile and action paths correct?")
|
"\". Are the action and profile paths correct?")
|
||||||
.data());
|
.data());
|
||||||
|
|
||||||
m_bindings.insert({interaction_path, sbinding.binding});
|
m_bindings.insert({interaction_path, sbinding.binding});
|
||||||
|
|
||||||
|
if (m_subaction_data.find(subaction_path_str) == m_subaction_data.end()) {
|
||||||
|
std::map<std::string, GHOST_XrSubactionData>::iterator it =
|
||||||
|
m_subaction_data
|
||||||
|
.emplace(
|
||||||
|
std::piecewise_construct, std::make_tuple(subaction_path_str), std::make_tuple())
|
||||||
|
.first;
|
||||||
|
GHOST_XrSubactionData &subaction = it->second;
|
||||||
|
|
||||||
|
CHECK_XR(xrStringToPath(instance, subaction_path_str, &subaction.subaction_path),
|
||||||
|
(std::string("Failed to get user path \"") + subaction_path_str + "\".").data());
|
||||||
|
|
||||||
|
if (is_float_action || is_button_action) {
|
||||||
|
if (is_float_action) {
|
||||||
|
subaction.float_threshold = binding_info.float_threshold;
|
||||||
|
}
|
||||||
|
if (is_button_action) {
|
||||||
|
subaction.axis_flag = binding_info.axis_flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (is_pose_action) {
|
||||||
|
/* Create action space for pose bindings. */
|
||||||
|
subaction.space = std::make_unique<GHOST_XrActionSpace>(session,
|
||||||
|
action,
|
||||||
|
info.action_name,
|
||||||
|
info.profile_path,
|
||||||
|
subaction.subaction_path,
|
||||||
|
subaction_path_str,
|
||||||
|
binding_info.pose);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XrPath GHOST_XrActionProfile::getProfile() const
|
||||||
|
{
|
||||||
|
return m_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
const GHOST_XrSubactionData *GHOST_XrActionProfile::getSubaction(XrPath subaction_path) const
|
||||||
|
{
|
||||||
|
for (auto &[subaction_path_str, subaction] : m_subaction_data) {
|
||||||
|
if (subaction.subaction_path == subaction_path) {
|
||||||
|
return &subaction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void GHOST_XrActionProfile::getBindings(
|
void GHOST_XrActionProfile::getBindings(
|
||||||
XrAction action, std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const
|
XrAction action, std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const
|
||||||
{
|
{
|
||||||
@@ -152,14 +200,18 @@ GHOST_XrAction::GHOST_XrAction(XrInstance instance,
|
|||||||
const GHOST_XrActionInfo &info)
|
const GHOST_XrActionInfo &info)
|
||||||
: m_type(info.type),
|
: m_type(info.type),
|
||||||
m_states(info.states),
|
m_states(info.states),
|
||||||
|
m_float_thresholds(info.float_thresholds),
|
||||||
|
m_axis_flags(info.axis_flags),
|
||||||
m_custom_data_(
|
m_custom_data_(
|
||||||
std::make_unique<GHOST_C_CustomDataWrapper>(info.customdata, info.customdata_free_fn))
|
std::make_unique<GHOST_C_CustomDataWrapper>(info.customdata, info.customdata_free_fn))
|
||||||
{
|
{
|
||||||
m_subaction_paths.resize(info.count_subaction_paths);
|
m_subaction_paths.resize(info.count_subaction_paths);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < info.count_subaction_paths; ++i) {
|
for (uint32_t i = 0; i < info.count_subaction_paths; ++i) {
|
||||||
CHECK_XR(xrStringToPath(instance, info.subaction_paths[i], &m_subaction_paths[i]),
|
const char *subaction_path_str = info.subaction_paths[i];
|
||||||
(std::string("Failed to get user path \"") + info.subaction_paths[i] + "\".").data());
|
CHECK_XR(xrStringToPath(instance, subaction_path_str, &m_subaction_paths[i]),
|
||||||
|
(std::string("Failed to get user path \"") + subaction_path_str + "\".").data());
|
||||||
|
m_subaction_indices.insert({subaction_path_str, i});
|
||||||
}
|
}
|
||||||
|
|
||||||
XrActionCreateInfo action_info{XR_TYPE_ACTION_CREATE_INFO};
|
XrActionCreateInfo action_info{XR_TYPE_ACTION_CREATE_INFO};
|
||||||
@@ -201,52 +253,25 @@ GHOST_XrAction::~GHOST_XrAction()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GHOST_XrAction::createSpace(XrInstance instance,
|
|
||||||
XrSession session,
|
|
||||||
const GHOST_XrActionSpaceInfo &info)
|
|
||||||
{
|
|
||||||
uint32_t subaction_idx = 0;
|
|
||||||
for (; subaction_idx < info.count_subaction_paths; ++subaction_idx) {
|
|
||||||
if (m_spaces.find(info.subaction_paths[subaction_idx]) != m_spaces.end()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (subaction_idx = 0; subaction_idx < info.count_subaction_paths; ++subaction_idx) {
|
|
||||||
m_spaces.emplace(std::piecewise_construct,
|
|
||||||
std::make_tuple(info.subaction_paths[subaction_idx]),
|
|
||||||
std::make_tuple(instance, session, m_action, info, subaction_idx));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GHOST_XrAction::destroySpace(const char *subaction_path)
|
|
||||||
{
|
|
||||||
if (m_spaces.find(subaction_path) != m_spaces.end()) {
|
|
||||||
m_spaces.erase(subaction_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GHOST_XrAction::createBinding(XrInstance instance,
|
bool GHOST_XrAction::createBinding(XrInstance instance,
|
||||||
const char *profile_path,
|
XrSession session,
|
||||||
const GHOST_XrActionBindingInfo &info)
|
const GHOST_XrActionProfileInfo &info)
|
||||||
{
|
{
|
||||||
if (m_profiles.find(profile_path) != m_profiles.end()) {
|
if (m_profiles.find(info.profile_path) != m_profiles.end()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_profiles.emplace(std::piecewise_construct,
|
m_profiles.emplace(std::piecewise_construct,
|
||||||
std::make_tuple(profile_path),
|
std::make_tuple(info.profile_path),
|
||||||
std::make_tuple(instance, m_action, profile_path, info));
|
std::make_tuple(instance, session, m_action, m_type, info));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_XrAction::destroyBinding(const char *interaction_profile_path)
|
void GHOST_XrAction::destroyBinding(const char *profile_path)
|
||||||
{
|
{
|
||||||
if (m_profiles.find(interaction_profile_path) != m_profiles.end()) {
|
if (m_profiles.find(profile_path) != m_profiles.end()) {
|
||||||
m_profiles.erase(interaction_profile_path);
|
m_profiles.erase(profile_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,6 +280,10 @@ void GHOST_XrAction::updateState(XrSession session,
|
|||||||
XrSpace reference_space,
|
XrSpace reference_space,
|
||||||
const XrTime &predicted_display_time)
|
const XrTime &predicted_display_time)
|
||||||
{
|
{
|
||||||
|
const bool is_float_action = (m_type == GHOST_kXrActionTypeFloatInput ||
|
||||||
|
m_type == GHOST_kXrActionTypeVector2fInput);
|
||||||
|
const bool is_button_action = (is_float_action || m_type == GHOST_kXrActionTypeBooleanInput);
|
||||||
|
|
||||||
XrActionStateGetInfo state_info{XR_TYPE_ACTION_STATE_GET_INFO};
|
XrActionStateGetInfo state_info{XR_TYPE_ACTION_STATE_GET_INFO};
|
||||||
state_info.action = m_action;
|
state_info.action = m_action;
|
||||||
|
|
||||||
@@ -262,6 +291,28 @@ void GHOST_XrAction::updateState(XrSession session,
|
|||||||
for (size_t subaction_idx = 0; subaction_idx < count_subaction_paths; ++subaction_idx) {
|
for (size_t subaction_idx = 0; subaction_idx < count_subaction_paths; ++subaction_idx) {
|
||||||
state_info.subactionPath = m_subaction_paths[subaction_idx];
|
state_info.subactionPath = m_subaction_paths[subaction_idx];
|
||||||
|
|
||||||
|
/* Set subaction data based on current interaction profile. */
|
||||||
|
XrInteractionProfileState profile_state{XR_TYPE_INTERACTION_PROFILE_STATE};
|
||||||
|
CHECK_XR(xrGetCurrentInteractionProfile(session, state_info.subactionPath, &profile_state),
|
||||||
|
"Failed to get current interaction profile.");
|
||||||
|
|
||||||
|
const GHOST_XrSubactionData *subaction = nullptr;
|
||||||
|
for (auto &[profile_path, profile] : m_profiles) {
|
||||||
|
if (profile.getProfile() == profile_state.interactionProfile) {
|
||||||
|
subaction = profile.getSubaction(state_info.subactionPath);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subaction != nullptr) {
|
||||||
|
if (is_float_action) {
|
||||||
|
m_float_thresholds[subaction_idx] = subaction->float_threshold;
|
||||||
|
}
|
||||||
|
if (is_button_action) {
|
||||||
|
m_axis_flags[subaction_idx] = subaction->axis_flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case GHOST_kXrActionTypeBooleanInput: {
|
case GHOST_kXrActionTypeBooleanInput: {
|
||||||
XrActionStateBoolean state{XR_TYPE_ACTION_STATE_BOOLEAN};
|
XrActionStateBoolean state{XR_TYPE_ACTION_STATE_BOOLEAN};
|
||||||
@@ -299,14 +350,9 @@ void GHOST_XrAction::updateState(XrSession session,
|
|||||||
xrGetActionStatePose(session, &state_info, &state),
|
xrGetActionStatePose(session, &state_info, &state),
|
||||||
(std::string("Failed to get state for pose action \"") + action_name + "\".").data());
|
(std::string("Failed to get state for pose action \"") + action_name + "\".").data());
|
||||||
if (state.isActive) {
|
if (state.isActive) {
|
||||||
XrSpace pose_space = XR_NULL_HANDLE;
|
XrSpace pose_space = ((subaction != nullptr) && (subaction->space != nullptr)) ?
|
||||||
for (auto &[path, space] : m_spaces) {
|
subaction->space->getSpace() :
|
||||||
if (space.getSubactionPath() == state_info.subactionPath) {
|
XR_NULL_HANDLE;
|
||||||
pose_space = space.getSpace();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pose_space != XR_NULL_HANDLE) {
|
if (pose_space != XR_NULL_HANDLE) {
|
||||||
XrSpaceLocation space_location{XR_TYPE_SPACE_LOCATION};
|
XrSpaceLocation space_location{XR_TYPE_SPACE_LOCATION};
|
||||||
CHECK_XR(
|
CHECK_XR(
|
||||||
@@ -329,6 +375,7 @@ void GHOST_XrAction::updateState(XrSession session,
|
|||||||
|
|
||||||
void GHOST_XrAction::applyHapticFeedback(XrSession session,
|
void GHOST_XrAction::applyHapticFeedback(XrSession session,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path_str,
|
||||||
const int64_t &duration,
|
const int64_t &duration,
|
||||||
const float &frequency,
|
const float &frequency,
|
||||||
const float &litude)
|
const float &litude)
|
||||||
@@ -342,24 +389,46 @@ void GHOST_XrAction::applyHapticFeedback(XrSession session,
|
|||||||
XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
|
XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
|
||||||
haptic_info.action = m_action;
|
haptic_info.action = m_action;
|
||||||
|
|
||||||
for (std::vector<XrPath>::iterator it = m_subaction_paths.begin(); it != m_subaction_paths.end();
|
if (subaction_path_str != nullptr) {
|
||||||
++it) {
|
SubactionIndexMap::iterator it = m_subaction_indices.find(*subaction_path_str);
|
||||||
haptic_info.subactionPath = *it;
|
if (it != m_subaction_indices.end()) {
|
||||||
CHECK_XR(xrApplyHapticFeedback(session, &haptic_info, (const XrHapticBaseHeader *)&vibration),
|
haptic_info.subactionPath = m_subaction_paths[it->second];
|
||||||
(std::string("Failed to apply haptic action \"") + action_name + "\".").data());
|
CHECK_XR(
|
||||||
|
xrApplyHapticFeedback(session, &haptic_info, (const XrHapticBaseHeader *)&vibration),
|
||||||
|
(std::string("Failed to apply haptic action \"") + action_name + "\".").data());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (const XrPath &subaction_path : m_subaction_paths) {
|
||||||
|
haptic_info.subactionPath = subaction_path;
|
||||||
|
CHECK_XR(
|
||||||
|
xrApplyHapticFeedback(session, &haptic_info, (const XrHapticBaseHeader *)&vibration),
|
||||||
|
(std::string("Failed to apply haptic action \"") + action_name + "\".").data());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_XrAction::stopHapticFeedback(XrSession session, const char *action_name)
|
void GHOST_XrAction::stopHapticFeedback(XrSession session,
|
||||||
|
const char *action_name,
|
||||||
|
const char **subaction_path_str)
|
||||||
{
|
{
|
||||||
XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
|
XrHapticActionInfo haptic_info{XR_TYPE_HAPTIC_ACTION_INFO};
|
||||||
haptic_info.action = m_action;
|
haptic_info.action = m_action;
|
||||||
|
|
||||||
for (std::vector<XrPath>::iterator it = m_subaction_paths.begin(); it != m_subaction_paths.end();
|
if (subaction_path_str != nullptr) {
|
||||||
++it) {
|
SubactionIndexMap::iterator it = m_subaction_indices.find(*subaction_path_str);
|
||||||
haptic_info.subactionPath = *it;
|
if (it != m_subaction_indices.end()) {
|
||||||
CHECK_XR(xrStopHapticFeedback(session, &haptic_info),
|
haptic_info.subactionPath = m_subaction_paths[it->second];
|
||||||
(std::string("Failed to stop haptic action \"") + action_name + "\".").data());
|
CHECK_XR(xrStopHapticFeedback(session, &haptic_info),
|
||||||
|
(std::string("Failed to stop haptic action \"") + action_name + "\".").data());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (const XrPath &subaction_path : m_subaction_paths) {
|
||||||
|
haptic_info.subactionPath = subaction_path;
|
||||||
|
CHECK_XR(xrStopHapticFeedback(session, &haptic_info),
|
||||||
|
(std::string("Failed to stop haptic action \"") + action_name + "\".").data());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,6 +536,19 @@ void *GHOST_XrActionSet::getCustomdata()
|
|||||||
return m_custom_data_->custom_data_;
|
return m_custom_data_->custom_data_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t GHOST_XrActionSet::getActionCount() const
|
||||||
|
{
|
||||||
|
return (uint32_t)m_actions.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GHOST_XrActionSet::getActionCustomdataArray(void **r_customdata_array)
|
||||||
|
{
|
||||||
|
uint32_t i = 0;
|
||||||
|
for (auto &[name, action] : m_actions) {
|
||||||
|
r_customdata_array[i++] = action.getCustomdata();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GHOST_XrActionSet::getBindings(
|
void GHOST_XrActionSet::getBindings(
|
||||||
std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const
|
std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const
|
||||||
{
|
{
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
* \ingroup GHOST
|
* \ingroup GHOST
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Note: Requires OpenXR headers to be included before this one for OpenXR types (XrSpace, XrPath,
|
/* NOTE: Requires OpenXR headers to be included before this one for OpenXR types
|
||||||
* etc.). */
|
* (XrSpace, XrPath, etc.). */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
@@ -34,38 +34,53 @@
|
|||||||
class GHOST_XrActionSpace {
|
class GHOST_XrActionSpace {
|
||||||
public:
|
public:
|
||||||
GHOST_XrActionSpace() = delete; /* Default constructor for map storage. */
|
GHOST_XrActionSpace() = delete; /* Default constructor for map storage. */
|
||||||
GHOST_XrActionSpace(XrInstance instance,
|
GHOST_XrActionSpace(XrSession session,
|
||||||
XrSession session,
|
|
||||||
XrAction action,
|
XrAction action,
|
||||||
const GHOST_XrActionSpaceInfo &info,
|
const char *action_name,
|
||||||
uint32_t subaction_idx);
|
const char *profile_path,
|
||||||
|
XrPath subaction_path,
|
||||||
|
const char *subaction_path_str,
|
||||||
|
const GHOST_XrPose &pose);
|
||||||
~GHOST_XrActionSpace();
|
~GHOST_XrActionSpace();
|
||||||
|
|
||||||
XrSpace getSpace() const;
|
XrSpace getSpace() const;
|
||||||
const XrPath &getSubactionPath() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XrSpace m_space = XR_NULL_HANDLE;
|
XrSpace m_space = XR_NULL_HANDLE;
|
||||||
XrPath m_subaction_path = XR_NULL_PATH;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
typedef struct GHOST_XrSubactionData {
|
||||||
|
XrPath subaction_path = XR_NULL_PATH;
|
||||||
|
float float_threshold;
|
||||||
|
int16_t axis_flag;
|
||||||
|
std::unique_ptr<GHOST_XrActionSpace> space = nullptr;
|
||||||
|
} GHOST_XrSubactionData;
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
|
||||||
class GHOST_XrActionProfile {
|
class GHOST_XrActionProfile {
|
||||||
public:
|
public:
|
||||||
GHOST_XrActionProfile() = delete; /* Default constructor for map storage. */
|
GHOST_XrActionProfile() = delete; /* Default constructor for map storage. */
|
||||||
GHOST_XrActionProfile(XrInstance instance,
|
GHOST_XrActionProfile(XrInstance instance,
|
||||||
|
XrSession session,
|
||||||
XrAction action,
|
XrAction action,
|
||||||
const char *profile_path,
|
GHOST_XrActionType type,
|
||||||
const GHOST_XrActionBindingInfo &info);
|
const GHOST_XrActionProfileInfo &info);
|
||||||
~GHOST_XrActionProfile() = default;
|
~GHOST_XrActionProfile() = default;
|
||||||
|
|
||||||
|
XrPath getProfile() const;
|
||||||
|
const GHOST_XrSubactionData *getSubaction(XrPath subaction_path) const;
|
||||||
void getBindings(XrAction action,
|
void getBindings(XrAction action,
|
||||||
std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XrPath m_profile = XR_NULL_PATH;
|
XrPath m_profile = XR_NULL_PATH;
|
||||||
/* Bindings identified by interaction (user (subaction) + component) path. */
|
|
||||||
|
/** Sub-action data identified by user `subaction` path. */
|
||||||
|
std::map<std::string, GHOST_XrSubactionData> m_subaction_data;
|
||||||
|
/** Bindings identified by interaction (user `subaction` + component) path. */
|
||||||
std::map<std::string, XrPath> m_bindings;
|
std::map<std::string, XrPath> m_bindings;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,12 +92,9 @@ class GHOST_XrAction {
|
|||||||
GHOST_XrAction(XrInstance instance, XrActionSet action_set, const GHOST_XrActionInfo &info);
|
GHOST_XrAction(XrInstance instance, XrActionSet action_set, const GHOST_XrActionInfo &info);
|
||||||
~GHOST_XrAction();
|
~GHOST_XrAction();
|
||||||
|
|
||||||
bool createSpace(XrInstance instance, XrSession session, const GHOST_XrActionSpaceInfo &info);
|
|
||||||
void destroySpace(const char *subaction_path);
|
|
||||||
|
|
||||||
bool createBinding(XrInstance instance,
|
bool createBinding(XrInstance instance,
|
||||||
const char *profile_path,
|
XrSession session,
|
||||||
const GHOST_XrActionBindingInfo &info);
|
const GHOST_XrActionProfileInfo &info);
|
||||||
void destroyBinding(const char *profile_path);
|
void destroyBinding(const char *profile_path);
|
||||||
|
|
||||||
void updateState(XrSession session,
|
void updateState(XrSession session,
|
||||||
@@ -91,26 +103,31 @@ class GHOST_XrAction {
|
|||||||
const XrTime &predicted_display_time);
|
const XrTime &predicted_display_time);
|
||||||
void applyHapticFeedback(XrSession session,
|
void applyHapticFeedback(XrSession session,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path,
|
||||||
const int64_t &duration,
|
const int64_t &duration,
|
||||||
const float &frequency,
|
const float &frequency,
|
||||||
const float &litude);
|
const float &litude);
|
||||||
void stopHapticFeedback(XrSession session, const char *action_name);
|
void stopHapticFeedback(XrSession session, const char *action_name, const char **subaction_path);
|
||||||
|
|
||||||
void *getCustomdata();
|
void *getCustomdata();
|
||||||
void getBindings(std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
void getBindings(std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
using SubactionIndexMap = std::map<std::string, uint32_t>;
|
||||||
|
|
||||||
XrAction m_action = XR_NULL_HANDLE;
|
XrAction m_action = XR_NULL_HANDLE;
|
||||||
GHOST_XrActionType m_type;
|
GHOST_XrActionType m_type;
|
||||||
|
SubactionIndexMap m_subaction_indices;
|
||||||
std::vector<XrPath> m_subaction_paths;
|
std::vector<XrPath> m_subaction_paths;
|
||||||
/** States for each subaction path. */
|
/** States for each subaction path. */
|
||||||
void *m_states;
|
void *m_states;
|
||||||
|
/** Input thresholds/regions for each subaction path. */
|
||||||
|
float *m_float_thresholds;
|
||||||
|
int16_t *m_axis_flags;
|
||||||
|
|
||||||
std::unique_ptr<GHOST_C_CustomDataWrapper> m_custom_data_ = nullptr; /* wmXrAction */
|
std::unique_ptr<GHOST_C_CustomDataWrapper> m_custom_data_ = nullptr; /* wmXrAction */
|
||||||
|
|
||||||
/* Spaces identified by user (subaction) path. */
|
/** Profiles identified by interaction profile path. */
|
||||||
std::map<std::string, GHOST_XrActionSpace> m_spaces;
|
|
||||||
/* Profiles identified by interaction profile path. */
|
|
||||||
std::map<std::string, GHOST_XrActionProfile> m_profiles;
|
std::map<std::string, GHOST_XrActionProfile> m_profiles;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -132,6 +149,8 @@ class GHOST_XrActionSet {
|
|||||||
|
|
||||||
XrActionSet getActionSet() const;
|
XrActionSet getActionSet() const;
|
||||||
void *getCustomdata();
|
void *getCustomdata();
|
||||||
|
uint32_t getActionCount() const;
|
||||||
|
void getActionCustomdataArray(void **r_customdata_array);
|
||||||
void getBindings(std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
void getBindings(std::map<XrPath, std::vector<XrActionSuggestedBinding>> &r_bindings) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -610,57 +610,6 @@ void GHOST_XrSession::destroyActions(const char *action_set_name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GHOST_XrSession::createActionSpaces(const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos)
|
|
||||||
{
|
|
||||||
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
|
||||||
if (action_set == nullptr) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
XrInstance instance = m_context->getInstance();
|
|
||||||
XrSession session = m_oxr->session;
|
|
||||||
|
|
||||||
for (uint32_t action_idx = 0; action_idx < count; ++action_idx) {
|
|
||||||
const GHOST_XrActionSpaceInfo &info = infos[action_idx];
|
|
||||||
|
|
||||||
GHOST_XrAction *action = action_set->findAction(info.action_name);
|
|
||||||
if (action == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!action->createSpace(instance, session, info)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GHOST_XrSession::destroyActionSpaces(const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos)
|
|
||||||
{
|
|
||||||
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
|
||||||
if (action_set == nullptr) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uint32_t action_idx = 0; action_idx < count; ++action_idx) {
|
|
||||||
const GHOST_XrActionSpaceInfo &info = infos[action_idx];
|
|
||||||
|
|
||||||
GHOST_XrAction *action = action_set->findAction(info.action_name);
|
|
||||||
if (action == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uint32_t subaction_idx = 0; subaction_idx < info.count_subaction_paths; ++subaction_idx) {
|
|
||||||
action->destroySpace(info.subaction_paths[subaction_idx]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GHOST_XrSession::createActionBindings(const char *action_set_name,
|
bool GHOST_XrSession::createActionBindings(const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos)
|
const GHOST_XrActionProfileInfo *infos)
|
||||||
@@ -671,21 +620,17 @@ bool GHOST_XrSession::createActionBindings(const char *action_set_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
XrInstance instance = m_context->getInstance();
|
XrInstance instance = m_context->getInstance();
|
||||||
|
XrSession session = m_oxr->session;
|
||||||
|
|
||||||
for (uint32_t profile_idx = 0; profile_idx < count; ++profile_idx) {
|
for (uint32_t profile_idx = 0; profile_idx < count; ++profile_idx) {
|
||||||
const GHOST_XrActionProfileInfo &info = infos[profile_idx];
|
const GHOST_XrActionProfileInfo &info = infos[profile_idx];
|
||||||
const char *profile_path = info.profile_path;
|
|
||||||
|
|
||||||
for (uint32_t binding_idx = 0; binding_idx < info.count_bindings; ++binding_idx) {
|
GHOST_XrAction *action = action_set->findAction(info.action_name);
|
||||||
const GHOST_XrActionBindingInfo &binding = info.bindings[binding_idx];
|
if (action == nullptr) {
|
||||||
|
continue;
|
||||||
GHOST_XrAction *action = action_set->findAction(binding.action_name);
|
|
||||||
if (action == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
action->createBinding(instance, profile_path, binding);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action->createBinding(instance, session, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -693,27 +638,21 @@ bool GHOST_XrSession::createActionBindings(const char *action_set_name,
|
|||||||
|
|
||||||
void GHOST_XrSession::destroyActionBindings(const char *action_set_name,
|
void GHOST_XrSession::destroyActionBindings(const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos)
|
const char *const *action_names,
|
||||||
|
const char *const *profile_paths)
|
||||||
{
|
{
|
||||||
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
||||||
if (action_set == nullptr) {
|
if (action_set == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t profile_idx = 0; profile_idx < count; ++profile_idx) {
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
const GHOST_XrActionProfileInfo &info = infos[profile_idx];
|
GHOST_XrAction *action = action_set->findAction(action_names[i]);
|
||||||
const char *profile_path = info.profile_path;
|
if (action == nullptr) {
|
||||||
|
continue;
|
||||||
for (uint32_t binding_idx = 0; binding_idx < info.count_bindings; ++binding_idx) {
|
|
||||||
const GHOST_XrActionBindingInfo &binding = info.bindings[binding_idx];
|
|
||||||
|
|
||||||
GHOST_XrAction *action = action_set->findAction(binding.action_name);
|
|
||||||
if (action == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
action->destroyBinding(profile_path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action->destroyBinding(profile_paths[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,6 +754,7 @@ bool GHOST_XrSession::syncActions(const char *action_set_name)
|
|||||||
|
|
||||||
bool GHOST_XrSession::applyHapticAction(const char *action_set_name,
|
bool GHOST_XrSession::applyHapticAction(const char *action_set_name,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path,
|
||||||
const int64_t &duration,
|
const int64_t &duration,
|
||||||
const float &frequency,
|
const float &frequency,
|
||||||
const float &litude)
|
const float &litude)
|
||||||
@@ -829,12 +769,15 @@ bool GHOST_XrSession::applyHapticAction(const char *action_set_name,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
action->applyHapticFeedback(m_oxr->session, action_name, duration, frequency, amplitude);
|
action->applyHapticFeedback(
|
||||||
|
m_oxr->session, action_name, subaction_path, duration, frequency, amplitude);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_XrSession::stopHapticAction(const char *action_set_name, const char *action_name)
|
void GHOST_XrSession::stopHapticAction(const char *action_set_name,
|
||||||
|
const char *action_name,
|
||||||
|
const char **subaction_path)
|
||||||
{
|
{
|
||||||
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
||||||
if (action_set == nullptr) {
|
if (action_set == nullptr) {
|
||||||
@@ -846,7 +789,7 @@ void GHOST_XrSession::stopHapticAction(const char *action_set_name, const char *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
action->stopHapticFeedback(m_oxr->session, action_name);
|
action->stopHapticFeedback(m_oxr->session, action_name, subaction_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *GHOST_XrSession::getActionSetCustomdata(const char *action_set_name)
|
void *GHOST_XrSession::getActionSetCustomdata(const char *action_set_name)
|
||||||
@@ -874,4 +817,25 @@ void *GHOST_XrSession::getActionCustomdata(const char *action_set_name, const ch
|
|||||||
return action->getCustomdata();
|
return action->getCustomdata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t GHOST_XrSession::getActionCount(const char *action_set_name)
|
||||||
|
{
|
||||||
|
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
||||||
|
if (action_set == nullptr) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return action_set->getActionCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GHOST_XrSession::getActionCustomdataArray(const char *action_set_name,
|
||||||
|
void **r_customdata_array)
|
||||||
|
{
|
||||||
|
GHOST_XrActionSet *action_set = find_action_set(m_oxr.get(), action_set_name);
|
||||||
|
if (action_set == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
action_set->getActionCustomdataArray(r_customdata_array);
|
||||||
|
}
|
||||||
|
|
||||||
/** \} */ /* Actions */
|
/** \} */ /* Actions */
|
||||||
|
@@ -60,18 +60,13 @@ class GHOST_XrSession {
|
|||||||
void destroyActions(const char *action_set_name,
|
void destroyActions(const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const char *const *action_names);
|
const char *const *action_names);
|
||||||
bool createActionSpaces(const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos);
|
|
||||||
void destroyActionSpaces(const char *action_set_name,
|
|
||||||
uint32_t count,
|
|
||||||
const GHOST_XrActionSpaceInfo *infos);
|
|
||||||
bool createActionBindings(const char *action_set_name,
|
bool createActionBindings(const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos);
|
const GHOST_XrActionProfileInfo *infos);
|
||||||
void destroyActionBindings(const char *action_set_name,
|
void destroyActionBindings(const char *action_set_name,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const GHOST_XrActionProfileInfo *infos);
|
const char *const *action_names,
|
||||||
|
const char *const *profile_paths);
|
||||||
bool attachActionSets();
|
bool attachActionSets();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,14 +76,19 @@ class GHOST_XrSession {
|
|||||||
bool syncActions(const char *action_set_name = nullptr);
|
bool syncActions(const char *action_set_name = nullptr);
|
||||||
bool applyHapticAction(const char *action_set_name,
|
bool applyHapticAction(const char *action_set_name,
|
||||||
const char *action_name,
|
const char *action_name,
|
||||||
|
const char **subaction_path,
|
||||||
const int64_t &duration,
|
const int64_t &duration,
|
||||||
const float &frequency,
|
const float &frequency,
|
||||||
const float &litude);
|
const float &litude);
|
||||||
void stopHapticAction(const char *action_set_name, const char *action_name);
|
void stopHapticAction(const char *action_set_name,
|
||||||
|
const char *action_name,
|
||||||
|
const char **subaction_path);
|
||||||
|
|
||||||
/* Custom data (owned by Blender, not GHOST) accessors. */
|
/* Custom data (owned by Blender, not GHOST) accessors. */
|
||||||
void *getActionSetCustomdata(const char *action_set_name);
|
void *getActionSetCustomdata(const char *action_set_name);
|
||||||
void *getActionCustomdata(const char *action_set_name, const char *action_name);
|
void *getActionCustomdata(const char *action_set_name, const char *action_name);
|
||||||
|
uint32_t getActionCount(const char *action_set_name);
|
||||||
|
void getActionCustomdataArray(const char *action_set_name, void **r_customdata_array);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Pointer back to context managing this session. Would be nice to avoid, but needed to access
|
/** Pointer back to context managing this session. Would be nice to avoid, but needed to access
|
||||||
|
@@ -299,9 +299,9 @@ template<class T> class MEM_CacheLimiter {
|
|||||||
if (!can_destroy_element(elem))
|
if (!can_destroy_element(elem))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* by default 0 means highest priority element */
|
/* By default 0 means highest priority element. */
|
||||||
/* casting a size type to int is questionable,
|
/* Casting a size type to int is questionable,
|
||||||
but unlikely to cause problems */
|
* but unlikely to cause problems. */
|
||||||
int priority = -((int)(queue.size()) - i - 1);
|
int priority = -((int)(queue.size()) - i - 1);
|
||||||
priority = item_priority_func(elem->get()->get_data(), priority);
|
priority = item_priority_func(elem->get()->get_data(), priority);
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
set(INC
|
set(INC
|
||||||
.
|
.
|
||||||
intern
|
|
||||||
../guardedalloc
|
../guardedalloc
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,14 +41,7 @@ if(WITH_OPENVDB)
|
|||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND SRC
|
list(APPEND SRC
|
||||||
intern/openvdb_level_set.cc
|
|
||||||
intern/openvdb_transform.cc
|
|
||||||
openvdb_capi.cc
|
openvdb_capi.cc
|
||||||
openvdb_util.cc
|
|
||||||
|
|
||||||
intern/openvdb_level_set.h
|
|
||||||
intern/openvdb_transform.h
|
|
||||||
openvdb_util.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND LIB
|
list(APPEND LIB
|
||||||
|
@@ -1,176 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
|
||||||
* All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "openvdb_level_set.h"
|
|
||||||
#include "MEM_guardedalloc.h"
|
|
||||||
#include "openvdb/tools/Composite.h"
|
|
||||||
#include "openvdb_capi.h"
|
|
||||||
#include "openvdb_util.h"
|
|
||||||
|
|
||||||
OpenVDBLevelSet::OpenVDBLevelSet()
|
|
||||||
{
|
|
||||||
openvdb::initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenVDBLevelSet::~OpenVDBLevelSet()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet::mesh_to_level_set(const float *vertices,
|
|
||||||
const unsigned int *faces,
|
|
||||||
const unsigned int totvertices,
|
|
||||||
const unsigned int totfaces,
|
|
||||||
const openvdb::math::Transform::Ptr &xform)
|
|
||||||
{
|
|
||||||
std::vector<openvdb::Vec3s> points(totvertices);
|
|
||||||
std::vector<openvdb::Vec3I> triangles(totfaces);
|
|
||||||
std::vector<openvdb::Vec4I> quads;
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < totvertices; i++) {
|
|
||||||
points[i] = openvdb::Vec3s(vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < totfaces; i++) {
|
|
||||||
triangles[i] = openvdb::Vec3I(faces[i * 3], faces[i * 3 + 1], faces[i * 3 + 2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->grid = openvdb::tools::meshToLevelSet<openvdb::FloatGrid>(
|
|
||||||
*xform, points, triangles, quads, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet::volume_to_mesh(OpenVDBVolumeToMeshData *mesh,
|
|
||||||
const double isovalue,
|
|
||||||
const double adaptivity,
|
|
||||||
const bool relax_disoriented_triangles)
|
|
||||||
{
|
|
||||||
std::vector<openvdb::Vec3s> out_points;
|
|
||||||
std::vector<openvdb::Vec4I> out_quads;
|
|
||||||
std::vector<openvdb::Vec3I> out_tris;
|
|
||||||
openvdb::tools::volumeToMesh<openvdb::FloatGrid>(*this->grid,
|
|
||||||
out_points,
|
|
||||||
out_tris,
|
|
||||||
out_quads,
|
|
||||||
isovalue,
|
|
||||||
adaptivity,
|
|
||||||
relax_disoriented_triangles);
|
|
||||||
mesh->vertices = (float *)MEM_malloc_arrayN(
|
|
||||||
out_points.size(), 3 * sizeof(float), "openvdb remesher out verts");
|
|
||||||
mesh->quads = (unsigned int *)MEM_malloc_arrayN(
|
|
||||||
out_quads.size(), 4 * sizeof(unsigned int), "openvdb remesh out quads");
|
|
||||||
mesh->triangles = NULL;
|
|
||||||
if (out_tris.size() > 0) {
|
|
||||||
mesh->triangles = (unsigned int *)MEM_malloc_arrayN(
|
|
||||||
out_tris.size(), 3 * sizeof(unsigned int), "openvdb remesh out tris");
|
|
||||||
}
|
|
||||||
|
|
||||||
mesh->totvertices = out_points.size();
|
|
||||||
mesh->tottriangles = out_tris.size();
|
|
||||||
mesh->totquads = out_quads.size();
|
|
||||||
|
|
||||||
for (size_t i = 0; i < out_points.size(); i++) {
|
|
||||||
mesh->vertices[i * 3] = out_points[i].x();
|
|
||||||
mesh->vertices[i * 3 + 1] = out_points[i].y();
|
|
||||||
mesh->vertices[i * 3 + 2] = out_points[i].z();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < out_quads.size(); i++) {
|
|
||||||
mesh->quads[i * 4] = out_quads[i].x();
|
|
||||||
mesh->quads[i * 4 + 1] = out_quads[i].y();
|
|
||||||
mesh->quads[i * 4 + 2] = out_quads[i].z();
|
|
||||||
mesh->quads[i * 4 + 3] = out_quads[i].w();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < out_tris.size(); i++) {
|
|
||||||
mesh->triangles[i * 3] = out_tris[i].x();
|
|
||||||
mesh->triangles[i * 3 + 1] = out_tris[i].y();
|
|
||||||
mesh->triangles[i * 3 + 2] = out_tris[i].z();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet::filter(OpenVDBLevelSet_FilterType filter_type,
|
|
||||||
int width,
|
|
||||||
float distance,
|
|
||||||
OpenVDBLevelSet_FilterBias filter_bias)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!this->grid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->grid->getGridClass() != openvdb::GRID_LEVEL_SET) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
openvdb::tools::LevelSetFilter<openvdb::FloatGrid> filter(*this->grid);
|
|
||||||
filter.setSpatialScheme((openvdb::math::BiasedGradientScheme)filter_bias);
|
|
||||||
switch (filter_type) {
|
|
||||||
case OPENVDB_LEVELSET_FILTER_GAUSSIAN:
|
|
||||||
filter.gaussian(width);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_MEDIAN:
|
|
||||||
filter.median(width);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_MEAN:
|
|
||||||
filter.mean(width);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_MEAN_CURVATURE:
|
|
||||||
filter.meanCurvature();
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_LAPLACIAN:
|
|
||||||
filter.laplacian();
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_DILATE:
|
|
||||||
filter.offset(distance);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_ERODE:
|
|
||||||
filter.offset(distance);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_FILTER_NONE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
openvdb::FloatGrid::Ptr OpenVDBLevelSet::CSG_operation_apply(
|
|
||||||
const openvdb::FloatGrid::Ptr &gridA,
|
|
||||||
const openvdb::FloatGrid::Ptr &gridB,
|
|
||||||
OpenVDBLevelSet_CSGOperation operation)
|
|
||||||
{
|
|
||||||
switch (operation) {
|
|
||||||
case OPENVDB_LEVELSET_CSG_UNION:
|
|
||||||
openvdb::tools::csgUnion(*gridA, *gridB);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_CSG_DIFFERENCE:
|
|
||||||
openvdb::tools::csgDifference(*gridA, *gridB);
|
|
||||||
break;
|
|
||||||
case OPENVDB_LEVELSET_CSG_INTERSECTION:
|
|
||||||
openvdb::tools::csgIntersection(*gridA, *gridB);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return gridA;
|
|
||||||
}
|
|
||||||
|
|
||||||
const openvdb::FloatGrid::Ptr &OpenVDBLevelSet::get_grid()
|
|
||||||
{
|
|
||||||
return this->grid;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet::set_grid(const openvdb::FloatGrid::Ptr &grid)
|
|
||||||
{
|
|
||||||
this->grid = grid;
|
|
||||||
}
|
|
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* The Original Code is Copyright (C) 2015 Blender Foundation.
|
|
||||||
* All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __OPENVDB_LEVEL_SET_H__
|
|
||||||
#define __OPENVDB_LEVEL_SET_H__
|
|
||||||
|
|
||||||
#include "openvdb_capi.h"
|
|
||||||
#include <openvdb/math/FiniteDifference.h>
|
|
||||||
#include <openvdb/openvdb.h>
|
|
||||||
#include <openvdb/tools/GridTransformer.h>
|
|
||||||
#include <openvdb/tools/LevelSetFilter.h>
|
|
||||||
#include <openvdb/tools/MeshToVolume.h>
|
|
||||||
#include <openvdb/tools/VolumeToMesh.h>
|
|
||||||
|
|
||||||
struct OpenVDBLevelSet {
|
|
||||||
private:
|
|
||||||
openvdb::FloatGrid::Ptr grid;
|
|
||||||
|
|
||||||
public:
|
|
||||||
OpenVDBLevelSet();
|
|
||||||
~OpenVDBLevelSet();
|
|
||||||
const openvdb::FloatGrid::Ptr &get_grid();
|
|
||||||
void set_grid(const openvdb::FloatGrid::Ptr &grid);
|
|
||||||
|
|
||||||
void mesh_to_level_set(const float *vertices,
|
|
||||||
const unsigned int *faces,
|
|
||||||
const unsigned int totvertices,
|
|
||||||
const unsigned int totfaces,
|
|
||||||
const openvdb::math::Transform::Ptr &transform);
|
|
||||||
|
|
||||||
void volume_to_mesh(struct OpenVDBVolumeToMeshData *mesh,
|
|
||||||
const double isovalue,
|
|
||||||
const double adaptivity,
|
|
||||||
const bool relax_disoriented_triangles);
|
|
||||||
void filter(OpenVDBLevelSet_FilterType filter_type,
|
|
||||||
int width,
|
|
||||||
float distance,
|
|
||||||
OpenVDBLevelSet_FilterBias filter_bias);
|
|
||||||
openvdb::FloatGrid::Ptr CSG_operation_apply(const openvdb::FloatGrid::Ptr &gridA,
|
|
||||||
const openvdb::FloatGrid::Ptr &gridB,
|
|
||||||
OpenVDBLevelSet_CSGOperation operation);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* __OPENVDB_LEVEL_SET_H__ */
|
|
@@ -18,151 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "openvdb_capi.h"
|
#include "openvdb_capi.h"
|
||||||
#include "openvdb_level_set.h"
|
#include <openvdb/openvdb.h>
|
||||||
#include "openvdb_transform.h"
|
|
||||||
#include "openvdb_util.h"
|
|
||||||
|
|
||||||
int OpenVDB_getVersionHex()
|
int OpenVDB_getVersionHex()
|
||||||
{
|
{
|
||||||
return openvdb::OPENVDB_LIBRARY_VERSION;
|
return openvdb::OPENVDB_LIBRARY_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenVDBLevelSet *OpenVDBLevelSet_create(bool initGrid, OpenVDBTransform *xform)
|
|
||||||
{
|
|
||||||
OpenVDBLevelSet *level_set = new OpenVDBLevelSet();
|
|
||||||
if (initGrid) {
|
|
||||||
openvdb::FloatGrid::Ptr grid = openvdb::FloatGrid::create();
|
|
||||||
grid->setGridClass(openvdb::GRID_LEVEL_SET);
|
|
||||||
if (xform) {
|
|
||||||
grid->setTransform(xform->get_transform());
|
|
||||||
}
|
|
||||||
level_set->set_grid(grid);
|
|
||||||
}
|
|
||||||
return level_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenVDBTransform *OpenVDBTransform_create()
|
|
||||||
{
|
|
||||||
return new OpenVDBTransform();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBTransform_free(OpenVDBTransform *transform)
|
|
||||||
{
|
|
||||||
delete transform;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBTransform_create_linear_transform(OpenVDBTransform *transform, double voxel_size)
|
|
||||||
{
|
|
||||||
transform->create_linear_transform(voxel_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_free(OpenVDBLevelSet *level_set)
|
|
||||||
{
|
|
||||||
delete level_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_mesh_to_level_set(struct OpenVDBLevelSet *level_set,
|
|
||||||
const float *vertices,
|
|
||||||
const unsigned int *faces,
|
|
||||||
const unsigned int totvertices,
|
|
||||||
const unsigned int totfaces,
|
|
||||||
OpenVDBTransform *xform)
|
|
||||||
{
|
|
||||||
level_set->mesh_to_level_set(vertices, faces, totvertices, totfaces, xform->get_transform());
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_mesh_to_level_set_transform(struct OpenVDBLevelSet *level_set,
|
|
||||||
const float *vertices,
|
|
||||||
const unsigned int *faces,
|
|
||||||
const unsigned int totvertices,
|
|
||||||
const unsigned int totfaces,
|
|
||||||
OpenVDBTransform *transform)
|
|
||||||
{
|
|
||||||
level_set->mesh_to_level_set(vertices, faces, totvertices, totfaces, transform->get_transform());
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_volume_to_mesh(struct OpenVDBLevelSet *level_set,
|
|
||||||
struct OpenVDBVolumeToMeshData *mesh,
|
|
||||||
const double isovalue,
|
|
||||||
const double adaptivity,
|
|
||||||
const bool relax_disoriented_triangles)
|
|
||||||
{
|
|
||||||
level_set->volume_to_mesh(mesh, isovalue, adaptivity, relax_disoriented_triangles);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_filter(struct OpenVDBLevelSet *level_set,
|
|
||||||
OpenVDBLevelSet_FilterType filter_type,
|
|
||||||
int width,
|
|
||||||
float distance,
|
|
||||||
OpenVDBLevelSet_FilterBias bias)
|
|
||||||
{
|
|
||||||
level_set->filter(filter_type, width, distance, bias);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVDBLevelSet_CSG_operation(struct OpenVDBLevelSet *out,
|
|
||||||
struct OpenVDBLevelSet *gridA,
|
|
||||||
struct OpenVDBLevelSet *gridB,
|
|
||||||
OpenVDBLevelSet_CSGOperation operation)
|
|
||||||
{
|
|
||||||
openvdb::FloatGrid::Ptr grid = out->CSG_operation_apply(
|
|
||||||
gridA->get_grid(), gridB->get_grid(), operation);
|
|
||||||
out->set_grid(grid);
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenVDBLevelSet *OpenVDBLevelSet_transform_and_resample(struct OpenVDBLevelSet *level_setA,
|
|
||||||
struct OpenVDBLevelSet *level_setB,
|
|
||||||
char sampler,
|
|
||||||
float isolevel)
|
|
||||||
{
|
|
||||||
openvdb::FloatGrid::Ptr sourceGrid = level_setA->get_grid();
|
|
||||||
openvdb::FloatGrid::Ptr targetGrid = level_setB->get_grid()->deepCopy();
|
|
||||||
|
|
||||||
const openvdb::math::Transform &sourceXform = sourceGrid->transform(),
|
|
||||||
&targetXform = targetGrid->transform();
|
|
||||||
|
|
||||||
// Compute a source grid to target grid transform.
|
|
||||||
// (For this example, we assume that both grids' transforms are linear,
|
|
||||||
// so that they can be represented as 4 x 4 matrices.)
|
|
||||||
openvdb::Mat4R xform = sourceXform.baseMap()->getAffineMap()->getMat4() *
|
|
||||||
targetXform.baseMap()->getAffineMap()->getMat4().inverse();
|
|
||||||
|
|
||||||
// Create the transformer.
|
|
||||||
openvdb::tools::GridTransformer transformer(xform);
|
|
||||||
|
|
||||||
switch (sampler) {
|
|
||||||
case OPENVDB_LEVELSET_GRIDSAMPLER_POINT:
|
|
||||||
// Resample using nearest-neighbor interpolation.
|
|
||||||
transformer.transformGrid<openvdb::tools::PointSampler, openvdb::FloatGrid>(*sourceGrid,
|
|
||||||
*targetGrid);
|
|
||||||
// Prune the target tree for optimal sparsity.
|
|
||||||
targetGrid->tree().prune();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPENVDB_LEVELSET_GRIDSAMPLER_BOX:
|
|
||||||
// Resample using trilinear interpolation.
|
|
||||||
transformer.transformGrid<openvdb::tools::BoxSampler, openvdb::FloatGrid>(*sourceGrid,
|
|
||||||
*targetGrid);
|
|
||||||
// Prune the target tree for optimal sparsity.
|
|
||||||
targetGrid->tree().prune();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPENVDB_LEVELSET_GRIDSAMPLER_QUADRATIC:
|
|
||||||
// Resample using triquadratic interpolation.
|
|
||||||
transformer.transformGrid<openvdb::tools::QuadraticSampler, openvdb::FloatGrid>(*sourceGrid,
|
|
||||||
*targetGrid);
|
|
||||||
// Prune the target tree for optimal sparsity.
|
|
||||||
targetGrid->tree().prune();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OPENVDB_LEVELSET_GRIDSAMPLER_NONE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
targetGrid = openvdb::tools::levelSetRebuild(*targetGrid, isolevel, 1.0f);
|
|
||||||
openvdb::tools::pruneLevelSet(targetGrid->tree());
|
|
||||||
|
|
||||||
OpenVDBLevelSet *level_set = OpenVDBLevelSet_create(false, NULL);
|
|
||||||
level_set->set_grid(targetGrid);
|
|
||||||
|
|
||||||
return level_set;
|
|
||||||
}
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user