Compare commits
15 Commits
tmp-overla
...
blender-v2
Author | SHA1 | Date | |
---|---|---|---|
f1aa4d18d4 | |||
96f6520734 | |||
4a440ecb99 | |||
bdfcee347e | |||
60e817693c | |||
73ce35d332 | |||
6334f97093 | |||
3a344a61e8 | |||
2ccc52a7f1 | |||
893c29c15c | |||
54bff9dc89 | |||
c14b164e8a | |||
26bd5ebd42 | |||
e8b0a13c31 | |||
ab1b02e389 |
22
.github/stale.yml
vendored
22
.github/stale.yml
vendored
@@ -1,22 +0,0 @@
|
|||||||
# Configuration for probot-stale - https://github.com/probot/stale
|
|
||||||
# This file is used on Blender's GitHub mirror to automatically close any pull request
|
|
||||||
# and invite contributors to join the official development platform on blender.org
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 1
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
daysUntilClose: 1
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: stale
|
|
||||||
|
|
||||||
# Comment to post when closing a stale Issue or Pull Request.
|
|
||||||
closeComment: >
|
|
||||||
This issue has been automatically closed, because this repository is only
|
|
||||||
used as a mirror of git.blender.org. Blender development happens on
|
|
||||||
developer.blender.org.
|
|
||||||
|
|
||||||
To get started contributing code, please read:
|
|
||||||
https://wiki.blender.org/wiki/Process/Contributing_Code
|
|
125
CMakeLists.txt
125
CMakeLists.txt
@@ -130,6 +130,68 @@ endif()
|
|||||||
get_blender_version()
|
get_blender_version()
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Platform Specific Defaults
|
||||||
|
|
||||||
|
# list of var-names
|
||||||
|
set(_init_vars)
|
||||||
|
|
||||||
|
# initialize to ON
|
||||||
|
macro(option_defaults_init)
|
||||||
|
foreach(_var ${ARGV})
|
||||||
|
set(${_var} ON)
|
||||||
|
list(APPEND _init_vars "${_var}")
|
||||||
|
endforeach()
|
||||||
|
unset(_var)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# remove from namespace
|
||||||
|
macro(option_defaults_clear)
|
||||||
|
foreach(_var ${_init_vars})
|
||||||
|
unset(${_var})
|
||||||
|
endforeach()
|
||||||
|
unset(_var)
|
||||||
|
unset(_init_vars)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
# values to initialize WITH_****
|
||||||
|
option_defaults_init(
|
||||||
|
_init_BUILDINFO
|
||||||
|
_init_CODEC_FFMPEG
|
||||||
|
_init_CYCLES_OSL
|
||||||
|
_init_IMAGE_OPENEXR
|
||||||
|
_init_INPUT_NDOF
|
||||||
|
_init_JACK
|
||||||
|
_init_OPENCOLLADA
|
||||||
|
_init_OPENCOLORIO
|
||||||
|
_init_SDL
|
||||||
|
_init_FFTW3
|
||||||
|
_init_OPENSUBDIV
|
||||||
|
)
|
||||||
|
|
||||||
|
# customize...
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
# some of these libraries are problematic on Linux
|
||||||
|
# disable less important dependencies by default
|
||||||
|
set(_init_CODEC_FFMPEG OFF)
|
||||||
|
set(_init_CYCLES_OSL OFF)
|
||||||
|
set(_init_IMAGE_OPENEXR OFF)
|
||||||
|
set(_init_JACK OFF)
|
||||||
|
set(_init_OPENCOLLADA OFF)
|
||||||
|
set(_init_OPENCOLORIO OFF)
|
||||||
|
set(_init_SDL OFF)
|
||||||
|
set(_init_FFTW3 OFF)
|
||||||
|
set(_init_OPENSUBDIV OFF)
|
||||||
|
set(_init_OPENVDB OFF)
|
||||||
|
set(_init_OPENIMAGEDENOISE OFF)
|
||||||
|
elseif(WIN32)
|
||||||
|
set(_init_JACK OFF)
|
||||||
|
elseif(APPLE)
|
||||||
|
set(_init_JACK OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Options
|
# Options
|
||||||
|
|
||||||
@@ -156,7 +218,7 @@ if(APPLE)
|
|||||||
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
|
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
|
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ${_init_BUILDINFO})
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
|
if(${CMAKE_VERSION} VERSION_LESS 2.8.8)
|
||||||
# add_library OBJECT arg unsupported
|
# add_library OBJECT arg unsupported
|
||||||
set(WITH_BUILDINFO OFF)
|
set(WITH_BUILDINFO OFF)
|
||||||
@@ -170,20 +232,20 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
|
|||||||
|
|
||||||
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
|
||||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ON)
|
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ${_init_FFTW3})
|
||||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||||
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||||
mark_as_advanced(WITH_SYSTEM_BULLET)
|
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
|
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
|
||||||
|
|
||||||
# Compositor
|
# Compositor
|
||||||
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
|
||||||
option(WITH_OPENIMAGEDENOISE "Enable the OpenImageDenoise compositing node" ON)
|
option(WITH_OPENIMAGEDENOISE "Enable the OpenImageDenoise compositing node" ${_init_OPENIMAGEDENOISE})
|
||||||
|
|
||||||
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ON)
|
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ${_init_OPENSUBDIV})
|
||||||
|
|
||||||
option(WITH_OPENVDB "Enable features relying on OpenVDB" ON)
|
option(WITH_OPENVDB "Enable features relying on OpenVDB" ${_init_OPENVDB})
|
||||||
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ON)
|
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ${_init_OPENVDB})
|
||||||
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
|
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
|
||||||
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
||||||
|
|
||||||
@@ -245,11 +307,13 @@ endif()
|
|||||||
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
|
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
|
||||||
option(WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON)
|
option(WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON)
|
||||||
option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
|
option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
|
||||||
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" ON)
|
# option(WITH_MOD_CLOTH_ELTOPO "Enable Experimental cloth solver" OFF) # this is now only available in a branch
|
||||||
|
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
|
||||||
|
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
|
||||||
|
|
||||||
# Image format support
|
# Image format support
|
||||||
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
|
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
|
||||||
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ${_init_IMAGE_OPENEXR})
|
||||||
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
|
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
|
||||||
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
||||||
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
||||||
@@ -258,25 +322,23 @@ option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
|||||||
|
|
||||||
# Audio/Video format support
|
# Audio/Video format support
|
||||||
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
|
||||||
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ON)
|
option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${_init_CODEC_FFMPEG})
|
||||||
option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" ON)
|
option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
|
||||||
|
|
||||||
# Alembic support
|
# Alembic support
|
||||||
option(WITH_ALEMBIC "Enable Alembic Support" ON)
|
option(WITH_ALEMBIC "Enable Alembic Support" OFF)
|
||||||
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
|
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
|
||||||
|
|
||||||
# 3D format support
|
# 3D format support
|
||||||
# Disable opencollada when we don't have precompiled libs
|
# Disable opencollada when we don't have precompiled libs
|
||||||
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
|
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA})
|
||||||
|
|
||||||
# Sound output
|
# Sound output
|
||||||
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
option(WITH_SDL "Enable SDL for sound and joystick support" ${_init_SDL})
|
||||||
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||||
if(NOT WIN32)
|
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ${_init_JACK})
|
||||||
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ON)
|
if(UNIX AND NOT APPLE)
|
||||||
if(UNIX AND NOT APPLE)
|
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
|
||||||
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
|
option(WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF)
|
||||||
@@ -292,7 +354,7 @@ option(WITH_DRACO "Enable Draco mesh compression Python module (used for
|
|||||||
|
|
||||||
# Camera/motion tracking
|
# Camera/motion tracking
|
||||||
option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
|
option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
|
||||||
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ON)
|
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF)
|
||||||
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||||
|
|
||||||
# Logging/unbit test libraries.
|
# Logging/unbit test libraries.
|
||||||
@@ -308,7 +370,8 @@ option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
||||||
endif()
|
endif()
|
||||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
|
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
|
||||||
|
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
|
||||||
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
|
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
|
||||||
@@ -344,7 +407,7 @@ mark_as_advanced(WITH_CPU_SSE)
|
|||||||
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
|
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
|
||||||
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
|
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
|
||||||
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
|
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
|
||||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ON)
|
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
|
||||||
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" OFF)
|
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" OFF)
|
||||||
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
||||||
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
||||||
@@ -401,11 +464,6 @@ mark_as_advanced(WITH_ASSERT_ABORT)
|
|||||||
option(WITH_BOOST "Enable features depending on boost" ON)
|
option(WITH_BOOST "Enable features depending on boost" ON)
|
||||||
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
|
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
|
||||||
|
|
||||||
# TBB malloc is only supported on for windows currently
|
|
||||||
if(WIN32)
|
|
||||||
option(WITH_TBB_MALLOC_PROXY "Enable the TBB malloc replacement" ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Unit testsing
|
# Unit testsing
|
||||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||||
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
|
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
|
||||||
@@ -500,6 +558,15 @@ if(WIN32)
|
|||||||
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
||||||
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
|
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
|
||||||
|
|
||||||
|
option(WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF)
|
||||||
|
mark_as_advanced(WITH_WINDOWS_CODESIGN)
|
||||||
|
|
||||||
|
set(WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning.")
|
||||||
|
mark_as_advanced(WINDOWS_CODESIGN_PFX)
|
||||||
|
|
||||||
|
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
|
||||||
|
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
|
||||||
|
|
||||||
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
|
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
|
||||||
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
|
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
|
||||||
|
|
||||||
@@ -527,6 +594,9 @@ endif()
|
|||||||
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
|
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
|
||||||
mark_as_advanced(POSTINSTALL_SCRIPT)
|
mark_as_advanced(POSTINSTALL_SCRIPT)
|
||||||
|
|
||||||
|
# avoid using again
|
||||||
|
option_defaults_clear()
|
||||||
|
|
||||||
# end option(...)
|
# end option(...)
|
||||||
|
|
||||||
|
|
||||||
@@ -1728,6 +1798,7 @@ if(FIRST_RUN)
|
|||||||
info_cfg_text("Compiler Options:")
|
info_cfg_text("Compiler Options:")
|
||||||
info_cfg_option(WITH_BUILDINFO)
|
info_cfg_option(WITH_BUILDINFO)
|
||||||
info_cfg_option(WITH_OPENMP)
|
info_cfg_option(WITH_OPENMP)
|
||||||
|
info_cfg_option(WITH_RAYOPTIMIZATION)
|
||||||
|
|
||||||
info_cfg_text("System Options:")
|
info_cfg_text("System Options:")
|
||||||
info_cfg_option(WITH_INSTALL_PORTABLE)
|
info_cfg_option(WITH_INSTALL_PORTABLE)
|
||||||
|
21
GNUmakefile
21
GNUmakefile
@@ -163,8 +163,9 @@ CPU:=$(shell uname -m)
|
|||||||
BLENDER_DIR:=$(shell pwd -P)
|
BLENDER_DIR:=$(shell pwd -P)
|
||||||
BUILD_TYPE:=Release
|
BUILD_TYPE:=Release
|
||||||
|
|
||||||
# CMake arguments, assigned to local variable to make it mutable.
|
ifndef BUILD_CMAKE_ARGS
|
||||||
CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS)
|
BUILD_CMAKE_ARGS:=
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef BUILD_DIR
|
ifndef BUILD_DIR
|
||||||
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
|
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
|
||||||
@@ -212,34 +213,34 @@ ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
|
|||||||
endif
|
endif
|
||||||
ifneq "$(findstring full, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring full, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_full
|
BUILD_DIR:=$(BUILD_DIR)_full
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
|
||||||
endif
|
endif
|
||||||
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_lite
|
BUILD_DIR:=$(BUILD_DIR)_lite
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
|
||||||
endif
|
endif
|
||||||
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_cycles
|
BUILD_DIR:=$(BUILD_DIR)_cycles
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
|
||||||
endif
|
endif
|
||||||
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_headless
|
BUILD_DIR:=$(BUILD_DIR)_headless
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
|
||||||
endif
|
endif
|
||||||
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
|
||||||
BUILD_DIR:=$(BUILD_DIR)_bpy
|
BUILD_DIR:=$(BUILD_DIR)_bpy
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
|
||||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# build tool
|
# build tool
|
||||||
|
|
||||||
ifneq "$(findstring ninja, $(MAKECMDGOALS))" ""
|
ifneq "$(findstring ninja, $(MAKECMDGOALS))" ""
|
||||||
CMAKE_CONFIG_ARGS:=$(CMAKE_CONFIG_ARGS) -G Ninja
|
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -G Ninja
|
||||||
BUILD_COMMAND:=ninja
|
BUILD_COMMAND:=ninja
|
||||||
DEPS_BUILD_COMMAND:=ninja
|
DEPS_BUILD_COMMAND:=ninja
|
||||||
else
|
else
|
||||||
@@ -287,7 +288,7 @@ endif
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Macro for configuring cmake
|
# Macro for configuring cmake
|
||||||
|
|
||||||
CMAKE_CONFIG = cmake $(CMAKE_CONFIG_ARGS) \
|
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
|
||||||
-H"$(BLENDER_DIR)" \
|
-H"$(BLENDER_DIR)" \
|
||||||
-B"$(BUILD_DIR)" \
|
-B"$(BUILD_DIR)" \
|
||||||
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
|
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
|
||||||
|
@@ -40,7 +40,7 @@ set(ALEMBIC_EXTRA_ARGS
|
|||||||
-DBoost_USE_MULTITHREADED=ON
|
-DBoost_USE_MULTITHREADED=ON
|
||||||
-DUSE_STATIC_BOOST=On
|
-DUSE_STATIC_BOOST=On
|
||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=ON
|
||||||
-DBoost_DEBUG=ON
|
-DBoost_DEBUG=ON
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
@@ -29,13 +29,13 @@ if(WIN32)
|
|||||||
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
|
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
|
||||||
set(BOOST_ADDRESS_MODEL 32)
|
set(BOOST_ADDRESS_MODEL 32)
|
||||||
endif()
|
endif()
|
||||||
|
if(MSVC14)
|
||||||
set(BOOST_TOOLSET toolset=msvc-14.1)
|
set(BOOST_TOOLSET toolset=msvc-14.0)
|
||||||
set(BOOST_COMPILER_STRING -vc141)
|
set(BOOST_COMPILER_STRING -vc140)
|
||||||
|
endif()
|
||||||
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
|
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
|
||||||
set(BOOST_BUILD_COMMAND bjam)
|
set(BOOST_BUILD_COMMAND bjam)
|
||||||
set(BOOST_BUILD_OPTIONS runtime-link=shared )
|
set(BOOST_BUILD_OPTIONS runtime-link=static )
|
||||||
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
|
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
|
||||||
if(BUILD_MODE STREQUAL Release)
|
if(BUILD_MODE STREQUAL Release)
|
||||||
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_68/ ${HARVEST_TARGET}/boost/include/)
|
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_68/ ${HARVEST_TARGET}/boost/include/)
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
set(CLANG_EXTRA_ARGS
|
set(CLANG_EXTRA_ARGS
|
||||||
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
|
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
|
||||||
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
|
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
|
||||||
-DLLVM_USE_CRT_RELEASE=MD
|
-DLLVM_USE_CRT_RELEASE=MT
|
||||||
-DLLVM_USE_CRT_DEBUG=MDd
|
-DLLVM_USE_CRT_DEBUG=MTd
|
||||||
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
|
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -52,7 +52,9 @@ if(BUILD_MODE STREQUAL Release)
|
|||||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
|
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
|
||||||
# hidapi
|
# hidapi
|
||||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
|
||||||
|
# webp, straight up copy
|
||||||
|
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp &&
|
||||||
DEPENDS
|
DEPENDS
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
# ***** END GPL LICENSE BLOCK *****
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
set(LLVM_EXTRA_ARGS
|
set(LLVM_EXTRA_ARGS
|
||||||
-DLLVM_USE_CRT_RELEASE=MD
|
-DLLVM_USE_CRT_RELEASE=MT
|
||||||
-DLLVM_USE_CRT_DEBUG=MDd
|
-DLLVM_USE_CRT_DEBUG=MTd
|
||||||
-DLLVM_INCLUDE_TESTS=OFF
|
-DLLVM_INCLUDE_TESTS=OFF
|
||||||
-DLLVM_TARGETS_TO_BUILD=X86
|
-DLLVM_TARGETS_TO_BUILD=X86
|
||||||
-DLLVM_INCLUDE_EXAMPLES=OFF
|
-DLLVM_INCLUDE_EXAMPLES=OFF
|
||||||
|
@@ -95,7 +95,7 @@ if(WIN32)
|
|||||||
ExternalProject_Add_Step(external_opencolorio after_install
|
ExternalProject_Add_Step(external_opencolorio after_install
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmt.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
@@ -103,7 +103,7 @@ if(WIN32)
|
|||||||
if(BUILD_MODE STREQUAL Debug)
|
if(BUILD_MODE STREQUAL Debug)
|
||||||
ExternalProject_Add_Step(external_opencolorio after_install
|
ExternalProject_Add_Step(external_opencolorio after_install
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/static/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/static/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmtd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml_d.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml_d.lib
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
|
@@ -69,7 +69,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
|||||||
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
||||||
-DBoost_USE_MULTITHREADED=ON
|
-DBoost_USE_MULTITHREADED=ON
|
||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=ON
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
@@ -41,6 +41,7 @@ if(WIN32)
|
|||||||
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
|
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
|
||||||
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
|
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
|
||||||
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
|
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
|
||||||
)
|
)
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(OPENSUBDIV_EXTRA_ARGS
|
set(OPENSUBDIV_EXTRA_ARGS
|
||||||
|
@@ -24,7 +24,7 @@ set(OPENVDB_EXTRA_ARGS
|
|||||||
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
||||||
-DBoost_USE_MULTITHREADED=ON
|
-DBoost_USE_MULTITHREADED=ON
|
||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=ON
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
||||||
|
@@ -62,22 +62,22 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
|
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
else()
|
else()
|
||||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
endif()
|
endif()
|
||||||
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
if(WITH_OPTIMIZED_DEBUG)
|
if(WITH_OPTIMIZED_DEBUG)
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
else()
|
else()
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
endif()
|
endif()
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||||
|
|
||||||
set(PLATFORM_FLAGS)
|
set(PLATFORM_FLAGS)
|
||||||
set(PLATFORM_CXX_FLAGS)
|
set(PLATFORM_CXX_FLAGS)
|
||||||
@@ -97,8 +97,8 @@ if(WIN32)
|
|||||||
|
|
||||||
set(CONFIGURE_ENV
|
set(CONFIGURE_ENV
|
||||||
cd ${MINGW_PATH} &&
|
cd ${MINGW_PATH} &&
|
||||||
call ${PERL_SHELL} &&
|
|
||||||
call ${MINGW_SHELL} &&
|
call ${MINGW_SHELL} &&
|
||||||
|
call ${PERL_SHELL} &&
|
||||||
set path &&
|
set path &&
|
||||||
set CFLAGS=-g &&
|
set CFLAGS=-g &&
|
||||||
set LDFLAGS=-Wl,--as-needed -static-libgcc
|
set LDFLAGS=-Wl,--as-needed -static-libgcc
|
||||||
|
@@ -40,7 +40,7 @@ set(OSL_EXTRA_ARGS
|
|||||||
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
|
||||||
-DBoost_USE_MULTITHREADED=ON
|
-DBoost_USE_MULTITHREADED=ON
|
||||||
-DBoost_USE_STATIC_LIBS=ON
|
-DBoost_USE_STATIC_LIBS=ON
|
||||||
-DBoost_USE_STATIC_RUNTIME=OFF
|
-DBoost_USE_STATIC_RUNTIME=ON
|
||||||
-DBOOST_ROOT=${LIBDIR}/boost
|
-DBOOST_ROOT=${LIBDIR}/boost
|
||||||
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
|
||||||
-DBoost_NO_SYSTEM_PATHS=ON
|
-DBoost_NO_SYSTEM_PATHS=ON
|
||||||
|
@@ -15,21 +15,13 @@
|
|||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# ***** END GPL LICENSE BLOCK *****
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
if(WIN32)
|
|
||||||
set(TBB_EXTRA_ARGS
|
set(TBB_EXTRA_ARGS
|
||||||
-DTBB_BUILD_SHARED=On
|
-DTBB_BUILD_SHARED=Off
|
||||||
-DTBB_BUILD_TBBMALLOC=On
|
-DTBB_BUILD_TBBMALLOC=On
|
||||||
-DTBB_BUILD_TBBMALLOC_PROXY=On
|
-DTBB_BUILD_TBBMALLOC_PROXY=Off
|
||||||
-DTBB_BUILD_STATIC=On
|
-DTBB_BUILD_STATIC=On
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
set(TBB_EXTRA_ARGS
|
|
||||||
-DTBB_BUILD_SHARED=Off
|
|
||||||
-DTBB_BUILD_TBBMALLOC=On
|
|
||||||
-DTBB_BUILD_TBBMALLOC_PROXY=Off
|
|
||||||
-DTBB_BUILD_STATIC=On
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
|
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
|
||||||
ExternalProject_Add(external_tbb
|
ExternalProject_Add(external_tbb
|
||||||
@@ -47,10 +39,6 @@ if(WIN32)
|
|||||||
if(BUILD_MODE STREQUAL Release)
|
if(BUILD_MODE STREQUAL Release)
|
||||||
ExternalProject_Add_Step(external_tbb after_install
|
ExternalProject_Add_Step(external_tbb after_install
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.dll
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
@@ -58,9 +46,6 @@ if(WIN32)
|
|||||||
if(BUILD_MODE STREQUAL Debug)
|
if(BUILD_MODE STREQUAL Debug)
|
||||||
ExternalProject_Add_Step(external_tbb after_install
|
ExternalProject_Add_Step(external_tbb after_install
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
|
|
||||||
DEPENDEES install
|
DEPENDEES install
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -86,9 +86,9 @@ set(HDF5_VERSION 1.8.17)
|
|||||||
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
|
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
|
||||||
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
|
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
|
||||||
|
|
||||||
set(ALEMBIC_VERSION 1.7.12)
|
set(ALEMBIC_VERSION 1.7.8)
|
||||||
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
|
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
|
||||||
set(ALEMBIC_MD5 e2b3777f23c5c09481a008cc6f0f8a40)
|
set(ALEMBIC_MD5 d095c2feb5e183b824904db7b63c1d30)
|
||||||
|
|
||||||
# hash is for 3.1.2
|
# hash is for 3.1.2
|
||||||
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
|
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
|
||||||
@@ -149,9 +149,9 @@ set(PYTHON_SHORT_VERSION_NO_DOTS 37)
|
|||||||
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
|
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
|
||||||
set(PYTHON_HASH d33e4aae66097051c2eca45ee3604803)
|
set(PYTHON_HASH d33e4aae66097051c2eca45ee3604803)
|
||||||
|
|
||||||
set(TBB_VERSION 2019_U9)
|
set(TBB_VERSION 2018_U5)
|
||||||
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
|
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
|
||||||
set(TBB_HASH 584edbec127c508f2cd5b6e79ad200fc)
|
set(TBB_HASH ff3ae09f8c23892fbc3008c39f78288f)
|
||||||
|
|
||||||
set(OPENVDB_VERSION 5.1.0)
|
set(OPENVDB_VERSION 5.1.0)
|
||||||
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
||||||
@@ -263,9 +263,9 @@ set(TINYXML_VERSION_DOTS 2.6.2)
|
|||||||
set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
|
set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
|
||||||
set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
|
set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
|
||||||
|
|
||||||
set(YAMLCPP_VERSION 0.6.3)
|
set(YAMLCPP_VERSION 0.6.2)
|
||||||
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
|
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
|
||||||
set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
|
set(YAMLCPP_HASH 5b943e9af0060d0811148b037449ef82)
|
||||||
|
|
||||||
set(LCMS_VERSION 2.9)
|
set(LCMS_VERSION 2.9)
|
||||||
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
|
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
|
||||||
|
@@ -39,12 +39,3 @@ ExternalProject_Add(external_webp
|
|||||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
|
||||||
INSTALL_DIR ${LIBDIR}/webp
|
INSTALL_DIR ${LIBDIR}/webp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
if(BUILD_MODE STREQUAL Release)
|
|
||||||
ExternalProject_Add_Step(external_webp after_install
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp
|
|
||||||
DEPENDEES install
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
@@ -21,7 +21,7 @@ set(YAMLCPP_EXTRA_ARGS
|
|||||||
-DYAML_CPP_BUILD_TESTS=OFF
|
-DYAML_CPP_BUILD_TESTS=OFF
|
||||||
-DYAML_CPP_BUILD_TOOLS=OFF
|
-DYAML_CPP_BUILD_TOOLS=OFF
|
||||||
-DYAML_CPP_BUILD_CONTRIB=OFF
|
-DYAML_CPP_BUILD_CONTRIB=OFF
|
||||||
-DYAML_MSVC_SHARED_RT=ON
|
-DMSVC_SHARED_RT=OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Add(external_yamlcpp
|
ExternalProject_Add(external_yamlcpp
|
||||||
|
@@ -388,7 +388,7 @@ OPENVDB_FORCE_REBUILD=false
|
|||||||
OPENVDB_SKIP=false
|
OPENVDB_SKIP=false
|
||||||
|
|
||||||
# Alembic needs to be compiled for now
|
# Alembic needs to be compiled for now
|
||||||
ALEMBIC_VERSION="1.7.12"
|
ALEMBIC_VERSION="1.7.8"
|
||||||
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
|
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
|
||||||
ALEMBIC_FORCE_BUILD=false
|
ALEMBIC_FORCE_BUILD=false
|
||||||
ALEMBIC_FORCE_REBUILD=false
|
ALEMBIC_FORCE_REBUILD=false
|
||||||
|
@@ -43,34 +43,3 @@ index 1f9a3ee..d151e9a 100644
|
|||||||
return isnan( value );
|
return isnan( value );
|
||||||
#else
|
#else
|
||||||
return std::isnan(value);
|
return std::isnan(value);
|
||||||
diff --git a/DAEValidator/CMakeLists.txt b/DAEValidator/CMakeLists.txt
|
|
||||||
index 03ad540f..f7d05cfb 100644
|
|
||||||
--- a/DAEValidator/CMakeLists.txt
|
|
||||||
+++ b/DAEValidator/CMakeLists.txt
|
|
||||||
@@ -98,7 +98,7 @@ if (WIN32)
|
|
||||||
# C4710: 'function' : function not inlined
|
|
||||||
# C4711: function 'function' selected for inline expansion
|
|
||||||
# C4820: 'bytes' bytes padding added after construct 'member_name'
|
|
||||||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Wall /WX /wd4505 /wd4514 /wd4592 /wd4710 /wd4711 /wd4820")
|
|
||||||
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Wall /wd4505 /wd4514 /wd4592 /wd4710 /wd4711 /wd4820")
|
|
||||||
else ()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
|
|
||||||
endif ()
|
|
||||||
diff --git a/DAEValidator/library/src/ArgumentParser.cpp b/DAEValidator/library/src/ArgumentParser.cpp
|
|
||||||
index 897e4dcf..98a69ff1 100644
|
|
||||||
--- a/DAEValidator/library/src/ArgumentParser.cpp
|
|
||||||
+++ b/DAEValidator/library/src/ArgumentParser.cpp
|
|
||||||
@@ -6,10 +6,10 @@
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
-#ifdef _MSC_VER
|
|
||||||
-#define NOEXCEPT _NOEXCEPT
|
|
||||||
-#else
|
|
||||||
+#ifndef _NOEXCEPT
|
|
||||||
#define NOEXCEPT noexcept
|
|
||||||
+#else
|
|
||||||
+#define NOEXCEPT _NOEXCEPT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace opencollada
|
|
||||||
|
@@ -24,7 +24,7 @@ from pathlib import Path
|
|||||||
#
|
#
|
||||||
# This is how long buildbot packing step will wait signing server to
|
# This is how long buildbot packing step will wait signing server to
|
||||||
# perform signing.
|
# perform signing.
|
||||||
TIMEOUT_IN_SECONDS = 240
|
TIMEOUT_IN_SECONDS = 120
|
||||||
|
|
||||||
# Directory which is shared across buildbot worker and signing server.
|
# Directory which is shared across buildbot worker and signing server.
|
||||||
#
|
#
|
||||||
|
@@ -64,7 +64,7 @@ def create_buildbot_upload_zip(builder, package_files):
|
|||||||
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def create_tar_xz(src, dest, package_name):
|
def create_tar_bz2(src, dest, package_name):
|
||||||
# One extra to remove leading os.sep when cleaning root for package_root
|
# One extra to remove leading os.sep when cleaning root for package_root
|
||||||
ln = len(src) + 1
|
ln = len(src) + 1
|
||||||
flist = list()
|
flist = list()
|
||||||
@@ -75,20 +75,9 @@ def create_tar_xz(src, dest, package_name):
|
|||||||
flist.extend([(os.path.join(root, file), os.path.join(package_root, file)) for file in files])
|
flist.extend([(os.path.join(root, file), os.path.join(package_root, file)) for file in files])
|
||||||
|
|
||||||
import tarfile
|
import tarfile
|
||||||
|
package = tarfile.open(dest, 'w:bz2')
|
||||||
# Set UID/GID of archived files to 0, otherwise they'd be owned by whatever
|
|
||||||
# user compiled the package. If root then unpacks it to /usr/local/ you get
|
|
||||||
# a security issue.
|
|
||||||
def _fakeroot(tarinfo):
|
|
||||||
tarinfo.gid = 0
|
|
||||||
tarinfo.gname = "root"
|
|
||||||
tarinfo.uid = 0
|
|
||||||
tarinfo.uname = "root"
|
|
||||||
return tarinfo
|
|
||||||
|
|
||||||
package = tarfile.open(dest, 'w:xz', preset=9)
|
|
||||||
for entry in flist:
|
for entry in flist:
|
||||||
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
package.add(entry[0], entry[1], recursive=False)
|
||||||
package.close()
|
package.close()
|
||||||
|
|
||||||
def cleanup_files(dirpath, extension):
|
def cleanup_files(dirpath, extension):
|
||||||
@@ -174,11 +163,11 @@ def pack_linux(builder):
|
|||||||
# Construct package name
|
# Construct package name
|
||||||
platform_name = 'linux-' + blender_glibc + '-' + blender_arch
|
platform_name = 'linux-' + blender_glibc + '-' + blender_arch
|
||||||
package_name = get_package_name(builder, platform_name)
|
package_name = get_package_name(builder, platform_name)
|
||||||
package_filename = package_name + ".tar.xz"
|
package_filename = package_name + ".tar.bz2"
|
||||||
|
|
||||||
print("Creating .tar.xz archive")
|
print("Creating .tar.bz2 archive")
|
||||||
package_filepath = builder.install_dir + '.tar.xz'
|
package_filepath = builder.install_dir + '.tar.bz2'
|
||||||
create_tar_xz(builder.install_dir, package_filepath, package_name)
|
create_tar_bz2(builder.install_dir, package_filepath, package_name)
|
||||||
|
|
||||||
# Create buildbot_upload.zip
|
# Create buildbot_upload.zip
|
||||||
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
|
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
|
||||||
|
@@ -12,14 +12,9 @@
|
|||||||
#
|
#
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
macro(BLENDER_SRC_GTEST_EX)
|
macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
|
||||||
if(WITH_GTESTS)
|
if(WITH_GTESTS)
|
||||||
set(options SKIP_ADD_TEST)
|
set(TARGET_NAME ${NAME}_test)
|
||||||
set(oneValueArgs NAME)
|
|
||||||
set(multiValueArgs SRC EXTRA_LIBS COMMAND_ARGS)
|
|
||||||
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
||||||
|
|
||||||
set(TARGET_NAME ${ARG_NAME}_test)
|
|
||||||
get_property(_current_include_directories
|
get_property(_current_include_directories
|
||||||
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
PROPERTY INCLUDE_DIRECTORIES)
|
PROPERTY INCLUDE_DIRECTORIES)
|
||||||
@@ -35,11 +30,11 @@ macro(BLENDER_SRC_GTEST_EX)
|
|||||||
)
|
)
|
||||||
unset(_current_include_directories)
|
unset(_current_include_directories)
|
||||||
|
|
||||||
add_executable(${TARGET_NAME} ${ARG_SRC})
|
add_executable(${TARGET_NAME} ${SRC})
|
||||||
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
|
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
|
||||||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
|
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
|
||||||
target_link_libraries(${TARGET_NAME}
|
target_link_libraries(${TARGET_NAME}
|
||||||
${ARG_EXTRA_LIBS}
|
${EXTRA_LIBS}
|
||||||
${PLATFORM_LINKLIBS}
|
${PLATFORM_LINKLIBS}
|
||||||
bf_testing_main
|
bf_testing_main
|
||||||
bf_intern_eigen
|
bf_intern_eigen
|
||||||
@@ -65,11 +60,8 @@ macro(BLENDER_SRC_GTEST_EX)
|
|||||||
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
|
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
|
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}")
|
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}")
|
||||||
if(NOT ARG_SKIP_ADD_TEST)
|
if(${DO_ADD_TEST})
|
||||||
add_test(
|
add_test(NAME ${TARGET_NAME} COMMAND ${TESTS_OUTPUT_DIR}/${TARGET_NAME} WORKING_DIRECTORY ${TEST_INSTALL_DIR})
|
||||||
NAME ${TARGET_NAME}
|
|
||||||
COMMAND ${TESTS_OUTPUT_DIR}/${TARGET_NAME} ${ARG_COMMAND_ARGS}
|
|
||||||
WORKING_DIRECTORY ${TEST_INSTALL_DIR})
|
|
||||||
|
|
||||||
# Don't fail tests on leaks since these often happen in external libraries
|
# Don't fail tests on leaks since these often happen in external libraries
|
||||||
# that we can't fix.
|
# that we can't fix.
|
||||||
@@ -82,23 +74,13 @@ macro(BLENDER_SRC_GTEST_EX)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
|
macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
|
||||||
BLENDER_SRC_GTEST_EX(
|
BLENDER_SRC_GTEST_EX("${NAME}" "${SRC}" "${EXTRA_LIBS}" "TRUE")
|
||||||
NAME "${NAME}"
|
|
||||||
SRC "${SRC}"
|
|
||||||
EXTRA_LIBS "${EXTRA_LIBS}")
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(BLENDER_TEST NAME EXTRA_LIBS)
|
macro(BLENDER_TEST NAME EXTRA_LIBS)
|
||||||
BLENDER_SRC_GTEST_EX(
|
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "TRUE")
|
||||||
NAME "${NAME}"
|
|
||||||
SRC "${NAME}_test.cc"
|
|
||||||
EXTRA_LIBS "${EXTRA_LIBS}")
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(BLENDER_TEST_PERFORMANCE NAME EXTRA_LIBS)
|
macro(BLENDER_TEST_PERFORMANCE NAME EXTRA_LIBS)
|
||||||
BLENDER_SRC_GTEST_EX(
|
BLENDER_SRC_GTEST_EX("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}" "FALSE")
|
||||||
NAME "${NAME}"
|
|
||||||
SRC "${NAME}_test.cc"
|
|
||||||
EXTRA_LIBS "${EXTRA_LIBS}"
|
|
||||||
SKIP_ADD_TEST)
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@@ -18,6 +18,7 @@ set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||||
@@ -28,6 +29,7 @@ set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
||||||
@@ -45,19 +47,23 @@ set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_TBB ON CACHE BOOL "" FORCE)
|
set(WITH_TBB ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
|
||||||
# platform dependent options
|
# platform dependent options
|
||||||
if(NOT WIN32)
|
|
||||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
elseif(WIN32)
|
||||||
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
elseif(APPLE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -24,6 +24,7 @@ set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
|||||||
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||||
@@ -51,11 +52,8 @@ set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
|
|||||||
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
|
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
|
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_TBB OFF CACHE BOOL "" FORCE)
|
set(WITH_TBB OFF CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
|
||||||
if(UNIX AND NOT APPLE)
|
set(WITH_X11_XF86VMODE OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
|
|
||||||
set(WITH_X11_XF86VMODE OFF CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
|
||||||
|
@@ -19,6 +19,7 @@ set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||||
@@ -29,6 +30,7 @@ set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
||||||
@@ -46,8 +48,11 @@ set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
|||||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_TBB ON CACHE BOOL "" FORCE)
|
set(WITH_TBB ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
||||||
|
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
||||||
@@ -56,12 +61,13 @@ set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm
|
|||||||
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
|
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
# platform dependent options
|
# platform dependent options
|
||||||
if(NOT WIN32)
|
|
||||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
||||||
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
|
elseif(WIN32)
|
||||||
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
|
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||||
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
|
elseif(APPLE)
|
||||||
|
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
# include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -396,7 +396,6 @@ endfunction()
|
|||||||
|
|
||||||
macro(setup_platform_linker_flags)
|
macro(setup_platform_linker_flags)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
@@ -406,15 +405,12 @@ function(setup_liblinks
|
|||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
|
||||||
|
|
||||||
# jemalloc must be early in the list, to be before pthread (see T57998)
|
# jemalloc must be early in the list, to be before pthread (see T57998)
|
||||||
if(WITH_MEM_JEMALLOC)
|
if(WITH_MEM_JEMALLOC)
|
||||||
@@ -534,6 +530,9 @@ function(setup_liblinks
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_MOD_CLOTH_ELTOPO)
|
||||||
|
target_link_libraries(${target} ${LAPACK_LIBRARIES})
|
||||||
|
endif()
|
||||||
if(WITH_LLVM)
|
if(WITH_LLVM)
|
||||||
target_link_libraries(${target} ${LLVM_LIBRARY})
|
target_link_libraries(${target} ${LLVM_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
@@ -1228,6 +1227,29 @@ macro(openmp_delayload
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(WINDOWS_SIGN_TARGET target)
|
||||||
|
if(WITH_WINDOWS_CODESIGN)
|
||||||
|
if(!SIGNTOOL_EXE)
|
||||||
|
error("Codesigning is enabled, but signtool is not found")
|
||||||
|
else()
|
||||||
|
if(WINDOWS_CODESIGN_PFX_PASSWORD)
|
||||||
|
set(CODESIGNPASSWORD /p ${WINDOWS_CODESIGN_PFX_PASSWORD})
|
||||||
|
else()
|
||||||
|
if($ENV{PFXPASSWORD})
|
||||||
|
set(CODESIGNPASSWORD /p $ENV{PFXPASSWORD})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
add_custom_command(TARGET ${target}
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${SIGNTOOL_EXE} sign /f ${WINDOWS_CODESIGN_PFX} ${CODESIGNPASSWORD} $<TARGET_FILE:${target}>
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
macro(blender_precompile_headers target cpp header)
|
macro(blender_precompile_headers target cpp header)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# get the name for the pch output file
|
# get the name for the pch output file
|
||||||
|
@@ -135,7 +135,7 @@ elseif(UNIX)
|
|||||||
|
|
||||||
add_package_archive(
|
add_package_archive(
|
||||||
"${PROJECT_NAME}-${BLENDER_VERSION}-${BUILD_REV}-${PACKAGE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}"
|
"${PROJECT_NAME}-${BLENDER_VERSION}-${BUILD_REV}-${PACKAGE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}"
|
||||||
"tar.xz")
|
"tar.bz2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
unset(MAJOR_VERSION)
|
unset(MAJOR_VERSION)
|
||||||
|
@@ -151,14 +151,14 @@ else()
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /ZI")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd /ZI")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
|
||||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
|
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
|
||||||
|
|
||||||
# JMC is available on msvc 15.8 (1915) and up
|
# JMC is available on msvc 15.8 (1915) and up
|
||||||
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
||||||
@@ -166,8 +166,7 @@ if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
|
||||||
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
|
||||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
|
|
||||||
|
|
||||||
# Ignore meaningless for us linker warnings.
|
# Ignore meaningless for us linker warnings.
|
||||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
|
||||||
@@ -179,6 +178,8 @@ else()
|
|||||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
|
||||||
|
|
||||||
if(NOT DEFINED LIBDIR)
|
if(NOT DEFINED LIBDIR)
|
||||||
|
|
||||||
# Setup 64bit and 64bit windows systems
|
# Setup 64bit and 64bit windows systems
|
||||||
@@ -191,19 +192,22 @@ if(NOT DEFINED LIBDIR)
|
|||||||
# Can be 1910..1912
|
# Can be 1910..1912
|
||||||
if(MSVC_VERSION GREATER 1919)
|
if(MSVC_VERSION GREATER 1919)
|
||||||
message(STATUS "Visual Studio 2019 detected.")
|
message(STATUS "Visual Studio 2019 detected.")
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
|
||||||
elseif(MSVC_VERSION GREATER 1909)
|
elseif(MSVC_VERSION GREATER 1909)
|
||||||
message(STATUS "Visual Studio 2017 detected.")
|
message(STATUS "Visual Studio 2017 detected.")
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
|
||||||
elseif(MSVC_VERSION EQUAL 1900)
|
elseif(MSVC_VERSION EQUAL 1900)
|
||||||
message(STATUS "Visual Studio 2015 detected.")
|
message(STATUS "Visual Studio 2015 detected.")
|
||||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
|
||||||
|
else()
|
||||||
|
message(STATUS "Visual Studio 2013 detected.")
|
||||||
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc12)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||||
endif()
|
endif()
|
||||||
if(NOT EXISTS "${LIBDIR}/")
|
if(NOT EXISTS "${LIBDIR}/")
|
||||||
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
|
message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
||||||
@@ -393,8 +397,8 @@ if(WITH_BOOST)
|
|||||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||||
set(BOOST_LIBPATH ${BOOST}/lib)
|
set(BOOST_LIBPATH ${BOOST}/lib)
|
||||||
if(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
set(BOOST_POSTFIX "vc141-mt-x64-1_68.lib")
|
set(BOOST_POSTFIX "vc140-mt-s-x64-1_68.lib")
|
||||||
set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-1_68.lib")
|
set(BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x64-1_68.lib")
|
||||||
endif()
|
endif()
|
||||||
set(BOOST_LIBRARIES
|
set(BOOST_LIBRARIES
|
||||||
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
|
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
|
||||||
@@ -499,12 +503,8 @@ if(WITH_OPENIMAGEDENOISE)
|
|||||||
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
|
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
|
||||||
set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include)
|
set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include)
|
||||||
set(OPENIMAGEDENOISE_LIBRARIES
|
set(OPENIMAGEDENOISE_LIBRARIES
|
||||||
optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib
|
optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib ${OPENIMAGEDENOISE_LIBPATH}/common.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
|
||||||
optimized ${OPENIMAGEDENOISE_LIBPATH}/common.lib
|
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib)
|
||||||
optimized ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
|
|
||||||
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib
|
|
||||||
debug ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib
|
|
||||||
debug ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib)
|
|
||||||
set(OPENIMAGEDENOISE_DEFINITIONS)
|
set(OPENIMAGEDENOISE_DEFINITIONS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -517,6 +517,17 @@ if(WITH_ALEMBIC)
|
|||||||
set(ALEMBIC_FOUND 1)
|
set(ALEMBIC_FOUND 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_MOD_CLOTH_ELTOPO)
|
||||||
|
set(LAPACK ${LIBDIR}/lapack)
|
||||||
|
# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
|
||||||
|
set(LAPACK_LIBPATH ${LAPACK}/lib)
|
||||||
|
set(LAPACK_LIBRARIES
|
||||||
|
${LIBDIR}/lapack/lib/libf2c.lib
|
||||||
|
${LIBDIR}/lapack/lib/clapack_nowrap.lib
|
||||||
|
${LIBDIR}/lapack/lib/BLAS_nowrap.lib
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_IMAGE_OPENJPEG)
|
if(WITH_IMAGE_OPENJPEG)
|
||||||
set(OPENJPEG ${LIBDIR}/openjpeg)
|
set(OPENJPEG ${LIBDIR}/openjpeg)
|
||||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
|
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
|
||||||
@@ -562,9 +573,6 @@ if(WITH_TBB)
|
|||||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
|
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
|
||||||
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
||||||
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
||||||
if(WITH_TBB_MALLOC_PROXY)
|
|
||||||
add_definitions(-DWITH_TBB_MALLOC)
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
if(WITH_OPENIMAGEDENOISE)
|
if(WITH_OPENIMAGEDENOISE)
|
||||||
message(STATUS "TBB disabled, also disabling OpenImageDenoise")
|
message(STATUS "TBB disabled, also disabling OpenImageDenoise")
|
||||||
@@ -579,6 +587,17 @@ endif()
|
|||||||
# used in many places so include globally, like OpenGL
|
# used in many places so include globally, like OpenGL
|
||||||
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
|
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
# Find signtool.
|
||||||
|
set(ProgramFilesX86_NAME "ProgramFiles(x86)") #env dislikes the ( )
|
||||||
|
find_program(SIGNTOOL_EXE signtool
|
||||||
|
HINTS
|
||||||
|
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/10/bin/x86/"
|
||||||
|
"$ENV{ProgramFiles}/Windows Kits/10/bin/x86/"
|
||||||
|
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.1/bin/x86/"
|
||||||
|
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86/"
|
||||||
|
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.0/bin/x86/"
|
||||||
|
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86/"
|
||||||
|
)
|
||||||
set(WINTAB_INC ${LIBDIR}/wintab/include)
|
set(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||||
|
|
||||||
if(WITH_OPENAL)
|
if(WITH_OPENAL)
|
||||||
@@ -601,6 +620,10 @@ if(WITH_CODEC_SNDFILE)
|
|||||||
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
|
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||||
|
add_definitions(-D__SSE__ -D__MMX__)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_OSL)
|
if(WITH_CYCLES_OSL)
|
||||||
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
||||||
|
|
||||||
|
@@ -49,19 +49,15 @@ try:
|
|||||||
if not os.path.exists(output_dir):
|
if not os.path.exists(output_dir):
|
||||||
os.mkdir(output_dir)
|
os.mkdir(output_dir)
|
||||||
|
|
||||||
archive_env = os.environ.copy()
|
|
||||||
|
|
||||||
if extension == 'zip':
|
if extension == 'zip':
|
||||||
archive_cmd = ['zip', '-9', '-r', package_archive, package_dir]
|
archive_cmd = ['zip', '-9', '-r', package_archive, package_dir]
|
||||||
elif extension == 'tar.xz':
|
elif extension == 'tar.bz2':
|
||||||
archive_cmd = ['tar', '-cf', package_archive, '--owner=0', '--group=0',
|
archive_cmd = ['tar', 'cjf', package_archive, package_dir]
|
||||||
'--use-compress-program=xz', package_dir]
|
|
||||||
archive_env['XZ_OPT'] = '-9'
|
|
||||||
else:
|
else:
|
||||||
sys.stderr.write('Unknown archive extension: ' + extension)
|
sys.stderr.write('Unknown archive extension: ' + extension)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
subprocess.check_call(archive_cmd, env=archive_env)
|
subprocess.call(archive_cmd)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
sys.stderr.write('Failed to create package archive: ' + str(ex) + '\n')
|
sys.stderr.write('Failed to create package archive: ' + str(ex) + '\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@@ -48,7 +48,7 @@ def svn_update(args, release_version):
|
|||||||
# Windows checkout is usually handled by bat scripts since python3 to run
|
# Windows checkout is usually handled by bat scripts since python3 to run
|
||||||
# this script is bundled as part of the precompiled libraries. However it
|
# this script is bundled as part of the precompiled libraries. However it
|
||||||
# is used by the buildbot.
|
# is used by the buildbot.
|
||||||
lib_platform = "win64_vc15"
|
lib_platform = "win64_vc14"
|
||||||
elif args.use_centos_libraries:
|
elif args.use_centos_libraries:
|
||||||
lib_platform = "linux_centos7_x86_64"
|
lib_platform = "linux_centos7_x86_64"
|
||||||
else:
|
else:
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
|
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
|
||||||
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
|
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
|
||||||
|
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14
|
||||||
|
|
||||||
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
|
||||||
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
|
||||||
@@ -9,6 +10,7 @@ if NOT "%verbose%" == "" (
|
|||||||
)
|
)
|
||||||
if NOT EXIST %BUILD_VS_LIBDIR% (
|
if NOT EXIST %BUILD_VS_LIBDIR% (
|
||||||
rem libs not found, but svn is on the system
|
rem libs not found, but svn is on the system
|
||||||
|
echo
|
||||||
if not "%SVN%"=="" (
|
if not "%SVN%"=="" (
|
||||||
echo.
|
echo.
|
||||||
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
|
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
|
||||||
@@ -53,8 +55,5 @@ if NOT EXIST %BUILD_VS_LIBDIR% (
|
|||||||
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
|
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
|
||||||
echo This is needed for building, aborting!
|
echo This is needed for building, aborting!
|
||||||
echo.
|
echo.
|
||||||
if "%SVN%"=="" (
|
|
||||||
echo This is most likely caused by svn.exe not being available.
|
|
||||||
)
|
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
@@ -3,7 +3,7 @@ for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
|
|||||||
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
||||||
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
||||||
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe
|
||||||
if NOT "%verbose%" == "" (
|
if NOT "%verbose%" == "" (
|
||||||
echo svn : "%SVN%"
|
echo svn : "%SVN%"
|
||||||
echo cmake : "%CMAKE%"
|
echo cmake : "%CMAKE%"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
if EXIST %BLENDER_DIR%\..\lib\win64_vc15\llvm\bin\clang-format.exe (
|
if EXIST %BLENDER_DIR%\..\lib\win64_vc14\llvm\bin\clang-format.exe (
|
||||||
set CF_PATH=..\lib\win64_vc15\llvm\bin
|
set CF_PATH=..\lib\win64_vc14\llvm\bin
|
||||||
goto detect_done
|
goto detect_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ exit /b 1
|
|||||||
echo found clang-format in %CF_PATH%
|
echo found clang-format in %CF_PATH%
|
||||||
|
|
||||||
if EXIST %PYTHON% (
|
if EXIST %PYTHON% (
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe
|
||||||
goto detect_python_done
|
goto detect_python_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = "V2.82"
|
PROJECT_NUMBER = "V2.81"
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
|
@@ -270,6 +270,32 @@ Using ``bl_idname = 1`` will raise.
|
|||||||
``TypeError: validating class error: Operator.bl_idname expected a string type, not int``
|
``TypeError: validating class error: Operator.bl_idname expected a string type, not int``
|
||||||
|
|
||||||
|
|
||||||
|
Multiple-Classes
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Loading classes into Blender is described above,
|
||||||
|
for simple cases calling :mod:`bpy.utils.register_class` (SomeClass) is sufficient,
|
||||||
|
but when there are many classes or a packages submodule has its own
|
||||||
|
classes it can be tedious to list them all for registration.
|
||||||
|
|
||||||
|
For more convenient loading/unloading :mod:`bpy.utils.register_module` (module)
|
||||||
|
and :mod:`bpy.utils.unregister_module` (module) functions exist.
|
||||||
|
|
||||||
|
A script which defines many of its own operators, panels menus etc. you only need to write:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def register():
|
||||||
|
bpy.utils.register_module(__name__)
|
||||||
|
|
||||||
|
def unregister():
|
||||||
|
bpy.utils.unregister_module(__name__)
|
||||||
|
|
||||||
|
Internally Blender collects subclasses on registrable types, storing them by the module in which they are defined.
|
||||||
|
By passing the module name to :mod:`bpy.utils.register_module`
|
||||||
|
Blender can register all classes created by this module and its submodules.
|
||||||
|
|
||||||
|
|
||||||
Inter Classes Dependencies
|
Inter Classes Dependencies
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@@ -290,11 +316,11 @@ Say you want to store material settings for a custom engine.
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class MyMaterialProps(bpy.types.PropertyGroup):
|
class MyMaterialProps(bpy.types.PropertyGroup):
|
||||||
my_float: bpy.props.FloatProperty()
|
my_float = bpy.props.FloatProperty()
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.utils.register_class(MyMaterialProps)
|
bpy.utils.register_class(MyMaterialProps)
|
||||||
bpy.types.Material.my_custom_props: bpy.props.PointerProperty(type=MyMaterialProps)
|
bpy.types.Material.my_custom_props = bpy.props.PointerProperty(type=MyMaterialProps)
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
del bpy.types.Material.my_custom_props
|
del bpy.types.Material.my_custom_props
|
||||||
@@ -317,15 +343,15 @@ Say you want to store material settings for a custom engine.
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class MyMaterialSubProps(bpy.types.PropertyGroup):
|
class MyMaterialSubProps(bpy.types.PropertyGroup):
|
||||||
my_float: bpy.props.FloatProperty()
|
my_float = bpy.props.FloatProperty()
|
||||||
|
|
||||||
class MyMaterialGroupProps(bpy.types.PropertyGroup):
|
class MyMaterialGroupProps(bpy.types.PropertyGroup):
|
||||||
sub_group: bpy.props.PointerProperty(type=MyMaterialSubProps)
|
sub_group = bpy.props.PointerProperty(type=MyMaterialSubProps)
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.utils.register_class(MyMaterialSubProps)
|
bpy.utils.register_class(MyMaterialSubProps)
|
||||||
bpy.utils.register_class(MyMaterialGroupProps)
|
bpy.utils.register_class(MyMaterialGroupProps)
|
||||||
bpy.types.Material.my_custom_props: bpy.props.PointerProperty(type=MyMaterialGroupProps)
|
bpy.types.Material.my_custom_props = bpy.props.PointerProperty(type=MyMaterialGroupProps)
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
del bpy.types.Material.my_custom_props
|
del bpy.types.Material.my_custom_props
|
||||||
@@ -352,7 +378,7 @@ For example:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# add a new property to an existing type
|
# add a new property to an existing type
|
||||||
bpy.types.Object.my_float: bpy.props.FloatProperty()
|
bpy.types.Object.my_float = bpy.props.FloatProperty()
|
||||||
# remove
|
# remove
|
||||||
del bpy.types.Object.my_float
|
del bpy.types.Object.my_float
|
||||||
|
|
||||||
@@ -362,14 +388,14 @@ This works just as well for PropertyGroup subclasses you define yourself.
|
|||||||
|
|
||||||
class MyPropGroup(bpy.types.PropertyGroup):
|
class MyPropGroup(bpy.types.PropertyGroup):
|
||||||
pass
|
pass
|
||||||
MyPropGroup.my_float: bpy.props.FloatProperty()
|
MyPropGroup.my_float = bpy.props.FloatProperty()
|
||||||
|
|
||||||
...this is equivalent to:
|
...this is equivalent to:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
class MyPropGroup(bpy.types.PropertyGroup):
|
class MyPropGroup(bpy.types.PropertyGroup):
|
||||||
my_float: bpy.props.FloatProperty()
|
my_float = bpy.props.FloatProperty()
|
||||||
|
|
||||||
|
|
||||||
Dynamic Defined-Classes (Advanced)
|
Dynamic Defined-Classes (Advanced)
|
||||||
|
@@ -138,11 +138,10 @@ def main():
|
|||||||
"BMO_OP_SLOT_SUBTYPE_MAP_EMPTY",
|
"BMO_OP_SLOT_SUBTYPE_MAP_EMPTY",
|
||||||
"BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL",
|
"BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL",
|
||||||
|
|
||||||
"BMO_OP_SLOT_SUBTYPE_PTR_BMESH",
|
|
||||||
"BMO_OP_SLOT_SUBTYPE_PTR_SCENE",
|
"BMO_OP_SLOT_SUBTYPE_PTR_SCENE",
|
||||||
"BMO_OP_SLOT_SUBTYPE_PTR_OBJECT",
|
"BMO_OP_SLOT_SUBTYPE_PTR_OBJECT",
|
||||||
"BMO_OP_SLOT_SUBTYPE_PTR_MESH",
|
"BMO_OP_SLOT_SUBTYPE_PTR_MESH",
|
||||||
"BMO_OP_SLOT_SUBTYPE_PTR_STRUCT",
|
"BMO_OP_SLOT_SUBTYPE_PTR_BMESH",
|
||||||
|
|
||||||
"BMO_OP_SLOT_SUBTYPE_INT_ENUM",
|
"BMO_OP_SLOT_SUBTYPE_INT_ENUM",
|
||||||
"BMO_OP_SLOT_SUBTYPE_INT_FLAG",
|
"BMO_OP_SLOT_SUBTYPE_INT_FLAG",
|
||||||
@@ -346,10 +345,6 @@ def main():
|
|||||||
tp_str = ":class:`bpy.types.Object`"
|
tp_str = ":class:`bpy.types.Object`"
|
||||||
elif tp_sub == BMO_OP_SLOT_SUBTYPE_PTR_MESH:
|
elif tp_sub == BMO_OP_SLOT_SUBTYPE_PTR_MESH:
|
||||||
tp_str = ":class:`bpy.types.Mesh`"
|
tp_str = ":class:`bpy.types.Mesh`"
|
||||||
elif tp_sub == BMO_OP_SLOT_SUBTYPE_PTR_STRUCT:
|
|
||||||
# XXX Used for CurveProfile only currently I think (bevel code),
|
|
||||||
# but think the idea is that that pointer is for any type?
|
|
||||||
tp_str = ":class:`bpy.types.bpy_struct`"
|
|
||||||
else:
|
else:
|
||||||
print("Can't find", vars_dict_reverse[tp_sub])
|
print("Can't find", vars_dict_reverse[tp_sub])
|
||||||
assert(0)
|
assert(0)
|
||||||
|
5
extern/CMakeLists.txt
vendored
5
extern/CMakeLists.txt
vendored
@@ -45,6 +45,11 @@ if(WITH_DRACO)
|
|||||||
add_subdirectory(draco)
|
add_subdirectory(draco)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# now only available in a branch
|
||||||
|
# if(WITH_MOD_CLOTH_ELTOPO)
|
||||||
|
# add_subdirectory(eltopo)
|
||||||
|
# endif()
|
||||||
|
|
||||||
if(WITH_BINRELOC)
|
if(WITH_BINRELOC)
|
||||||
add_subdirectory(binreloc)
|
add_subdirectory(binreloc)
|
||||||
endif()
|
endif()
|
||||||
|
11
extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
vendored
11
extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp
vendored
@@ -292,7 +292,7 @@ int FFMPEGReader::read_packet(void* opaque, uint8_t* buf, int buf_size)
|
|||||||
{
|
{
|
||||||
FFMPEGReader* reader = reinterpret_cast<FFMPEGReader*>(opaque);
|
FFMPEGReader* reader = reinterpret_cast<FFMPEGReader*>(opaque);
|
||||||
|
|
||||||
int size = std::min(buf_size, reader->m_membuffer->getSize() - reader->m_membufferpos);
|
int size = std::min(buf_size, int(reader->m_membuffer->getSize() - reader->m_membufferpos));
|
||||||
|
|
||||||
if(size < 0)
|
if(size < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -319,14 +319,7 @@ int64_t FFMPEGReader::seek_packet(void* opaque, int64_t offset, int whence)
|
|||||||
return reader->m_membuffer->getSize();
|
return reader->m_membuffer->getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t position = reader->m_membufferpos + offset;
|
return (reader->m_membufferpos += offset);
|
||||||
|
|
||||||
if(position > reader->m_membuffer->getSize())
|
|
||||||
position = reader->m_membuffer->getSize();
|
|
||||||
|
|
||||||
reader->m_membufferpos = int(position);
|
|
||||||
|
|
||||||
return position;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FFMPEGReader::isSeekable() const
|
bool FFMPEGReader::isSeekable() const
|
||||||
|
@@ -112,7 +112,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Reading position of the buffer.
|
* Reading position of the buffer.
|
||||||
*/
|
*/
|
||||||
int m_membufferpos;
|
int64_t m_membufferpos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the audio data has to be interleaved after reading.
|
* Whether the audio data has to be interleaved after reading.
|
||||||
|
@@ -1167,8 +1167,7 @@ OpenALDevice::OpenALDevice(DeviceSpecs specs, int buffersize, std::string name)
|
|||||||
|
|
||||||
if((!m_useMC && specs.channels > CHANNELS_STEREO) ||
|
if((!m_useMC && specs.channels > CHANNELS_STEREO) ||
|
||||||
specs.channels == CHANNELS_STEREO_LFE ||
|
specs.channels == CHANNELS_STEREO_LFE ||
|
||||||
specs.channels == CHANNELS_SURROUND5 ||
|
specs.channels == CHANNELS_SURROUND5)
|
||||||
specs.channels > CHANNELS_SURROUND71)
|
|
||||||
specs.channels = CHANNELS_STEREO;
|
specs.channels = CHANNELS_STEREO;
|
||||||
|
|
||||||
alGetError();
|
alGetError();
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
AUD_NAMESPACE_BEGIN
|
AUD_NAMESPACE_BEGIN
|
||||||
|
|
||||||
@@ -98,15 +97,12 @@ void ChannelMapperReader::calculateMapping()
|
|||||||
for(int i = 0; i < m_source_channels * m_target_channels; i++)
|
for(int i = 0; i < m_source_channels * m_target_channels; i++)
|
||||||
m_mapping[i] = 0;
|
m_mapping[i] = 0;
|
||||||
|
|
||||||
const Channels source_channel_count = std::min(m_source_channels, CHANNELS_SURROUND71);
|
const Channel* source_channels = CHANNEL_MAPS[m_source_channels - 1];
|
||||||
const Channels target_channel_count = std::min(m_target_channels, CHANNELS_SURROUND71);
|
const Channel* target_channels = CHANNEL_MAPS[m_target_channels - 1];
|
||||||
|
|
||||||
const Channel* source_channels = CHANNEL_MAPS[source_channel_count - 1];
|
|
||||||
const Channel* target_channels = CHANNEL_MAPS[target_channel_count - 1];
|
|
||||||
|
|
||||||
int lfe = -1;
|
int lfe = -1;
|
||||||
|
|
||||||
for(int i = 0; i < target_channel_count; i++)
|
for(int i = 0; i < m_target_channels; i++)
|
||||||
{
|
{
|
||||||
if(target_channels[i] == CHANNEL_LFE)
|
if(target_channels[i] == CHANNEL_LFE)
|
||||||
{
|
{
|
||||||
@@ -115,16 +111,16 @@ void ChannelMapperReader::calculateMapping()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const float* source_angles = CHANNEL_ANGLES[source_channel_count - 1];
|
const float* source_angles = CHANNEL_ANGLES[m_source_channels - 1];
|
||||||
const float* target_angles = CHANNEL_ANGLES[target_channel_count - 1];
|
const float* target_angles = CHANNEL_ANGLES[m_target_channels - 1];
|
||||||
|
|
||||||
if(source_channel_count == CHANNELS_MONO)
|
if(m_source_channels == CHANNELS_MONO)
|
||||||
source_angles = &m_mono_angle;
|
source_angles = &m_mono_angle;
|
||||||
|
|
||||||
int channel_left, channel_right;
|
int channel_left, channel_right;
|
||||||
float angle_left, angle_right, angle;
|
float angle_left, angle_right, angle;
|
||||||
|
|
||||||
for(int i = 0; i < source_channel_count; i++)
|
for(int i = 0; i < m_source_channels; i++)
|
||||||
{
|
{
|
||||||
if(source_channels[i] == CHANNEL_LFE)
|
if(source_channels[i] == CHANNEL_LFE)
|
||||||
{
|
{
|
||||||
@@ -138,7 +134,7 @@ void ChannelMapperReader::calculateMapping()
|
|||||||
angle_left = -2 * M_PI;
|
angle_left = -2 * M_PI;
|
||||||
angle_right = 2 * M_PI;
|
angle_right = 2 * M_PI;
|
||||||
|
|
||||||
for(int j = 0; j < target_channel_count; j++)
|
for(int j = 0; j < m_target_channels; j++)
|
||||||
{
|
{
|
||||||
if(j == lfe)
|
if(j == lfe)
|
||||||
continue;
|
continue;
|
||||||
|
4
extern/wcwidth/README.blender
vendored
4
extern/wcwidth/README.blender
vendored
@@ -2,6 +2,4 @@ Project: WC Width
|
|||||||
URL: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
|
URL: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
|
||||||
License: ICS
|
License: ICS
|
||||||
Upstream version: 2007-05-26
|
Upstream version: 2007-05-26
|
||||||
Local modifications:
|
Local modifications: None
|
||||||
* Fix T33192
|
|
||||||
Bad encoding of utf-8 on windows systems.
|
|
||||||
|
12
extern/wcwidth/wcwidth.c
vendored
12
extern/wcwidth/wcwidth.c
vendored
@@ -59,6 +59,8 @@
|
|||||||
* Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
|
* Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
#include "wcwidth.h"
|
#include "wcwidth.h"
|
||||||
|
|
||||||
struct interval {
|
struct interval {
|
||||||
@@ -67,7 +69,7 @@ struct interval {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* auxiliary function for binary search in interval table */
|
/* auxiliary function for binary search in interval table */
|
||||||
static int bisearch(char32_t ucs, const struct interval *table, int max) {
|
static int bisearch(wchar_t ucs, const struct interval *table, int max) {
|
||||||
int min = 0;
|
int min = 0;
|
||||||
int mid;
|
int mid;
|
||||||
|
|
||||||
@@ -119,7 +121,7 @@ static int bisearch(char32_t ucs, const struct interval *table, int max) {
|
|||||||
* in ISO 10646.
|
* in ISO 10646.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int mk_wcwidth(char32_t ucs)
|
int mk_wcwidth(wchar_t ucs)
|
||||||
{
|
{
|
||||||
/* sorted list of non-overlapping intervals of non-spacing characters */
|
/* sorted list of non-overlapping intervals of non-spacing characters */
|
||||||
/* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
|
/* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
|
||||||
@@ -204,7 +206,7 @@ int mk_wcwidth(char32_t ucs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mk_wcswidth(const char32_t *pwcs, size_t n)
|
int mk_wcswidth(const wchar_t *pwcs, size_t n)
|
||||||
{
|
{
|
||||||
int w, width = 0;
|
int w, width = 0;
|
||||||
|
|
||||||
@@ -227,7 +229,7 @@ int mk_wcswidth(const char32_t *pwcs, size_t n)
|
|||||||
* the traditional terminal character-width behaviour. It is not
|
* the traditional terminal character-width behaviour. It is not
|
||||||
* otherwise recommended for general use.
|
* otherwise recommended for general use.
|
||||||
*/
|
*/
|
||||||
int mk_wcwidth_cjk(char32_t ucs)
|
int mk_wcwidth_cjk(wchar_t ucs)
|
||||||
{
|
{
|
||||||
/* sorted list of non-overlapping intervals of East Asian Ambiguous
|
/* sorted list of non-overlapping intervals of East Asian Ambiguous
|
||||||
* characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
|
* characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
|
||||||
@@ -295,7 +297,7 @@ int mk_wcwidth_cjk(char32_t ucs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int mk_wcswidth_cjk(const char32_t *pwcs, size_t n)
|
int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
|
||||||
{
|
{
|
||||||
int w, width = 0;
|
int w, width = 0;
|
||||||
|
|
||||||
|
18
extern/wcwidth/wcwidth.h
vendored
18
extern/wcwidth/wcwidth.h
vendored
@@ -20,19 +20,11 @@
|
|||||||
#ifndef __WCWIDTH_H__
|
#ifndef __WCWIDTH_H__
|
||||||
#define __WCWIDTH_H__
|
#define __WCWIDTH_H__
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#include <wchar.h>
|
||||||
# if defined(__APPLE__)
|
|
||||||
/* The <uchar.h> standard header is missing on macOS. */
|
|
||||||
#include <stddef.h>
|
|
||||||
typedef unsigned int char32_t;
|
|
||||||
# else
|
|
||||||
# include <uchar.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int mk_wcwidth(char32_t ucs);
|
int mk_wcwidth(wchar_t ucs);
|
||||||
int mk_wcswidth(const char32_t *pwcs, size_t n);
|
int mk_wcswidth(const wchar_t *pwcs, size_t n);
|
||||||
int mk_wcwidth_cjk(char32_t ucs);
|
int mk_wcwidth_cjk(wchar_t ucs);
|
||||||
int mk_wcswidth_cjk(const char32_t *pwcs, size_t n);
|
int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -80,3 +80,4 @@ endif()
|
|||||||
if(WITH_QUADRIFLOW)
|
if(WITH_QUADRIFLOW)
|
||||||
add_subdirectory(quadriflow)
|
add_subdirectory(quadriflow)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -362,9 +362,6 @@ if(WITH_OPENCOLORIO)
|
|||||||
SYSTEM
|
SYSTEM
|
||||||
${OPENCOLORIO_INCLUDE_DIRS}
|
${OPENCOLORIO_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
if(WIN32)
|
|
||||||
add_definitions(-DOpenColorIO_STATIC)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK OR WITH_CYCLES_CUBIN_COMPILER)
|
if(WITH_CYCLES_STANDALONE OR WITH_CYCLES_NETWORK OR WITH_CYCLES_CUBIN_COMPILER)
|
||||||
|
@@ -262,13 +262,13 @@ def register_passes(engine, scene, srl):
|
|||||||
|
|
||||||
if crl.use_pass_crypto_object:
|
if crl.use_pass_crypto_object:
|
||||||
for i in range(0, crl.pass_crypto_depth, 2):
|
for i in range(0, crl.pass_crypto_depth, 2):
|
||||||
engine.register_pass(scene, srl, "CryptoObject" + '{:02d}'.format(i//2), 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "CryptoObject" + '{:02d}'.format(i), 4, "RGBA", 'COLOR')
|
||||||
if crl.use_pass_crypto_material:
|
if crl.use_pass_crypto_material:
|
||||||
for i in range(0, crl.pass_crypto_depth, 2):
|
for i in range(0, crl.pass_crypto_depth, 2):
|
||||||
engine.register_pass(scene, srl, "CryptoMaterial" + '{:02d}'.format(i//2), 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "CryptoMaterial" + '{:02d}'.format(i), 4, "RGBA", 'COLOR')
|
||||||
if srl.cycles.use_pass_crypto_asset:
|
if srl.cycles.use_pass_crypto_asset:
|
||||||
for i in range(0, srl.cycles.pass_crypto_depth, 2):
|
for i in range(0, srl.cycles.pass_crypto_depth, 2):
|
||||||
engine.register_pass(scene, srl, "CryptoAsset" + '{:02d}'.format(i//2), 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "CryptoAsset" + '{:02d}'.format(i), 4, "RGBA", 'COLOR')
|
||||||
|
|
||||||
if crl.use_denoising or crl.denoising_store_passes:
|
if crl.use_denoising or crl.denoising_store_passes:
|
||||||
engine.register_pass(scene, srl, "Noisy Image", 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "Noisy Image", 4, "RGBA", 'COLOR')
|
||||||
|
@@ -29,10 +29,8 @@
|
|||||||
|
|
||||||
#include "util/util_algorithm.h"
|
#include "util/util_algorithm.h"
|
||||||
#include "util/util_foreach.h"
|
#include "util/util_foreach.h"
|
||||||
#include "util/util_hash.h"
|
|
||||||
#include "util/util_logging.h"
|
#include "util/util_logging.h"
|
||||||
#include "util/util_math.h"
|
#include "util/util_math.h"
|
||||||
#include "util/util_disjoint_set.h"
|
|
||||||
|
|
||||||
#include "mikktspace.h"
|
#include "mikktspace.h"
|
||||||
|
|
||||||
@@ -681,55 +679,6 @@ static void attr_create_pointiness(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The Random Per Island attribute is a random float associated with each
|
|
||||||
* connected component (island) of the mesh. The attribute is computed by
|
|
||||||
* first classifying the vertices into different sets using a Disjoint Set
|
|
||||||
* data structure. Then the index of the root of each vertex (Which is the
|
|
||||||
* representative of the set the vertex belongs to) is hashed and stored.
|
|
||||||
*
|
|
||||||
* We are using a face attribute to avoid interpolation during rendering,
|
|
||||||
* allowing the user to safely hash the output further. Had we used vertex
|
|
||||||
* attribute, the interpolation will introduce very slight variations,
|
|
||||||
* making the output unsafe to hash. */
|
|
||||||
static void attr_create_random_per_island(Scene *scene,
|
|
||||||
Mesh *mesh,
|
|
||||||
BL::Mesh &b_mesh,
|
|
||||||
bool subdivision)
|
|
||||||
{
|
|
||||||
if (!mesh->need_attribute(scene, ATTR_STD_RANDOM_PER_ISLAND)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int number_of_vertices = b_mesh.vertices.length();
|
|
||||||
if (number_of_vertices == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DisjointSet vertices_sets(number_of_vertices);
|
|
||||||
|
|
||||||
BL::Mesh::edges_iterator e;
|
|
||||||
for (b_mesh.edges.begin(e); e != b_mesh.edges.end(); ++e) {
|
|
||||||
vertices_sets.join(e->vertices()[0], e->vertices()[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
AttributeSet &attributes = (subdivision) ? mesh->subd_attributes : mesh->attributes;
|
|
||||||
Attribute *attribute = attributes.add(ATTR_STD_RANDOM_PER_ISLAND);
|
|
||||||
float *data = attribute->data_float();
|
|
||||||
|
|
||||||
if (!subdivision) {
|
|
||||||
BL::Mesh::loop_triangles_iterator t;
|
|
||||||
for (b_mesh.loop_triangles.begin(t); t != b_mesh.loop_triangles.end(); ++t) {
|
|
||||||
data[t->index()] = hash_uint_to_float(vertices_sets.find(t->vertices()[0]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BL::Mesh::polygons_iterator p;
|
|
||||||
for (b_mesh.polygons.begin(p); p != b_mesh.polygons.end(); ++p) {
|
|
||||||
data[p->index()] = hash_uint_to_float(vertices_sets.find(p->vertices()[0]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create Mesh */
|
/* Create Mesh */
|
||||||
|
|
||||||
static void create_mesh(Scene *scene,
|
static void create_mesh(Scene *scene,
|
||||||
@@ -850,7 +799,6 @@ static void create_mesh(Scene *scene,
|
|||||||
*/
|
*/
|
||||||
attr_create_pointiness(scene, mesh, b_mesh, subdivision);
|
attr_create_pointiness(scene, mesh, b_mesh, subdivision);
|
||||||
attr_create_vertex_color(scene, mesh, b_mesh, subdivision);
|
attr_create_vertex_color(scene, mesh, b_mesh, subdivision);
|
||||||
attr_create_random_per_island(scene, mesh, b_mesh, subdivision);
|
|
||||||
|
|
||||||
if (subdivision) {
|
if (subdivision) {
|
||||||
attr_create_subd_uv_map(scene, mesh, b_mesh, subdivide_uvs);
|
attr_create_subd_uv_map(scene, mesh, b_mesh, subdivide_uvs);
|
||||||
|
@@ -159,7 +159,7 @@ static inline void curvemapping_to_array(BL::CurveMapping &cumap, array<float> &
|
|||||||
data.resize(size);
|
data.resize(size);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
float t = (float)i / (float)(size - 1);
|
float t = (float)i / (float)(size - 1);
|
||||||
data[i] = cumap.evaluate(curve, t);
|
data[i] = curve.evaluate(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,16 +197,15 @@ static inline void curvemapping_color_to_array(BL::CurveMapping &cumap,
|
|||||||
BL::CurveMap mapI = cumap.curves[3];
|
BL::CurveMap mapI = cumap.curves[3];
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
const float t = min_x + (float)i / (float)(size - 1) * range_x;
|
const float t = min_x + (float)i / (float)(size - 1) * range_x;
|
||||||
data[i] = make_float3(cumap.evaluate(mapR, cumap.evaluate(mapI, t)),
|
data[i] = make_float3(mapR.evaluate(mapI.evaluate(t)),
|
||||||
cumap.evaluate(mapG, cumap.evaluate(mapI, t)),
|
mapG.evaluate(mapI.evaluate(t)),
|
||||||
cumap.evaluate(mapB, cumap.evaluate(mapI, t)));
|
mapB.evaluate(mapI.evaluate(t)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
float t = min_x + (float)i / (float)(size - 1) * range_x;
|
float t = min_x + (float)i / (float)(size - 1) * range_x;
|
||||||
data[i] = make_float3(
|
data[i] = make_float3(mapR.evaluate(t), mapG.evaluate(t), mapB.evaluate(t));
|
||||||
cumap.evaluate(mapR, t), cumap.evaluate(mapG, t), cumap.evaluate(mapB, t));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ void BVHOptiX::copy_to_device(Progress &progress, DeviceScene *dscene)
|
|||||||
progress.set_status("Updating Scene BVH", "Building OptiX acceleration structure");
|
progress.set_status("Updating Scene BVH", "Building OptiX acceleration structure");
|
||||||
|
|
||||||
Device *const device = dscene->bvh_nodes.device;
|
Device *const device = dscene->bvh_nodes.device;
|
||||||
if (!device->build_optix_bvh(this))
|
if (!device->build_optix_bvh(this, dscene->bvh_nodes))
|
||||||
progress.set_error("Failed to build OptiX acceleration structure");
|
progress.set_error("Failed to build OptiX acceleration structure");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -407,7 +407,7 @@ class Device {
|
|||||||
const DeviceDrawParams &draw_params);
|
const DeviceDrawParams &draw_params);
|
||||||
|
|
||||||
/* acceleration structure building */
|
/* acceleration structure building */
|
||||||
virtual bool build_optix_bvh(BVH *)
|
virtual bool build_optix_bvh(BVH *, device_memory &)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -455,12 +455,6 @@ class CUDADevice : public Device {
|
|||||||
VLOG(1) << "Using precompiled kernel.";
|
VLOG(1) << "Using precompiled kernel.";
|
||||||
return cubin;
|
return cubin;
|
||||||
}
|
}
|
||||||
const string ptx = path_get(string_printf("lib/%s_compute_%d%d.ptx", name, major, minor));
|
|
||||||
VLOG(1) << "Testing for pre-compiled kernel " << ptx << ".";
|
|
||||||
if (path_exists(ptx)) {
|
|
||||||
VLOG(1) << "Using precompiled kernel.";
|
|
||||||
return ptx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const string common_cflags = compile_kernel_get_common_cflags(
|
const string common_cflags = compile_kernel_get_common_cflags(
|
||||||
|
@@ -153,13 +153,21 @@ class MultiDevice : public Device {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool build_optix_bvh(BVH *bvh)
|
bool build_optix_bvh(BVH *bvh, device_memory &mem)
|
||||||
{
|
{
|
||||||
|
device_ptr key = unique_key++;
|
||||||
|
|
||||||
// Broadcast acceleration structure build to all devices
|
// Broadcast acceleration structure build to all devices
|
||||||
foreach (SubDevice &sub, devices) {
|
foreach (SubDevice &sub, devices) {
|
||||||
if (!sub.device->build_optix_bvh(bvh))
|
mem.device = sub.device;
|
||||||
|
if (!sub.device->build_optix_bvh(bvh, mem))
|
||||||
return false;
|
return false;
|
||||||
|
sub.ptr_map[key] = mem.device_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mem.device = this;
|
||||||
|
mem.device_pointer = key;
|
||||||
|
stats.mem_alloc(mem.device_size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -174,7 +174,7 @@ class OptiXDevice : public Device {
|
|||||||
device_vector<SbtRecord> sbt_data;
|
device_vector<SbtRecord> sbt_data;
|
||||||
device_vector<TextureInfo> texture_info;
|
device_vector<TextureInfo> texture_info;
|
||||||
device_only_memory<KernelParams> launch_params;
|
device_only_memory<KernelParams> launch_params;
|
||||||
vector<device_only_memory<uint8_t>> as_mem;
|
vector<device_only_memory<uint8_t>> blas;
|
||||||
OptixTraversableHandle tlas_handle = 0;
|
OptixTraversableHandle tlas_handle = 0;
|
||||||
|
|
||||||
// TODO(pmours): This is copied from device_cuda.cpp, so move to common code eventually
|
// TODO(pmours): This is copied from device_cuda.cpp, so move to common code eventually
|
||||||
@@ -268,8 +268,8 @@ class OptiXDevice : public Device {
|
|||||||
// Stop processing any more tasks
|
// Stop processing any more tasks
|
||||||
task_pool.stop();
|
task_pool.stop();
|
||||||
|
|
||||||
// Free all acceleration structures
|
// Clean up all memory before destroying context
|
||||||
as_mem.clear();
|
blas.clear();
|
||||||
|
|
||||||
sbt_data.free();
|
sbt_data.free();
|
||||||
texture_info.free();
|
texture_info.free();
|
||||||
@@ -290,8 +290,8 @@ class OptiXDevice : public Device {
|
|||||||
optixPipelineDestroy(pipelines[i]);
|
optixPipelineDestroy(pipelines[i]);
|
||||||
|
|
||||||
// Destroy launch streams
|
// Destroy launch streams
|
||||||
for (CUstream stream : cuda_stream)
|
for (int i = 0; i < info.cpu_threads; ++i)
|
||||||
cuStreamDestroy(stream);
|
cuStreamDestroy(cuda_stream[i]);
|
||||||
|
|
||||||
// Destroy OptiX and CUDA context
|
// Destroy OptiX and CUDA context
|
||||||
optixDeviceContextDestroy(context);
|
optixDeviceContextDestroy(context);
|
||||||
@@ -329,17 +329,16 @@ class OptiXDevice : public Device {
|
|||||||
|
|
||||||
const CUDAContextScope scope(cuda_context);
|
const CUDAContextScope scope(cuda_context);
|
||||||
|
|
||||||
// Unload existing OptiX module and pipelines first
|
// Unload any existing modules first
|
||||||
if (optix_module != NULL) {
|
if (cuda_module != NULL)
|
||||||
|
cuModuleUnload(cuda_module);
|
||||||
|
if (cuda_filter_module != NULL)
|
||||||
|
cuModuleUnload(cuda_filter_module);
|
||||||
|
if (optix_module != NULL)
|
||||||
optixModuleDestroy(optix_module);
|
optixModuleDestroy(optix_module);
|
||||||
optix_module = NULL;
|
for (unsigned int i = 0; i < NUM_PIPELINES; ++i)
|
||||||
}
|
if (pipelines[i] != NULL)
|
||||||
for (unsigned int i = 0; i < NUM_PIPELINES; ++i) {
|
|
||||||
if (pipelines[i] != NULL) {
|
|
||||||
optixPipelineDestroy(pipelines[i]);
|
optixPipelineDestroy(pipelines[i]);
|
||||||
pipelines[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
||||||
@@ -400,18 +399,16 @@ class OptiXDevice : public Device {
|
|||||||
cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num);
|
cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num);
|
||||||
cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, info.num);
|
cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, info.num);
|
||||||
|
|
||||||
if (cuda_module == NULL) { // Avoid reloading module if it was already loaded
|
string cubin_data;
|
||||||
string cubin_data;
|
const string cubin_filename = string_printf("lib/kernel_sm_%d%d.cubin", major, minor);
|
||||||
const string cubin_filename = string_printf("lib/kernel_sm_%d%d.cubin", major, minor);
|
if (!path_read_text(path_get(cubin_filename), cubin_data)) {
|
||||||
if (!path_read_text(path_get(cubin_filename), cubin_data)) {
|
set_error("Failed loading pre-compiled CUDA kernel " + cubin_filename + ".");
|
||||||
set_error("Failed loading pre-compiled CUDA kernel " + cubin_filename + ".");
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
check_result_cuda_ret(cuModuleLoadData(&cuda_module, cubin_data.data()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requested_features.use_denoising && cuda_filter_module == NULL) {
|
check_result_cuda_ret(cuModuleLoadData(&cuda_module, cubin_data.data()));
|
||||||
|
|
||||||
|
if (requested_features.use_denoising) {
|
||||||
string filter_data;
|
string filter_data;
|
||||||
const string filter_filename = string_printf("lib/filter_sm_%d%d.cubin", major, minor);
|
const string filter_filename = string_printf("lib/filter_sm_%d%d.cubin", major, minor);
|
||||||
if (!path_read_text(path_get(filter_filename), filter_data)) {
|
if (!path_read_text(path_get(filter_filename), filter_data)) {
|
||||||
@@ -881,16 +878,15 @@ class OptiXDevice : public Device {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool build_optix_bvh(BVH *bvh) override
|
bool build_optix_bvh(BVH *bvh, device_memory &out_data) override
|
||||||
{
|
{
|
||||||
assert(bvh->params.top_level);
|
assert(bvh->params.top_level);
|
||||||
|
|
||||||
unsigned int num_instances = 0;
|
unsigned int num_instances = 0;
|
||||||
unordered_map<Mesh *, vector<OptixTraversableHandle>> meshes;
|
unordered_map<Mesh *, vector<OptixTraversableHandle>> meshes;
|
||||||
meshes.reserve(bvh->meshes.size());
|
|
||||||
|
|
||||||
// Free all previous acceleration structure
|
// Clear all previous AS
|
||||||
as_mem.clear();
|
blas.clear();
|
||||||
|
|
||||||
// Build bottom level acceleration structures (BLAS)
|
// Build bottom level acceleration structures (BLAS)
|
||||||
// Note: Always keep this logic in sync with bvh_optix.cpp!
|
// Note: Always keep this logic in sync with bvh_optix.cpp!
|
||||||
@@ -901,7 +897,6 @@ class OptiXDevice : public Device {
|
|||||||
|
|
||||||
Mesh *const mesh = ob->mesh;
|
Mesh *const mesh = ob->mesh;
|
||||||
vector<OptixTraversableHandle> handles;
|
vector<OptixTraversableHandle> handles;
|
||||||
handles.reserve(2);
|
|
||||||
|
|
||||||
// Build BLAS for curve primitives
|
// Build BLAS for curve primitives
|
||||||
if (bvh->params.primitive_mask & PRIMITIVE_ALL_CURVE && mesh->num_curves() > 0) {
|
if (bvh->params.primitive_mask & PRIMITIVE_ALL_CURVE && mesh->num_curves() > 0) {
|
||||||
@@ -968,9 +963,9 @@ class OptiXDevice : public Device {
|
|||||||
build_input.aabbArray.primitiveIndexOffset = mesh->prim_offset;
|
build_input.aabbArray.primitiveIndexOffset = mesh->prim_offset;
|
||||||
|
|
||||||
// Allocate memory for new BLAS and build it
|
// Allocate memory for new BLAS and build it
|
||||||
as_mem.emplace_back(this, "blas");
|
blas.emplace_back(this, "blas");
|
||||||
handles.emplace_back();
|
handles.emplace_back();
|
||||||
if (!build_optix_bvh(build_input, num_motion_steps, as_mem.back(), handles.back()))
|
if (!build_optix_bvh(build_input, num_motion_steps, blas.back(), handles.back()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1034,9 +1029,9 @@ class OptiXDevice : public Device {
|
|||||||
build_input.triangleArray.primitiveIndexOffset = mesh->prim_offset + mesh->num_segments();
|
build_input.triangleArray.primitiveIndexOffset = mesh->prim_offset + mesh->num_segments();
|
||||||
|
|
||||||
// Allocate memory for new BLAS and build it
|
// Allocate memory for new BLAS and build it
|
||||||
as_mem.emplace_back(this, "blas");
|
blas.emplace_back(this, "blas");
|
||||||
handles.emplace_back();
|
handles.emplace_back();
|
||||||
if (!build_optix_bvh(build_input, num_motion_steps, as_mem.back(), handles.back()))
|
if (!build_optix_bvh(build_input, num_motion_steps, blas.back(), handles.back()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1048,6 @@ class OptiXDevice : public Device {
|
|||||||
// Skip non-traceable objects
|
// Skip non-traceable objects
|
||||||
if (!ob->is_traceable())
|
if (!ob->is_traceable())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Create separate instance for triangle/curve meshes of an object
|
// Create separate instance for triangle/curve meshes of an object
|
||||||
for (OptixTraversableHandle handle : meshes[ob->mesh]) {
|
for (OptixTraversableHandle handle : meshes[ob->mesh]) {
|
||||||
OptixAabb &aabb = aabbs[num_instances];
|
OptixAabb &aabb = aabbs[num_instances];
|
||||||
@@ -1081,8 +1075,8 @@ class OptiXDevice : public Device {
|
|||||||
|
|
||||||
// Insert motion traversable if object has motion
|
// Insert motion traversable if object has motion
|
||||||
if (motion_blur && ob->use_motion()) {
|
if (motion_blur && ob->use_motion()) {
|
||||||
as_mem.emplace_back(this, "motion_transform");
|
blas.emplace_back(this, "motion_transform");
|
||||||
device_only_memory<uint8_t> &motion_transform_gpu = as_mem.back();
|
device_only_memory<uint8_t> &motion_transform_gpu = blas.back();
|
||||||
motion_transform_gpu.alloc_to_device(sizeof(OptixSRTMotionTransform) +
|
motion_transform_gpu.alloc_to_device(sizeof(OptixSRTMotionTransform) +
|
||||||
(max(ob->motion.size(), 2) - 2) *
|
(max(ob->motion.size(), 2) - 2) *
|
||||||
sizeof(OptixSRTData));
|
sizeof(OptixSRTData));
|
||||||
@@ -1160,7 +1154,7 @@ class OptiXDevice : public Device {
|
|||||||
instances.resize(num_instances);
|
instances.resize(num_instances);
|
||||||
instances.copy_to_device();
|
instances.copy_to_device();
|
||||||
|
|
||||||
// Build top-level acceleration structure (TLAS)
|
// Build top-level acceleration structure
|
||||||
OptixBuildInput build_input = {};
|
OptixBuildInput build_input = {};
|
||||||
build_input.type = OPTIX_BUILD_INPUT_TYPE_INSTANCES;
|
build_input.type = OPTIX_BUILD_INPUT_TYPE_INSTANCES;
|
||||||
build_input.instanceArray.instances = instances.device_pointer;
|
build_input.instanceArray.instances = instances.device_pointer;
|
||||||
@@ -1168,8 +1162,7 @@ class OptiXDevice : public Device {
|
|||||||
build_input.instanceArray.aabbs = aabbs.device_pointer;
|
build_input.instanceArray.aabbs = aabbs.device_pointer;
|
||||||
build_input.instanceArray.numAabbs = num_instances;
|
build_input.instanceArray.numAabbs = num_instances;
|
||||||
|
|
||||||
as_mem.emplace_back(this, "tlas");
|
return build_optix_bvh(build_input, 0 /* TLAS has no motion itself */, out_data, tlas_handle);
|
||||||
return build_optix_bvh(build_input, 0, as_mem.back(), tlas_handle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_texture_info()
|
void update_texture_info()
|
||||||
|
@@ -389,20 +389,11 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
|||||||
set(cuda_cubins)
|
set(cuda_cubins)
|
||||||
|
|
||||||
macro(CYCLES_CUDA_KERNEL_ADD arch prev_arch name flags sources experimental)
|
macro(CYCLES_CUDA_KERNEL_ADD arch prev_arch name flags sources experimental)
|
||||||
if(${arch} MATCHES "compute_.*")
|
set(cuda_cubin ${name}_${arch}.cubin)
|
||||||
set(format "ptx")
|
|
||||||
else()
|
|
||||||
set(format "cubin")
|
|
||||||
endif()
|
|
||||||
set(cuda_file ${name}_${arch}.${format})
|
|
||||||
|
|
||||||
set(kernel_sources ${sources})
|
set(kernel_sources ${sources})
|
||||||
if(NOT ${prev_arch} STREQUAL "none")
|
if(NOT ${prev_arch} STREQUAL "none")
|
||||||
if(${prev_arch} MATCHES "compute_.*")
|
set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.cubin)
|
||||||
set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.ptx)
|
|
||||||
else()
|
|
||||||
set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.cubin)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(cuda_kernel_src "/kernels/cuda/${name}.cu")
|
set(cuda_kernel_src "/kernels/cuda/${name}.cu")
|
||||||
@@ -415,7 +406,7 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
|||||||
-I ${CMAKE_CURRENT_SOURCE_DIR}/..
|
-I ${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
-I ${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda
|
-I ${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda
|
||||||
--use_fast_math
|
--use_fast_math
|
||||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_file})
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin})
|
||||||
|
|
||||||
if(${experimental})
|
if(${experimental})
|
||||||
set(cuda_flags ${cuda_flags} -D __KERNEL_EXPERIMENTAL__)
|
set(cuda_flags ${cuda_flags} -D __KERNEL_EXPERIMENTAL__)
|
||||||
@@ -449,21 +440,20 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
|||||||
-v
|
-v
|
||||||
-cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}"
|
-cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||||
DEPENDS ${kernel_sources} cycles_cubin_cc)
|
DEPENDS ${kernel_sources} cycles_cubin_cc)
|
||||||
set(cuda_file ${cuda_cubin})
|
|
||||||
else()
|
else()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${cuda_file}
|
OUTPUT ${cuda_cubin}
|
||||||
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
||||||
-arch=${arch}
|
-arch=${arch}
|
||||||
${CUDA_NVCC_FLAGS}
|
${CUDA_NVCC_FLAGS}
|
||||||
--${format}
|
--cubin
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
|
${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
|
||||||
--ptxas-options="-v"
|
--ptxas-options="-v"
|
||||||
${cuda_flags}
|
${cuda_flags}
|
||||||
DEPENDS ${kernel_sources})
|
DEPENDS ${kernel_sources})
|
||||||
endif()
|
endif()
|
||||||
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_file}" ${CYCLES_INSTALL_PATH}/lib)
|
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
|
||||||
list(APPEND cuda_cubins ${cuda_file})
|
list(APPEND cuda_cubins ${cuda_cubin})
|
||||||
|
|
||||||
unset(cuda_debug_flags)
|
unset(cuda_debug_flags)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@@ -37,7 +37,6 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
typedef ccl_addr_space struct MicrofacetExtra {
|
typedef ccl_addr_space struct MicrofacetExtra {
|
||||||
float3 color, cspec0;
|
float3 color, cspec0;
|
||||||
float3 fresnel_color;
|
|
||||||
float clearcoat;
|
float clearcoat;
|
||||||
} MicrofacetExtra;
|
} MicrofacetExtra;
|
||||||
|
|
||||||
@@ -277,22 +276,6 @@ ccl_device_forceinline float D_GTR1(float NdotH, float alpha)
|
|||||||
return (alpha2 - 1.0f) / (M_PI_F * logf(alpha2) * t);
|
return (alpha2 - 1.0f) / (M_PI_F * logf(alpha2) * t);
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device_forceinline void bsdf_microfacet_fresnel_color(const ShaderData *sd,
|
|
||||||
MicrofacetBsdf *bsdf)
|
|
||||||
{
|
|
||||||
kernel_assert(CLOSURE_IS_BSDF_MICROFACET_FRESNEL(bsdf->type));
|
|
||||||
|
|
||||||
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
|
||||||
bsdf->extra->fresnel_color = interpolate_fresnel_color(
|
|
||||||
sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0);
|
|
||||||
|
|
||||||
if (bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID) {
|
|
||||||
bsdf->extra->fresnel_color *= 0.25f * bsdf->extra->clearcoat;
|
|
||||||
}
|
|
||||||
|
|
||||||
bsdf->sample_weight *= average(bsdf->extra->fresnel_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* GGX microfacet with Smith shadow-masking from:
|
/* GGX microfacet with Smith shadow-masking from:
|
||||||
*
|
*
|
||||||
* Microfacet Models for Refraction through Rough Surfaces
|
* Microfacet Models for Refraction through Rough Surfaces
|
||||||
@@ -322,13 +305,15 @@ ccl_device int bsdf_microfacet_ggx_fresnel_setup(MicrofacetBsdf *bsdf, const Sha
|
|||||||
{
|
{
|
||||||
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
||||||
|
|
||||||
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= F;
|
||||||
|
|
||||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||||
bsdf->alpha_y = bsdf->alpha_x;
|
bsdf->alpha_y = bsdf->alpha_x;
|
||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
|
||||||
|
|
||||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,13 +321,15 @@ ccl_device int bsdf_microfacet_ggx_clearcoat_setup(MicrofacetBsdf *bsdf, const S
|
|||||||
{
|
{
|
||||||
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
||||||
|
|
||||||
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= 0.25f * bsdf->extra->clearcoat * F;
|
||||||
|
|
||||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||||
bsdf->alpha_y = bsdf->alpha_x;
|
bsdf->alpha_y = bsdf->alpha_x;
|
||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
|
||||||
|
|
||||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,13 +364,15 @@ ccl_device int bsdf_microfacet_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsdf, con
|
|||||||
{
|
{
|
||||||
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
bsdf->extra->cspec0 = saturate3(bsdf->extra->cspec0);
|
||||||
|
|
||||||
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= F;
|
||||||
|
|
||||||
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
bsdf->alpha_x = saturate(bsdf->alpha_x);
|
||||||
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
bsdf->alpha_y = saturate(bsdf->alpha_y);
|
||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
|
||||||
|
|
||||||
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
return SD_BSDF | SD_BSDF_HAS_EVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -402,7 +402,9 @@ ccl_device int bsdf_microfacet_multi_ggx_aniso_fresnel_setup(MicrofacetBsdf *bsd
|
|||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= F;
|
||||||
|
|
||||||
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
||||||
}
|
}
|
||||||
@@ -422,7 +424,9 @@ ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(MicrofacetBsdf *bsdf, con
|
|||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= F;
|
||||||
|
|
||||||
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
return bsdf_microfacet_multi_ggx_common_setup(bsdf);
|
||||||
}
|
}
|
||||||
@@ -578,7 +582,9 @@ ccl_device int bsdf_microfacet_multi_ggx_glass_fresnel_setup(MicrofacetBsdf *bsd
|
|||||||
|
|
||||||
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID;
|
bsdf->type = CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID;
|
||||||
|
|
||||||
bsdf_microfacet_fresnel_color(sd, bsdf);
|
float F0 = fresnel_dielectric_cos(1.0f, bsdf->ior);
|
||||||
|
float F = average(interpolate_fresnel_color(sd->I, bsdf->N, bsdf->ior, F0, bsdf->extra->cspec0));
|
||||||
|
bsdf->sample_weight *= F;
|
||||||
|
|
||||||
return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_NEEDS_LCG;
|
return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_NEEDS_LCG;
|
||||||
}
|
}
|
||||||
|
@@ -76,9 +76,9 @@ ccl_device void kernel_filter_construct_transform(const ccl_global float *ccl_re
|
|||||||
filter_calculate_scale(feature_scale, use_time);
|
filter_calculate_scale(feature_scale, use_time);
|
||||||
|
|
||||||
/* === Generate the feature transformation. ===
|
/* === Generate the feature transformation. ===
|
||||||
* This transformation maps the num_features-dimensional feature space to a reduced feature
|
* This transformation maps the num_features-dimentional feature space to a reduced feature
|
||||||
* (r-feature) space which generally has fewer dimensions.
|
* (r-feature) space which generally has fewer dimensions. This mainly helps to prevent
|
||||||
* This mainly helps to prevent overfitting. */
|
* overfitting. */
|
||||||
float feature_matrix[DENOISE_FEATURES * DENOISE_FEATURES];
|
float feature_matrix[DENOISE_FEATURES * DENOISE_FEATURES];
|
||||||
math_matrix_zero(feature_matrix, num_features);
|
math_matrix_zero(feature_matrix, num_features);
|
||||||
FOR_PIXEL_WINDOW
|
FOR_PIXEL_WINDOW
|
||||||
|
@@ -73,9 +73,9 @@ ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buff
|
|||||||
filter_calculate_scale_sse(feature_scale, use_time);
|
filter_calculate_scale_sse(feature_scale, use_time);
|
||||||
|
|
||||||
/* === Generate the feature transformation. ===
|
/* === Generate the feature transformation. ===
|
||||||
* This transformation maps the num_features-dimensional feature space to a reduced feature
|
* This transformation maps the num_features-dimentional feature space to a reduced feature
|
||||||
* (r-feature) space which generally has fewer dimensions.
|
* (r-feature) space which generally has fewer dimensions. This mainly helps to prevent
|
||||||
* This mainly helps to prevent over-fitting. */
|
* overfitting. */
|
||||||
float4 feature_matrix_sse[DENOISE_FEATURES * DENOISE_FEATURES];
|
float4 feature_matrix_sse[DENOISE_FEATURES * DENOISE_FEATURES];
|
||||||
math_matrix_zero_sse(feature_matrix_sse, num_features);
|
math_matrix_zero_sse(feature_matrix_sse, num_features);
|
||||||
FOR_PIXEL_WINDOW_SSE
|
FOR_PIXEL_WINDOW_SSE
|
||||||
|
@@ -145,17 +145,7 @@ ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
|
|||||||
normal += sc->N * sc->sample_weight;
|
normal += sc->N * sc->sample_weight;
|
||||||
sum_weight += sc->sample_weight;
|
sum_weight += sc->sample_weight;
|
||||||
if (bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
|
if (bsdf_get_specular_roughness_squared(sc) > sqr(0.075f)) {
|
||||||
float3 closure_albedo = sc->weight;
|
albedo += sc->weight;
|
||||||
/* Closures that include a Fresnel term typically have weights close to 1 even though their
|
|
||||||
* actual contribution is significantly lower.
|
|
||||||
* To account for this, we scale their weight by the average fresnel factor (the same is also
|
|
||||||
* done for the sample weight in the BSDF setup, so we don't need to scale that here). */
|
|
||||||
if (CLOSURE_IS_BSDF_MICROFACET_FRESNEL(sc->type)) {
|
|
||||||
MicrofacetBsdf *bsdf = (MicrofacetBsdf *)sc;
|
|
||||||
closure_albedo *= bsdf->extra->fresnel_color;
|
|
||||||
}
|
|
||||||
|
|
||||||
albedo += closure_albedo;
|
|
||||||
sum_nonspecular_weight += sc->sample_weight;
|
sum_nonspecular_weight += sc->sample_weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -73,7 +73,7 @@ ccl_device void enqueue_ray_index_local(
|
|||||||
int queue_number, /* Queue in which to enqueue ray index. */
|
int queue_number, /* Queue in which to enqueue ray index. */
|
||||||
char enqueue_flag, /* True for threads whose ray index has to be enqueued. */
|
char enqueue_flag, /* True for threads whose ray index has to be enqueued. */
|
||||||
int queuesize, /* queue size. */
|
int queuesize, /* queue size. */
|
||||||
ccl_local_param unsigned int *local_queue_atomics, /* To do local queue atomics. */
|
ccl_local_param unsigned int *local_queue_atomics, /* To to local queue atomics. */
|
||||||
ccl_global int *Queue_data, /* Queues. */
|
ccl_global int *Queue_data, /* Queues. */
|
||||||
ccl_global int *Queue_index) /* To do global queue atomics. */
|
ccl_global int *Queue_index) /* To do global queue atomics. */
|
||||||
{
|
{
|
||||||
|
@@ -768,7 +768,6 @@ typedef enum AttributeStandard {
|
|||||||
ATTR_STD_VOLUME_TEMPERATURE,
|
ATTR_STD_VOLUME_TEMPERATURE,
|
||||||
ATTR_STD_VOLUME_VELOCITY,
|
ATTR_STD_VOLUME_VELOCITY,
|
||||||
ATTR_STD_POINTINESS,
|
ATTR_STD_POINTINESS,
|
||||||
ATTR_STD_RANDOM_PER_ISLAND,
|
|
||||||
ATTR_STD_NUM,
|
ATTR_STD_NUM,
|
||||||
|
|
||||||
ATTR_STD_NOT_FOUND = ~0
|
ATTR_STD_NOT_FOUND = ~0
|
||||||
|
@@ -44,7 +44,7 @@ template<bool always = false> ccl_device_forceinline uint get_object_id()
|
|||||||
#endif
|
#endif
|
||||||
// Choose between always returning object ID or only for instances
|
// Choose between always returning object ID or only for instances
|
||||||
if (always)
|
if (always)
|
||||||
// Can just remove the high bit since instance always contains object ID
|
// Can just remove the high bit since instace always contains object ID
|
||||||
return object & 0x7FFFFF;
|
return object & 0x7FFFFF;
|
||||||
// Set to OBJECT_NONE if this is not an instanced object
|
// Set to OBJECT_NONE if this is not an instanced object
|
||||||
else if (object & 0x800000)
|
else if (object & 0x800000)
|
||||||
@@ -263,12 +263,8 @@ extern "C" __global__ void __intersection__curve()
|
|||||||
const uint type = kernel_tex_fetch(__prim_type, prim);
|
const uint type = kernel_tex_fetch(__prim_type, prim);
|
||||||
const uint visibility = optixGetPayload_4();
|
const uint visibility = optixGetPayload_4();
|
||||||
|
|
||||||
float3 P = optixGetObjectRayOrigin();
|
const float3 P = optixGetObjectRayOrigin();
|
||||||
float3 dir = optixGetObjectRayDirection();
|
const float3 dir = optixGetObjectRayDirection();
|
||||||
|
|
||||||
// The direction is not normalized by default, but the curve intersection routine expects that
|
|
||||||
float len;
|
|
||||||
dir = normalize_len(dir, &len);
|
|
||||||
|
|
||||||
# ifdef __OBJECT_MOTION__
|
# ifdef __OBJECT_MOTION__
|
||||||
const float time = optixGetRayTime();
|
const float time = optixGetRayTime();
|
||||||
@@ -278,14 +274,11 @@ extern "C" __global__ void __intersection__curve()
|
|||||||
|
|
||||||
Intersection isect;
|
Intersection isect;
|
||||||
isect.t = optixGetRayTmax();
|
isect.t = optixGetRayTmax();
|
||||||
// Transform maximum distance into object space
|
|
||||||
if (isect.t != FLT_MAX)
|
|
||||||
isect.t *= len;
|
|
||||||
|
|
||||||
if (!(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) ?
|
if (!(kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) ?
|
||||||
curve_intersect(NULL, &isect, P, dir, visibility, object, prim, time, type) :
|
curve_intersect(NULL, &isect, P, dir, visibility, object, prim, time, type) :
|
||||||
cardinal_curve_intersect(NULL, &isect, P, dir, visibility, object, prim, time, type)) {
|
cardinal_curve_intersect(NULL, &isect, P, dir, visibility, object, prim, time, type)) {
|
||||||
optixReportIntersection(isect.t / len,
|
optixReportIntersection(isect.t,
|
||||||
type & PRIMITIVE_ALL,
|
type & PRIMITIVE_ALL,
|
||||||
__float_as_int(isect.u), // Attribute_0
|
__float_as_int(isect.u), // Attribute_0
|
||||||
__float_as_int(isect.v)); // Attribute_1
|
__float_as_int(isect.v)); // Attribute_1
|
||||||
|
@@ -26,8 +26,7 @@ shader node_geometry(normal NormalIn = N,
|
|||||||
output vector Incoming = vector(0.0, 0.0, 0.0),
|
output vector Incoming = vector(0.0, 0.0, 0.0),
|
||||||
output point Parametric = point(0.0, 0.0, 0.0),
|
output point Parametric = point(0.0, 0.0, 0.0),
|
||||||
output float Backfacing = 0.0,
|
output float Backfacing = 0.0,
|
||||||
output float Pointiness = 0.0,
|
output float Pointiness = 0.0)
|
||||||
output float RandomPerIsland = 0.0)
|
|
||||||
{
|
{
|
||||||
Position = P;
|
Position = P;
|
||||||
Normal = NormalIn;
|
Normal = NormalIn;
|
||||||
@@ -66,6 +65,4 @@ shader node_geometry(normal NormalIn = N,
|
|||||||
else if (bump_offset == "dy") {
|
else if (bump_offset == "dy") {
|
||||||
Pointiness += Dy(Pointiness);
|
Pointiness += Dy(Pointiness);
|
||||||
}
|
}
|
||||||
|
|
||||||
getattribute("geom:random_per_island", RandomPerIsland);
|
|
||||||
}
|
}
|
||||||
|
@@ -552,12 +552,6 @@ typedef enum ClosureType {
|
|||||||
(type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && \
|
(type >= CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID && \
|
||||||
type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) || \
|
type <= CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID) || \
|
||||||
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID))
|
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID))
|
||||||
#define CLOSURE_IS_BSDF_MICROFACET_FRESNEL(type) \
|
|
||||||
(type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID || \
|
|
||||||
type == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID || \
|
|
||||||
type == CLOSURE_BSDF_MICROFACET_GGX_FRESNEL_ID || \
|
|
||||||
type == CLOSURE_BSDF_MICROFACET_GGX_CLEARCOAT_ID || \
|
|
||||||
type == CLOSURE_BSDF_MICROFACET_GGX_ANISO_FRESNEL_ID)
|
|
||||||
#define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
#define CLOSURE_IS_BSDF_OR_BSSRDF(type) (type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
||||||
#define CLOSURE_IS_BSSRDF(type) \
|
#define CLOSURE_IS_BSSRDF(type) \
|
||||||
(type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
(type >= CLOSURE_BSSRDF_CUBIC_ID && type <= CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID)
|
||||||
|
@@ -312,8 +312,6 @@ const char *Attribute::standard_name(AttributeStandard std)
|
|||||||
return "velocity";
|
return "velocity";
|
||||||
case ATTR_STD_POINTINESS:
|
case ATTR_STD_POINTINESS:
|
||||||
return "pointiness";
|
return "pointiness";
|
||||||
case ATTR_STD_RANDOM_PER_ISLAND:
|
|
||||||
return "random_per_island";
|
|
||||||
case ATTR_STD_NOT_FOUND:
|
case ATTR_STD_NOT_FOUND:
|
||||||
case ATTR_STD_NONE:
|
case ATTR_STD_NONE:
|
||||||
case ATTR_STD_NUM:
|
case ATTR_STD_NUM:
|
||||||
@@ -470,9 +468,6 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name)
|
|||||||
case ATTR_STD_POINTINESS:
|
case ATTR_STD_POINTINESS:
|
||||||
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX);
|
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX);
|
||||||
break;
|
break;
|
||||||
case ATTR_STD_RANDOM_PER_ISLAND:
|
|
||||||
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
@@ -501,9 +496,6 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name)
|
|||||||
case ATTR_STD_POINTINESS:
|
case ATTR_STD_POINTINESS:
|
||||||
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX);
|
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VERTEX);
|
||||||
break;
|
break;
|
||||||
case ATTR_STD_RANDOM_PER_ISLAND:
|
|
||||||
attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_FACE);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
|
@@ -79,7 +79,7 @@ class Light : public Node {
|
|||||||
|
|
||||||
void tag_update(Scene *scene);
|
void tag_update(Scene *scene);
|
||||||
|
|
||||||
/* Check whether the light has contribution the scene. */
|
/* Check whether the light has contribution the the scene. */
|
||||||
bool has_contribution(Scene *scene);
|
bool has_contribution(Scene *scene);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3502,7 +3502,6 @@ NODE_DEFINE(GeometryNode)
|
|||||||
SOCKET_OUT_POINT(parametric, "Parametric");
|
SOCKET_OUT_POINT(parametric, "Parametric");
|
||||||
SOCKET_OUT_FLOAT(backfacing, "Backfacing");
|
SOCKET_OUT_FLOAT(backfacing, "Backfacing");
|
||||||
SOCKET_OUT_FLOAT(pointiness, "Pointiness");
|
SOCKET_OUT_FLOAT(pointiness, "Pointiness");
|
||||||
SOCKET_OUT_FLOAT(random_per_island, "Random Per Island");
|
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@@ -3521,9 +3520,6 @@ void GeometryNode::attributes(Shader *shader, AttributeRequestSet *attributes)
|
|||||||
if (!output("Pointiness")->links.empty()) {
|
if (!output("Pointiness")->links.empty()) {
|
||||||
attributes->add(ATTR_STD_POINTINESS);
|
attributes->add(ATTR_STD_POINTINESS);
|
||||||
}
|
}
|
||||||
if (!output("Random Per Island")->links.empty()) {
|
|
||||||
attributes->add(ATTR_STD_RANDOM_PER_ISLAND);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderNode::attributes(shader, attributes);
|
ShaderNode::attributes(shader, attributes);
|
||||||
@@ -3589,17 +3585,6 @@ void GeometryNode::compile(SVMCompiler &compiler)
|
|||||||
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), compiler.stack_assign(out));
|
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), compiler.stack_assign(out));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out = output("Random Per Island");
|
|
||||||
if (!out->links.empty()) {
|
|
||||||
if (compiler.output_type() != SHADER_TYPE_VOLUME) {
|
|
||||||
compiler.add_node(
|
|
||||||
attr_node, ATTR_STD_RANDOM_PER_ISLAND, compiler.stack_assign(out), NODE_ATTR_FLOAT);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), compiler.stack_assign(out));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryNode::compile(OSLCompiler &compiler)
|
void GeometryNode::compile(OSLCompiler &compiler)
|
||||||
|
@@ -60,7 +60,6 @@ set(SRC_HEADERS
|
|||||||
util_debug.h
|
util_debug.h
|
||||||
util_defines.h
|
util_defines.h
|
||||||
util_deque.h
|
util_deque.h
|
||||||
util_disjoint_set.h
|
|
||||||
util_guarded_allocator.cpp
|
util_guarded_allocator.cpp
|
||||||
util_foreach.h
|
util_foreach.h
|
||||||
util_function.h
|
util_function.h
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011-2013 Blender Foundation
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __UTIL_DISJOINT_SET_H__
|
|
||||||
#define __UTIL_DISJOINT_SET_H__
|
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include "util_array.h"
|
|
||||||
|
|
||||||
CCL_NAMESPACE_BEGIN
|
|
||||||
|
|
||||||
class DisjointSet {
|
|
||||||
private:
|
|
||||||
array<size_t> parents;
|
|
||||||
array<size_t> ranks;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DisjointSet(size_t size) : parents(size), ranks(size)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < size; i++) {
|
|
||||||
parents[i] = i;
|
|
||||||
ranks[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t find(size_t x)
|
|
||||||
{
|
|
||||||
size_t root = x;
|
|
||||||
while (parents[root] != root) {
|
|
||||||
root = parents[root];
|
|
||||||
}
|
|
||||||
while (parents[x] != root) {
|
|
||||||
size_t parent = parents[x];
|
|
||||||
parents[x] = root;
|
|
||||||
x = parent;
|
|
||||||
}
|
|
||||||
return root;
|
|
||||||
}
|
|
||||||
|
|
||||||
void join(size_t x, size_t y)
|
|
||||||
{
|
|
||||||
size_t x_root = find(x);
|
|
||||||
size_t y_root = find(y);
|
|
||||||
|
|
||||||
if (x_root == y_root) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ranks[x_root] < ranks[y_root]) {
|
|
||||||
std::swap(x_root, y_root);
|
|
||||||
}
|
|
||||||
parents[y_root] = x_root;
|
|
||||||
|
|
||||||
if (ranks[x_root] == ranks[y_root]) {
|
|
||||||
ranks[x_root]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CCL_NAMESPACE_END
|
|
||||||
|
|
||||||
#endif /* __UTIL_DISJOINT_SET_H__ */
|
|
@@ -58,11 +58,6 @@ typedef int (*GHOST_EventCallbackProcPtr)(GHOST_EventHandle event, GHOST_TUserDa
|
|||||||
*/
|
*/
|
||||||
extern GHOST_SystemHandle GHOST_CreateSystem(void);
|
extern GHOST_SystemHandle GHOST_CreateSystem(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies whether debug messages are to be enabled for the specific system handle.
|
|
||||||
*/
|
|
||||||
extern void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, int is_debug_enabled);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disposes the one and only system.
|
* Disposes the one and only system.
|
||||||
* \param systemhandle The handle to the system
|
* \param systemhandle The handle to the system
|
||||||
|
@@ -458,20 +458,6 @@ class GHOST_ISystem {
|
|||||||
const char * /*link*/,
|
const char * /*link*/,
|
||||||
GHOST_DialogOptions /*dialog_options*/) const = 0;
|
GHOST_DialogOptions /*dialog_options*/) const = 0;
|
||||||
|
|
||||||
/***************************************************************************************
|
|
||||||
* Debugging
|
|
||||||
***************************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify whether debug messages are to be shown.
|
|
||||||
*/
|
|
||||||
virtual void initDebug(bool is_debug_enabled) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether debug messages are to be shown.
|
|
||||||
*/
|
|
||||||
virtual bool isDebugEnabled() = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Initialize the system.
|
* Initialize the system.
|
||||||
|
@@ -40,13 +40,6 @@ GHOST_SystemHandle GHOST_CreateSystem(void)
|
|||||||
return (GHOST_SystemHandle)system;
|
return (GHOST_SystemHandle)system;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, int is_debug_enabled)
|
|
||||||
{
|
|
||||||
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
|
|
||||||
|
|
||||||
system->initDebug(is_debug_enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
|
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
|
||||||
{
|
{
|
||||||
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
|
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file
|
/** \file ghost/intern/GHOST_ContextCGL.mm
|
||||||
* \ingroup GHOST
|
* \ingroup GHOST
|
||||||
*
|
*
|
||||||
* Definition of GHOST_ContextCGL class.
|
* Definition of GHOST_ContextCGL class.
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#include "GHOST_DisplayManagerWin32.h"
|
#include "GHOST_DisplayManagerWin32.h"
|
||||||
#include "GHOST_Debug.h"
|
#include "GHOST_Debug.h"
|
||||||
|
|
||||||
|
#undef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x501 // require Windows XP or newer
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ class GHOST_EventButton : public GHOST_Event {
|
|||||||
* \param time The time this event was generated.
|
* \param time The time this event was generated.
|
||||||
* \param type The type of this event.
|
* \param type The type of this event.
|
||||||
* \param window: The window of this event.
|
* \param window: The window of this event.
|
||||||
* \param button: The state of the buttons were at the time of the event.
|
* \param button: The state of the buttons were at at the time of the event.
|
||||||
*/
|
*/
|
||||||
GHOST_EventButton(GHOST_TUns64 time,
|
GHOST_EventButton(GHOST_TUns64 time,
|
||||||
GHOST_TEventType type,
|
GHOST_TEventType type,
|
||||||
|
@@ -36,8 +36,8 @@ class GHOST_EventCursor : public GHOST_Event {
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
* \param msec The time this event was generated.
|
* \param msec The time this event was generated.
|
||||||
* \param type The type of this event.
|
* \param type The type of this event.
|
||||||
* \param x The x-coordinate of the location the cursor was at the time of the event.
|
* \param x The x-coordinate of the location the cursor was at at the time of the event.
|
||||||
* \param y The y-coordinate of the location the cursor was at the time of the event.
|
* \param y The y-coordinate of the location the cursor was at at the time of the event.
|
||||||
*/
|
*/
|
||||||
GHOST_EventCursor(GHOST_TUns64 msec,
|
GHOST_EventCursor(GHOST_TUns64 msec,
|
||||||
GHOST_TEventType type,
|
GHOST_TEventType type,
|
||||||
|
@@ -69,8 +69,8 @@ class GHOST_EventDragnDrop : public GHOST_Event {
|
|||||||
* \param type The type of this event.
|
* \param type The type of this event.
|
||||||
* \param dataType The type of the drop candidate object
|
* \param dataType The type of the drop candidate object
|
||||||
* \param window The window where the event occurred
|
* \param window The window where the event occurred
|
||||||
* \param x The x-coordinate of the location the cursor was at the time of the event.
|
* \param x The x-coordinate of the location the cursor was at at the time of the event.
|
||||||
* \param y The y-coordinate of the location the cursor was at the time of the event.
|
* \param y The y-coordinate of the location the cursor was at at the time of the event.
|
||||||
* \param data The "content" dropped in the window
|
* \param data The "content" dropped in the window
|
||||||
*/
|
*/
|
||||||
GHOST_EventDragnDrop(GHOST_TUns64 time,
|
GHOST_EventDragnDrop(GHOST_TUns64 time,
|
||||||
|
@@ -46,8 +46,7 @@ GHOST_System::GHOST_System()
|
|||||||
#ifdef WITH_INPUT_NDOF
|
#ifdef WITH_INPUT_NDOF
|
||||||
m_ndofManager(0),
|
m_ndofManager(0),
|
||||||
#endif
|
#endif
|
||||||
m_tabletAPI(GHOST_kTabletAutomatic),
|
m_tabletAPI(GHOST_kTabletAutomatic)
|
||||||
m_is_debug_enabled(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,13 +388,3 @@ void GHOST_System::useWindowFocus(const bool use_focus)
|
|||||||
{
|
{
|
||||||
m_windowFocus = use_focus;
|
m_windowFocus = use_focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GHOST_System::initDebug(bool is_debug_enabled)
|
|
||||||
{
|
|
||||||
m_is_debug_enabled = is_debug_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GHOST_System::isDebugEnabled()
|
|
||||||
{
|
|
||||||
return m_is_debug_enabled;
|
|
||||||
}
|
|
||||||
|
@@ -328,20 +328,6 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
return GHOST_kFailure;
|
return GHOST_kFailure;
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************************
|
|
||||||
* Debugging
|
|
||||||
***************************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify whether debug messages are to be shown.
|
|
||||||
*/
|
|
||||||
virtual void initDebug(bool is_debug_enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether debug messages are to be shown.
|
|
||||||
*/
|
|
||||||
virtual bool isDebugEnabled();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Initialize the system.
|
* Initialize the system.
|
||||||
@@ -392,8 +378,6 @@ class GHOST_System : public GHOST_ISystem {
|
|||||||
|
|
||||||
/** Which tablet API to use. */
|
/** Which tablet API to use. */
|
||||||
GHOST_TTabletAPI m_tabletAPI;
|
GHOST_TTabletAPI m_tabletAPI;
|
||||||
|
|
||||||
bool m_is_debug_enabled;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline GHOST_TimerManager *GHOST_System::getTimerManager() const
|
inline GHOST_TimerManager *GHOST_System::getTimerManager() const
|
||||||
|
@@ -39,16 +39,15 @@ GHOST_SystemPathsWin32::~GHOST_SystemPathsWin32()
|
|||||||
|
|
||||||
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
|
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
|
||||||
{
|
{
|
||||||
/* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/
|
static char knownpath[MAX_PATH * 3 + 128] = {
|
||||||
static char knownpath[MAX_PATH * 3 + 128] = {0};
|
0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/
|
||||||
PWSTR knownpath_16 = NULL;
|
wchar_t knownpath_16[MAX_PATH];
|
||||||
|
|
||||||
HRESULT hResult = SHGetKnownFolderPath(
|
HRESULT hResult = SHGetFolderPathW(
|
||||||
FOLDERID_ProgramData, KF_FLAG_DEFAULT, NULL, &knownpath_16);
|
NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16);
|
||||||
|
|
||||||
if (hResult == S_OK) {
|
if (hResult == S_OK) {
|
||||||
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
||||||
CoTaskMemFree(knownpath_16);
|
|
||||||
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
||||||
strcat(knownpath, versionstr);
|
strcat(knownpath, versionstr);
|
||||||
return (GHOST_TUns8 *)knownpath;
|
return (GHOST_TUns8 *)knownpath;
|
||||||
@@ -60,14 +59,12 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *version
|
|||||||
const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
|
const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
|
||||||
{
|
{
|
||||||
static char knownpath[MAX_PATH * 3 + 128] = {0};
|
static char knownpath[MAX_PATH * 3 + 128] = {0};
|
||||||
PWSTR knownpath_16 = NULL;
|
wchar_t knownpath_16[MAX_PATH];
|
||||||
|
|
||||||
HRESULT hResult = SHGetKnownFolderPath(
|
HRESULT hResult = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath_16);
|
||||||
FOLDERID_RoamingAppData, KF_FLAG_DEFAULT, NULL, &knownpath_16);
|
|
||||||
|
|
||||||
if (hResult == S_OK) {
|
if (hResult == S_OK) {
|
||||||
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
|
||||||
CoTaskMemFree(knownpath_16);
|
|
||||||
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
strcat(knownpath, "\\Blender Foundation\\Blender\\");
|
||||||
strcat(knownpath, versionstr);
|
strcat(knownpath, versionstr);
|
||||||
return (GHOST_TUns8 *)knownpath;
|
return (GHOST_TUns8 *)knownpath;
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
# error WIN32 only!
|
# error WIN32 only!
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
|
#undef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x501 // require Windows XP or newer
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
@@ -700,7 +700,7 @@ bool GHOST_SystemX11::processEvents(bool waitForEvent)
|
|||||||
|
|
||||||
for (int i = 0; i < (sizeof(modifiers) / sizeof(*modifiers)); i++) {
|
for (int i = 0; i < (sizeof(modifiers) / sizeof(*modifiers)); i++) {
|
||||||
KeyCode kc = XKeysymToKeycode(m_display, modifiers[i]);
|
KeyCode kc = XKeysymToKeycode(m_display, modifiers[i]);
|
||||||
if (kc != 0 && ((xevent.xkeymap.key_vector[kc >> 3] >> (kc & 7)) & 1) != 0) {
|
if (((xevent.xkeymap.key_vector[kc >> 3] >> (kc & 7)) & 1) != 0) {
|
||||||
pushEvent(new GHOST_EventKey(getMilliSeconds(),
|
pushEvent(new GHOST_EventKey(getMilliSeconds(),
|
||||||
GHOST_kEventKeyDown,
|
GHOST_kEventKeyDown,
|
||||||
window,
|
window,
|
||||||
@@ -2383,11 +2383,6 @@ GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
|
|||||||
*/
|
*/
|
||||||
int GHOST_X11_ApplicationErrorHandler(Display *display, XErrorEvent *event)
|
int GHOST_X11_ApplicationErrorHandler(Display *display, XErrorEvent *event)
|
||||||
{
|
{
|
||||||
GHOST_ISystem *system = GHOST_ISystem::getSystem();
|
|
||||||
if (!system->isDebugEnabled()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
char error_code_str[512];
|
char error_code_str[512];
|
||||||
|
|
||||||
XGetErrorText(display, event->error_code, error_code_str, sizeof(error_code_str));
|
XGetErrorText(display, event->error_code, error_code_str, sizeof(error_code_str));
|
||||||
@@ -2409,11 +2404,6 @@ int GHOST_X11_ApplicationErrorHandler(Display *display, XErrorEvent *event)
|
|||||||
|
|
||||||
int GHOST_X11_ApplicationIOErrorHandler(Display * /*display*/)
|
int GHOST_X11_ApplicationIOErrorHandler(Display * /*display*/)
|
||||||
{
|
{
|
||||||
GHOST_ISystem *system = GHOST_ISystem::getSystem();
|
|
||||||
if (!system->isDebugEnabled()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(stderr, "Ignoring Xlib error: error IO\n");
|
fprintf(stderr, "Ignoring Xlib error: error IO\n");
|
||||||
|
|
||||||
/* No exit! - but keep lint happy */
|
/* No exit! - but keep lint happy */
|
||||||
|
@@ -24,6 +24,10 @@
|
|||||||
# error WIN32 only!
|
# error WIN32 only!
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
|
/* require Windows XP or newer */
|
||||||
|
#undef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x501
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
@@ -58,11 +58,6 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)acceptsFirstMouse:(NSEvent *)event
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The trick to prevent Cocoa from complaining (beeping)
|
// The trick to prevent Cocoa from complaining (beeping)
|
||||||
- (void)keyDown:(NSEvent *)event
|
- (void)keyDown:(NSEvent *)event
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,7 @@ struct FrameAccessor {
|
|||||||
//
|
//
|
||||||
// Result is supposed to be a single channel image.
|
// Result is supposed to be a single channel image.
|
||||||
//
|
//
|
||||||
// If region is NULL, it assumed to be full-frame.
|
// If region is NULL, it it assumed to be full-frame.
|
||||||
virtual Key GetMaskForTrack(int clip,
|
virtual Key GetMaskForTrack(int clip,
|
||||||
int frame,
|
int frame,
|
||||||
int track,
|
int track,
|
||||||
|
@@ -37,23 +37,23 @@ extern "C" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the reference count of this object.
|
* Returns the reference count of this object.
|
||||||
* \param shared: The object to query.
|
* @param shared The object to query.
|
||||||
* \return The current reference count.
|
* @return The current reference count.
|
||||||
*/
|
*/
|
||||||
extern int MEM_RefCountedGetRef(MEM_TRefCountedObjectPtr shared);
|
extern int MEM_RefCountedGetRef(MEM_TRefCountedObjectPtr shared);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increases the reference count of this object.
|
* Increases the reference count of this object.
|
||||||
* \param shared: The object to query.
|
* @param shared The object to query.
|
||||||
* \return The new reference count.
|
* @return The new reference count.
|
||||||
*/
|
*/
|
||||||
extern int MEM_RefCountedIncRef(MEM_TRefCountedObjectPtr shared);
|
extern int MEM_RefCountedIncRef(MEM_TRefCountedObjectPtr shared);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decreases the reference count of this object.
|
* Decreases the reference count of this object.
|
||||||
* If the reference count reaches zero, the object self-destructs.
|
* If the reference count reaches zero, the object self-destructs.
|
||||||
* \param shared: The object to query.
|
* @param shared The object to query.
|
||||||
* \return The new reference count.
|
* @return The new reference count.
|
||||||
*/
|
*/
|
||||||
extern int MEM_RefCountedDecRef(MEM_TRefCountedObjectPtr shared);
|
extern int MEM_RefCountedDecRef(MEM_TRefCountedObjectPtr shared);
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ out vec4 fragColor;
|
|||||||
*/
|
*/
|
||||||
uniform sampler1D curve_mapping_texture;
|
uniform sampler1D curve_mapping_texture;
|
||||||
uniform int curve_mapping_lut_size;
|
uniform int curve_mapping_lut_size;
|
||||||
uniform int use_curve_mapping_extend_extrapolate;
|
uniform ivec4 use_curve_mapping_extend_extrapolate;
|
||||||
uniform vec4 curve_mapping_mintable;
|
uniform vec4 curve_mapping_mintable;
|
||||||
uniform vec4 curve_mapping_range;
|
uniform vec4 curve_mapping_range;
|
||||||
uniform vec4 curve_mapping_ext_in_x;
|
uniform vec4 curve_mapping_ext_in_x;
|
||||||
@@ -42,8 +42,8 @@ float read_curve_mapping(int table, int index)
|
|||||||
float curvemap_calc_extend(int table, float x, vec2 first, vec2 last)
|
float curvemap_calc_extend(int table, float x, vec2 first, vec2 last)
|
||||||
{
|
{
|
||||||
if (x <= first[0]) {
|
if (x <= first[0]) {
|
||||||
if (use_curve_mapping_extend_extrapolate == 0) {
|
if (use_curve_mapping_extend_extrapolate[table] == 0) {
|
||||||
/* horizontal extrapolation */
|
/* no extrapolate */
|
||||||
return first[1];
|
return first[1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -55,8 +55,8 @@ float curvemap_calc_extend(int table, float x, vec2 first, vec2 last)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (x >= last[0]) {
|
else if (x >= last[0]) {
|
||||||
if (use_curve_mapping_extend_extrapolate == 0) {
|
if (use_curve_mapping_extend_extrapolate[table] == 0) {
|
||||||
/* horizontal extrapolation */
|
/* no extrapolate */
|
||||||
return last[1];
|
return last[1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -73,10 +73,10 @@ typedef struct OCIO_CurveMappingSettings {
|
|||||||
int lut_size;
|
int lut_size;
|
||||||
|
|
||||||
/* Extend extrapolation flags for all the tables.
|
/* Extend extrapolation flags for all the tables.
|
||||||
* if use_extend_extrapolate != 0 means extrapolation for
|
* if use_extend_extrapolate[T] != 0 means extrapolation for
|
||||||
* curve.
|
* table T is needed.
|
||||||
*/
|
*/
|
||||||
int use_extend_extrapolate;
|
int use_extend_extrapolate[4];
|
||||||
|
|
||||||
/* Minimal X value of the curve mapping tables. */
|
/* Minimal X value of the curve mapping tables. */
|
||||||
float mintable[4];
|
float mintable[4];
|
||||||
|
@@ -499,8 +499,8 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
|
|||||||
if (use_curve_mapping) {
|
if (use_curve_mapping) {
|
||||||
immUniform1i("curve_mapping_texture", 2);
|
immUniform1i("curve_mapping_texture", 2);
|
||||||
immUniform1i("curve_mapping_lut_size", curve_mapping_settings->lut_size);
|
immUniform1i("curve_mapping_lut_size", curve_mapping_settings->lut_size);
|
||||||
immUniform1i("use_curve_mapping_extend_extrapolate",
|
immUniform4iv("use_curve_mapping_extend_extrapolate",
|
||||||
curve_mapping_settings->use_extend_extrapolate);
|
curve_mapping_settings->use_extend_extrapolate);
|
||||||
immUniform4fv("curve_mapping_mintable", curve_mapping_settings->mintable);
|
immUniform4fv("curve_mapping_mintable", curve_mapping_settings->mintable);
|
||||||
immUniform4fv("curve_mapping_range", curve_mapping_settings->range);
|
immUniform4fv("curve_mapping_range", curve_mapping_settings->range);
|
||||||
immUniform4fv("curve_mapping_ext_in_x", curve_mapping_settings->ext_in_x);
|
immUniform4fv("curve_mapping_ext_in_x", curve_mapping_settings->ext_in_x);
|
||||||
|
@@ -102,17 +102,6 @@ void evaluateLimit(OpenSubdiv_Evaluator *evaluator,
|
|||||||
evaluator->internal->eval_output->evaluateLimit(ptex_face_index, face_u, face_v, P, dPdu, dPdv);
|
evaluator->internal->eval_output->evaluateLimit(ptex_face_index, face_u, face_v, P, dPdu, dPdv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void evaluatePatchesLimit(OpenSubdiv_Evaluator *evaluator,
|
|
||||||
const OpenSubdiv_PatchCoord *patch_coords,
|
|
||||||
const int num_patch_coords,
|
|
||||||
float *P,
|
|
||||||
float *dPdu,
|
|
||||||
float *dPdv)
|
|
||||||
{
|
|
||||||
evaluator->internal->eval_output->evaluatePatchesLimit(
|
|
||||||
patch_coords, num_patch_coords, P, dPdu, dPdv);
|
|
||||||
}
|
|
||||||
|
|
||||||
void evaluateVarying(OpenSubdiv_Evaluator *evaluator,
|
void evaluateVarying(OpenSubdiv_Evaluator *evaluator,
|
||||||
const int ptex_face_index,
|
const int ptex_face_index,
|
||||||
float face_u,
|
float face_u,
|
||||||
@@ -148,8 +137,6 @@ void assignFunctionPointers(OpenSubdiv_Evaluator *evaluator)
|
|||||||
evaluator->evaluateLimit = evaluateLimit;
|
evaluator->evaluateLimit = evaluateLimit;
|
||||||
evaluator->evaluateVarying = evaluateVarying;
|
evaluator->evaluateVarying = evaluateVarying;
|
||||||
evaluator->evaluateFaceVarying = evaluateFaceVarying;
|
evaluator->evaluateFaceVarying = evaluateFaceVarying;
|
||||||
|
|
||||||
evaluator->evaluatePatchesLimit = evaluatePatchesLimit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -54,133 +54,109 @@ using OpenSubdiv::Osd::CpuPatchTable;
|
|||||||
using OpenSubdiv::Osd::CpuVertexBuffer;
|
using OpenSubdiv::Osd::CpuVertexBuffer;
|
||||||
using OpenSubdiv::Osd::PatchCoord;
|
using OpenSubdiv::Osd::PatchCoord;
|
||||||
|
|
||||||
|
// TODO(sergey): Remove after official requirement bump for OSD version.
|
||||||
|
#if OPENSUBDIV_VERSION_NUMBER >= 30200
|
||||||
|
# define OPENSUBDIV_HAS_FVAR_EVALUATION
|
||||||
|
#else
|
||||||
|
# undef OPENSUBDIV_HAS_FVAR_EVALUATION
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace opensubdiv_capi {
|
namespace opensubdiv_capi {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Array implementation which stores small data on stack (or, rather, in the class itself).
|
// Helper class to wrap numerous of patch coordinates into a buffer.
|
||||||
template<typename T, int kNumMaxElementsOnStack> class StackOrHeapArray {
|
// Used to pass coordinates to the CPU evaluator. Other evaluators are not
|
||||||
|
// supported.
|
||||||
|
class PatchCoordBuffer : public vector<PatchCoord> {
|
||||||
public:
|
public:
|
||||||
StackOrHeapArray()
|
static PatchCoordBuffer *Create(int size)
|
||||||
: num_elements_(0), heap_elements_(NULL), num_heap_elements_(0), effective_elements_(NULL)
|
|
||||||
{
|
{
|
||||||
|
PatchCoordBuffer *buffer = new PatchCoordBuffer();
|
||||||
|
buffer->resize(size);
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit StackOrHeapArray(int size) : StackOrHeapArray()
|
PatchCoord *BindCpuBuffer()
|
||||||
{
|
|
||||||
resize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
~StackOrHeapArray()
|
|
||||||
{
|
|
||||||
delete[] heap_elements_;
|
|
||||||
}
|
|
||||||
|
|
||||||
int size() const
|
|
||||||
{
|
|
||||||
return num_elements_;
|
|
||||||
};
|
|
||||||
|
|
||||||
T *data()
|
|
||||||
{
|
|
||||||
return effective_elements_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void resize(int num_elements)
|
|
||||||
{
|
|
||||||
const int old_num_elements = num_elements_;
|
|
||||||
num_elements_ = num_elements;
|
|
||||||
// Early output if allcoation size did not change, or allocation size is smaller.
|
|
||||||
// We never re-allocate, sacrificing some memory over performance.
|
|
||||||
if (old_num_elements >= num_elements) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Simple case: no previously allocated buffer, can simply do one allocation.
|
|
||||||
if (effective_elements_ == NULL) {
|
|
||||||
effective_elements_ = allocate(num_elements);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Make new allocation, and copy elements if needed.
|
|
||||||
T *old_buffer = effective_elements_;
|
|
||||||
effective_elements_ = allocate(num_elements);
|
|
||||||
if (old_buffer != effective_elements_) {
|
|
||||||
memcpy(effective_elements_, old_buffer, sizeof(T) * min(old_num_elements, num_elements));
|
|
||||||
}
|
|
||||||
if (old_buffer != stack_elements_) {
|
|
||||||
delete[] old_buffer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
T *allocate(int num_elements)
|
|
||||||
{
|
|
||||||
if (num_elements < kNumMaxElementsOnStack) {
|
|
||||||
return stack_elements_;
|
|
||||||
}
|
|
||||||
heap_elements_ = new T[num_elements];
|
|
||||||
return heap_elements_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Number of elements in the buffer.
|
|
||||||
int num_elements_;
|
|
||||||
|
|
||||||
// Elements which are allocated on a stack (or, rather, in the same allocation as the buffer
|
|
||||||
// itself).
|
|
||||||
// Is used as long as buffer is smaller than kNumMaxElementsOnStack.
|
|
||||||
T stack_elements_[kNumMaxElementsOnStack];
|
|
||||||
|
|
||||||
// Heap storage for buffer larger than kNumMaxElementsOnStack.
|
|
||||||
T *heap_elements_;
|
|
||||||
int num_heap_elements_;
|
|
||||||
|
|
||||||
// Depending on the current buffer size points to rither stack_elements_ or heap_elements_.
|
|
||||||
T *effective_elements_;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 32 is a number of inner vertices along the patch size at subdivision level 6.
|
|
||||||
typedef StackOrHeapArray<PatchCoord, 32 * 32> StackOrHeapPatchCoordArray;
|
|
||||||
|
|
||||||
// Buffer which implements API required by OpenSubdiv and uses an existing memory as an underlying
|
|
||||||
// storage.
|
|
||||||
template<typename T> class RawDataWrapperBuffer {
|
|
||||||
public:
|
|
||||||
RawDataWrapperBuffer(T *data) : data_(data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
T *BindCpuBuffer()
|
|
||||||
{
|
|
||||||
return data_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(sergey): Support UpdateData().
|
|
||||||
|
|
||||||
protected:
|
|
||||||
T *data_;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T> class RawDataWrapperVertexBuffer : public RawDataWrapperBuffer<T> {
|
|
||||||
public:
|
|
||||||
RawDataWrapperVertexBuffer(T *data, int num_vertices)
|
|
||||||
: RawDataWrapperBuffer<T>(data), num_vertices_(num_vertices)
|
|
||||||
{
|
{
|
||||||
|
return reinterpret_cast<PatchCoord *>(&(*this)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetNumVertices()
|
int GetNumVertices()
|
||||||
{
|
{
|
||||||
return num_vertices_;
|
return size();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateData(const PatchCoord *patch_coords, int num_patch_coords)
|
||||||
|
{
|
||||||
|
memcpy(&(*this)[0],
|
||||||
|
reinterpret_cast<const void *>(patch_coords),
|
||||||
|
sizeof(PatchCoord) * num_patch_coords);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Helper class to wrap single of patch coord into a buffer. Used to pass
|
||||||
|
// coordinates to the CPU evaluator. Other evaluators are not supported.
|
||||||
|
class SinglePatchCoordBuffer {
|
||||||
|
public:
|
||||||
|
static SinglePatchCoordBuffer *Create()
|
||||||
|
{
|
||||||
|
return new SinglePatchCoordBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
SinglePatchCoordBuffer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit SinglePatchCoordBuffer(const PatchCoord &patch_coord) : patch_coord_(patch_coord)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PatchCoord *BindCpuBuffer()
|
||||||
|
{
|
||||||
|
return &patch_coord_;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetNumVertices()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateData(const PatchCoord &patch_coord)
|
||||||
|
{
|
||||||
|
patch_coord_ = patch_coord;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int num_vertices_;
|
PatchCoord patch_coord_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConstPatchCoordWrapperBuffer : public RawDataWrapperVertexBuffer<const PatchCoord> {
|
// Helper class which is aimed to be used in cases when buffer is small enough
|
||||||
|
// and better to be allocated in stack rather than in heap.
|
||||||
|
//
|
||||||
|
// TODO(sergey): Check if bare arrays could be used by CPU evaluator.
|
||||||
|
template<int element_size, int num_vertices> class StackAllocatedBuffer {
|
||||||
public:
|
public:
|
||||||
ConstPatchCoordWrapperBuffer(const PatchCoord *data, int num_vertices)
|
static PatchCoordBuffer *Create(int /*size*/)
|
||||||
: RawDataWrapperVertexBuffer(data, num_vertices)
|
|
||||||
{
|
{
|
||||||
|
// TODO(sergey): Validate that requested size is smaller than static
|
||||||
|
// stack memory size.
|
||||||
|
return new StackAllocatedBuffer<element_size, num_vertices>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float *BindCpuBuffer()
|
||||||
|
{
|
||||||
|
return &data_[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetNumVertices()
|
||||||
|
{
|
||||||
|
return num_vertices;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(sergey): Support UpdateData().
|
||||||
|
protected:
|
||||||
|
float data_[element_size * num_vertices];
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename EVAL_VERTEX_BUFFER,
|
template<typename EVAL_VERTEX_BUFFER,
|
||||||
@@ -241,12 +217,11 @@ class FaceVaryingVolatileEval {
|
|||||||
device_context_);
|
device_context_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: face_varying must point to a memory of at least float[2]*num_patch_coords.
|
void evalPatch(const PatchCoord &patch_coord, float face_varying[2])
|
||||||
void evalPatches(const PatchCoord *patch_coord, const int num_patch_coords, float *face_varying)
|
|
||||||
{
|
{
|
||||||
RawDataWrapperBuffer<float> face_varying_data(face_varying);
|
StackAllocatedBuffer<2, 1> face_varying_data;
|
||||||
BufferDescriptor face_varying_desc(0, 2, 2);
|
BufferDescriptor face_varying_desc(0, 2, 2);
|
||||||
ConstPatchCoordWrapperBuffer patch_coord_buffer(patch_coord, num_patch_coords);
|
SinglePatchCoordBuffer patch_coord_buffer(patch_coord);
|
||||||
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
||||||
evaluator_cache_, src_face_varying_desc_, face_varying_desc, device_context_);
|
evaluator_cache_, src_face_varying_desc_, face_varying_desc, device_context_);
|
||||||
EVALUATOR::EvalPatchesFaceVarying(src_face_varying_data_,
|
EVALUATOR::EvalPatchesFaceVarying(src_face_varying_data_,
|
||||||
@@ -259,6 +234,8 @@ class FaceVaryingVolatileEval {
|
|||||||
face_varying_channel_,
|
face_varying_channel_,
|
||||||
eval_instance,
|
eval_instance,
|
||||||
device_context_);
|
device_context_);
|
||||||
|
const float *refined_face_varying = face_varying_data.BindCpuBuffer();
|
||||||
|
memcpy(face_varying, refined_face_varying, sizeof(float) * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -320,6 +297,7 @@ class VolatileEvalOutput {
|
|||||||
src_data_ = SRC_VERTEX_BUFFER::Create(3, num_total_vertices, device_context_);
|
src_data_ = SRC_VERTEX_BUFFER::Create(3, num_total_vertices, device_context_);
|
||||||
src_varying_data_ = SRC_VERTEX_BUFFER::Create(3, num_total_vertices, device_context_);
|
src_varying_data_ = SRC_VERTEX_BUFFER::Create(3, num_total_vertices, device_context_);
|
||||||
patch_table_ = PATCH_TABLE::Create(patch_table, device_context_);
|
patch_table_ = PATCH_TABLE::Create(patch_table, device_context_);
|
||||||
|
patch_coords_ = NULL;
|
||||||
vertex_stencils_ = convertToCompatibleStencilTable<STENCIL_TABLE>(vertex_stencils,
|
vertex_stencils_ = convertToCompatibleStencilTable<STENCIL_TABLE>(vertex_stencils,
|
||||||
device_context_);
|
device_context_);
|
||||||
varying_stencils_ = convertToCompatibleStencilTable<STENCIL_TABLE>(varying_stencils,
|
varying_stencils_ = convertToCompatibleStencilTable<STENCIL_TABLE>(varying_stencils,
|
||||||
@@ -420,66 +398,74 @@ class VolatileEvalOutput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: P must point to a memory of at least float[3]*num_patch_coords.
|
void evalPatchCoord(const PatchCoord &patch_coord, float P[3])
|
||||||
void evalPatches(const PatchCoord *patch_coord, const int num_patch_coords, float *P)
|
|
||||||
{
|
{
|
||||||
RawDataWrapperBuffer<float> P_data(P);
|
StackAllocatedBuffer<6, 1> vertex_data;
|
||||||
// TODO(sergey): Support interleaved vertex-varying data.
|
// TODO(sergey): Varying data is interleaved in vertex array, so need to
|
||||||
BufferDescriptor P_desc(0, 3, 3);
|
// adjust stride if there is a varying data.
|
||||||
ConstPatchCoordWrapperBuffer patch_coord_buffer(patch_coord, num_patch_coords);
|
// BufferDescriptor vertex_desc(0, 3, 6);
|
||||||
|
BufferDescriptor vertex_desc(0, 3, 3);
|
||||||
|
SinglePatchCoordBuffer patch_coord_buffer(patch_coord);
|
||||||
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
||||||
evaluator_cache_, src_desc_, P_desc, device_context_);
|
evaluator_cache_, src_desc_, vertex_desc, device_context_);
|
||||||
EVALUATOR::EvalPatches(src_data_,
|
EVALUATOR::EvalPatches(src_data_,
|
||||||
src_desc_,
|
src_desc_,
|
||||||
&P_data,
|
&vertex_data,
|
||||||
P_desc,
|
vertex_desc,
|
||||||
patch_coord_buffer.GetNumVertices(),
|
patch_coord_buffer.GetNumVertices(),
|
||||||
&patch_coord_buffer,
|
&patch_coord_buffer,
|
||||||
patch_table_,
|
patch_table_,
|
||||||
eval_instance,
|
eval_instance,
|
||||||
device_context_);
|
device_context_);
|
||||||
|
const float *refined_vertices = vertex_data.BindCpuBuffer();
|
||||||
|
memcpy(P, refined_vertices, sizeof(float) * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: P, dPdu, dPdv must point to a memory of at least float[3]*num_patch_coords.
|
void evalPatchesWithDerivatives(const PatchCoord &patch_coord,
|
||||||
void evalPatchesWithDerivatives(const PatchCoord *patch_coord,
|
float P[3],
|
||||||
const int num_patch_coords,
|
float dPdu[3],
|
||||||
float *P,
|
float dPdv[3])
|
||||||
float *dPdu,
|
|
||||||
float *dPdv)
|
|
||||||
{
|
{
|
||||||
assert(dPdu);
|
StackAllocatedBuffer<6, 1> vertex_data, derivatives;
|
||||||
assert(dPdv);
|
// TODO(sergey): Varying data is interleaved in vertex array, so need to
|
||||||
RawDataWrapperBuffer<float> P_data(P);
|
// adjust stride if there is a varying data.
|
||||||
RawDataWrapperBuffer<float> dPdu_data(dPdu), dPdv_data(dPdv);
|
// BufferDescriptor vertex_desc(0, 3, 6);
|
||||||
// TODO(sergey): Support interleaved vertex-varying data.
|
BufferDescriptor vertex_desc(0, 3, 3);
|
||||||
BufferDescriptor P_desc(0, 3, 3);
|
BufferDescriptor du_desc(0, 3, 6), dv_desc(3, 3, 6);
|
||||||
BufferDescriptor dpDu_desc(0, 3, 3), pPdv_desc(0, 3, 3);
|
SinglePatchCoordBuffer patch_coord_buffer(patch_coord);
|
||||||
ConstPatchCoordWrapperBuffer patch_coord_buffer(patch_coord, num_patch_coords);
|
|
||||||
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
||||||
evaluator_cache_, src_desc_, P_desc, dpDu_desc, pPdv_desc, device_context_);
|
evaluator_cache_, src_desc_, vertex_desc, du_desc, dv_desc, device_context_);
|
||||||
EVALUATOR::EvalPatches(src_data_,
|
EVALUATOR::EvalPatches(src_data_,
|
||||||
src_desc_,
|
src_desc_,
|
||||||
&P_data,
|
&vertex_data,
|
||||||
P_desc,
|
vertex_desc,
|
||||||
&dPdu_data,
|
&derivatives,
|
||||||
dpDu_desc,
|
du_desc,
|
||||||
&dPdv_data,
|
&derivatives,
|
||||||
pPdv_desc,
|
dv_desc,
|
||||||
patch_coord_buffer.GetNumVertices(),
|
patch_coord_buffer.GetNumVertices(),
|
||||||
&patch_coord_buffer,
|
&patch_coord_buffer,
|
||||||
patch_table_,
|
patch_table_,
|
||||||
eval_instance,
|
eval_instance,
|
||||||
device_context_);
|
device_context_);
|
||||||
|
const float *refined_vertices = vertex_data.BindCpuBuffer();
|
||||||
|
memcpy(P, refined_vertices, sizeof(float) * 3);
|
||||||
|
if (dPdu != NULL || dPdv != NULL) {
|
||||||
|
const float *refined_derivatives = derivatives.BindCpuBuffer();
|
||||||
|
if (dPdu != NULL) {
|
||||||
|
memcpy(dPdu, refined_derivatives, sizeof(float) * 3);
|
||||||
|
}
|
||||||
|
if (dPdv != NULL) {
|
||||||
|
memcpy(dPdv, refined_derivatives + 3, sizeof(float) * 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: varying must point to a memory of at least float[3]*num_patch_coords.
|
void evalPatchVarying(const PatchCoord &patch_coord, float varying[3])
|
||||||
void evalPatchesVarying(const PatchCoord *patch_coord,
|
|
||||||
const int num_patch_coords,
|
|
||||||
float *varying)
|
|
||||||
{
|
{
|
||||||
RawDataWrapperBuffer<float> varying_data(varying);
|
StackAllocatedBuffer<6, 1> varying_data;
|
||||||
BufferDescriptor varying_desc(3, 3, 6);
|
BufferDescriptor varying_desc(3, 3, 6);
|
||||||
ConstPatchCoordWrapperBuffer patch_coord_buffer(patch_coord, num_patch_coords);
|
SinglePatchCoordBuffer patch_coord_buffer(patch_coord);
|
||||||
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
const EVALUATOR *eval_instance = OpenSubdiv::Osd::GetEvaluator<EVALUATOR>(
|
||||||
evaluator_cache_, src_varying_desc_, varying_desc, device_context_);
|
evaluator_cache_, src_varying_desc_, varying_desc, device_context_);
|
||||||
EVALUATOR::EvalPatchesVarying(src_varying_data_,
|
EVALUATOR::EvalPatchesVarying(src_varying_data_,
|
||||||
@@ -491,22 +477,23 @@ class VolatileEvalOutput {
|
|||||||
patch_table_,
|
patch_table_,
|
||||||
eval_instance,
|
eval_instance,
|
||||||
device_context_);
|
device_context_);
|
||||||
|
const float *refined_varying = varying_data.BindCpuBuffer();
|
||||||
|
memcpy(varying, refined_varying, sizeof(float) * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void evalPatchesFaceVarying(const int face_varying_channel,
|
void evalPatchFaceVarying(const int face_varying_channel,
|
||||||
const PatchCoord *patch_coord,
|
const PatchCoord &patch_coord,
|
||||||
const int num_patch_coords,
|
float face_varying[2])
|
||||||
float face_varying[2])
|
|
||||||
{
|
{
|
||||||
assert(face_varying_channel >= 0);
|
assert(face_varying_channel >= 0);
|
||||||
assert(face_varying_channel < face_varying_evaluators.size());
|
assert(face_varying_channel < face_varying_evaluators.size());
|
||||||
face_varying_evaluators[face_varying_channel]->evalPatches(
|
face_varying_evaluators[face_varying_channel]->evalPatch(patch_coord, face_varying);
|
||||||
patch_coord, num_patch_coords, face_varying);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SRC_VERTEX_BUFFER *src_data_;
|
SRC_VERTEX_BUFFER *src_data_;
|
||||||
SRC_VERTEX_BUFFER *src_varying_data_;
|
SRC_VERTEX_BUFFER *src_varying_data_;
|
||||||
|
PatchCoordBuffer *patch_coords_;
|
||||||
PATCH_TABLE *patch_table_;
|
PATCH_TABLE *patch_table_;
|
||||||
BufferDescriptor src_desc_;
|
BufferDescriptor src_desc_;
|
||||||
BufferDescriptor src_varying_desc_;
|
BufferDescriptor src_varying_desc_;
|
||||||
@@ -523,19 +510,6 @@ class VolatileEvalOutput {
|
|||||||
DEVICE_CONTEXT *device_context_;
|
DEVICE_CONTEXT *device_context_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void convertPatchCoordsToArray(const OpenSubdiv_PatchCoord *patch_coords,
|
|
||||||
const int num_patch_coords,
|
|
||||||
const OpenSubdiv::Far::PatchMap *patch_map,
|
|
||||||
StackOrHeapPatchCoordArray *array)
|
|
||||||
{
|
|
||||||
array->resize(num_patch_coords);
|
|
||||||
for (int i = 0; i < num_patch_coords; ++i) {
|
|
||||||
const PatchTable::PatchHandle *handle = patch_map->FindPatch(
|
|
||||||
patch_coords[i].ptex_face, patch_coords[i].u, patch_coords[i].v);
|
|
||||||
(array->data())[i] = PatchCoord(*handle, patch_coords[i].u, patch_coords[i].v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// Note: Define as a class instead of typedcef to make it possible
|
// Note: Define as a class instead of typedcef to make it possible
|
||||||
@@ -679,10 +653,10 @@ void CpuEvalOutputAPI::evaluateLimit(const int ptex_face_index,
|
|||||||
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
||||||
PatchCoord patch_coord(*handle, face_u, face_v);
|
PatchCoord patch_coord(*handle, face_u, face_v);
|
||||||
if (dPdu != NULL || dPdv != NULL) {
|
if (dPdu != NULL || dPdv != NULL) {
|
||||||
implementation_->evalPatchesWithDerivatives(&patch_coord, 1, P, dPdu, dPdv);
|
implementation_->evalPatchesWithDerivatives(patch_coord, P, dPdu, dPdv);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
implementation_->evalPatches(&patch_coord, 1, P);
|
implementation_->evalPatchCoord(patch_coord, P);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -697,7 +671,7 @@ void CpuEvalOutputAPI::evaluateVarying(const int ptex_face_index,
|
|||||||
assert(face_v <= 1.0f);
|
assert(face_v <= 1.0f);
|
||||||
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
||||||
PatchCoord patch_coord(*handle, face_u, face_v);
|
PatchCoord patch_coord(*handle, face_u, face_v);
|
||||||
implementation_->evalPatchesVarying(&patch_coord, 1, varying);
|
implementation_->evalPatchVarying(patch_coord, varying);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CpuEvalOutputAPI::evaluateFaceVarying(const int face_varying_channel,
|
void CpuEvalOutputAPI::evaluateFaceVarying(const int face_varying_channel,
|
||||||
@@ -712,24 +686,7 @@ void CpuEvalOutputAPI::evaluateFaceVarying(const int face_varying_channel,
|
|||||||
assert(face_v <= 1.0f);
|
assert(face_v <= 1.0f);
|
||||||
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
const PatchTable::PatchHandle *handle = patch_map_->FindPatch(ptex_face_index, face_u, face_v);
|
||||||
PatchCoord patch_coord(*handle, face_u, face_v);
|
PatchCoord patch_coord(*handle, face_u, face_v);
|
||||||
implementation_->evalPatchesFaceVarying(face_varying_channel, &patch_coord, 1, face_varying);
|
implementation_->evalPatchFaceVarying(face_varying_channel, patch_coord, face_varying);
|
||||||
}
|
|
||||||
|
|
||||||
void CpuEvalOutputAPI::evaluatePatchesLimit(const OpenSubdiv_PatchCoord *patch_coords,
|
|
||||||
const int num_patch_coords,
|
|
||||||
float *P,
|
|
||||||
float *dPdu,
|
|
||||||
float *dPdv)
|
|
||||||
{
|
|
||||||
StackOrHeapPatchCoordArray patch_coords_array;
|
|
||||||
convertPatchCoordsToArray(patch_coords, num_patch_coords, patch_map_, &patch_coords_array);
|
|
||||||
if (dPdu != NULL || dPdv != NULL) {
|
|
||||||
implementation_->evalPatchesWithDerivatives(
|
|
||||||
patch_coords_array.data(), num_patch_coords, P, dPdu, dPdv);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
implementation_->evalPatches(patch_coords_array.data(), num_patch_coords, P);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace opensubdiv_capi
|
} // namespace opensubdiv_capi
|
||||||
@@ -800,6 +757,7 @@ OpenSubdiv_EvaluatorInternal *openSubdiv_createEvaluatorInternal(
|
|||||||
}
|
}
|
||||||
// Face warying stencil.
|
// Face warying stencil.
|
||||||
vector<const StencilTable *> all_face_varying_stencils;
|
vector<const StencilTable *> all_face_varying_stencils;
|
||||||
|
#ifdef OPENSUBDIV_HAS_FVAR_EVALUATION
|
||||||
all_face_varying_stencils.reserve(num_face_varying_channels);
|
all_face_varying_stencils.reserve(num_face_varying_channels);
|
||||||
for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels;
|
for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels;
|
||||||
++face_varying_channel) {
|
++face_varying_channel) {
|
||||||
@@ -811,6 +769,7 @@ OpenSubdiv_EvaluatorInternal *openSubdiv_createEvaluatorInternal(
|
|||||||
all_face_varying_stencils.push_back(
|
all_face_varying_stencils.push_back(
|
||||||
StencilTableFactory::Create(*refiner, face_varying_stencil_options));
|
StencilTableFactory::Create(*refiner, face_varying_stencil_options));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Generate bi-cubic patch table for the limit surface.
|
// Generate bi-cubic patch table for the limit surface.
|
||||||
// TODO(sergey): Ideally we would want to expose end-cap settings via
|
// TODO(sergey): Ideally we would want to expose end-cap settings via
|
||||||
// C-API to make it more generic. Currently it matches old Blender's
|
// C-API to make it more generic. Currently it matches old Blender's
|
||||||
@@ -841,6 +800,7 @@ OpenSubdiv_EvaluatorInternal *openSubdiv_createEvaluatorInternal(
|
|||||||
varying_stencils = table;
|
varying_stencils = table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef OPENSUBDIV_HAS_FVAR_EVALUATION
|
||||||
for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels;
|
for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels;
|
||||||
++face_varying_channel) {
|
++face_varying_channel) {
|
||||||
const StencilTable *table = StencilTableFactory::AppendLocalPointStencilTableFaceVarying(
|
const StencilTable *table = StencilTableFactory::AppendLocalPointStencilTableFaceVarying(
|
||||||
@@ -853,6 +813,7 @@ OpenSubdiv_EvaluatorInternal *openSubdiv_createEvaluatorInternal(
|
|||||||
all_face_varying_stencils[face_varying_channel] = table;
|
all_face_varying_stencils[face_varying_channel] = table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Create OpenSubdiv's CPU side evaluator.
|
// Create OpenSubdiv's CPU side evaluator.
|
||||||
// TODO(sergey): Make it possible to use different evaluators.
|
// TODO(sergey): Make it possible to use different evaluators.
|
||||||
opensubdiv_capi::CpuEvalOutput *eval_output = new opensubdiv_capi::CpuEvalOutput(
|
opensubdiv_capi::CpuEvalOutput *eval_output = new opensubdiv_capi::CpuEvalOutput(
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include <opensubdiv/far/patchMap.h>
|
#include <opensubdiv/far/patchMap.h>
|
||||||
#include <opensubdiv/far/patchTable.h>
|
#include <opensubdiv/far/patchTable.h>
|
||||||
|
|
||||||
struct OpenSubdiv_PatchCoord;
|
|
||||||
struct OpenSubdiv_TopologyRefiner;
|
struct OpenSubdiv_TopologyRefiner;
|
||||||
|
|
||||||
namespace opensubdiv_capi {
|
namespace opensubdiv_capi {
|
||||||
@@ -115,18 +114,6 @@ class CpuEvalOutputAPI {
|
|||||||
float face_v,
|
float face_v,
|
||||||
float face_varying[2]);
|
float face_varying[2]);
|
||||||
|
|
||||||
// Batched evaluation of multiple input coordinates.
|
|
||||||
|
|
||||||
// Evaluate given ptex face at given bilinear coordinate.
|
|
||||||
// If derivatives are NULL, they will not be evaluated.
|
|
||||||
//
|
|
||||||
// NOTE: Output arrays must point to a memory of size float[3]*num_patch_coords.
|
|
||||||
void evaluatePatchesLimit(const OpenSubdiv_PatchCoord *patch_coords,
|
|
||||||
const int num_patch_coords,
|
|
||||||
float *P,
|
|
||||||
float *dPdu,
|
|
||||||
float *dPdv);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CpuEvalOutput *implementation_;
|
CpuEvalOutput *implementation_;
|
||||||
OpenSubdiv::Far::PatchMap *patch_map_;
|
OpenSubdiv::Far::PatchMap *patch_map_;
|
||||||
|
@@ -58,13 +58,6 @@ typedef enum OpenSubdiv_FVarLinearInterpolation {
|
|||||||
OSD_FVAR_LINEAR_INTERPOLATION_ALL,
|
OSD_FVAR_LINEAR_INTERPOLATION_ALL,
|
||||||
} OpenSubdiv_FVarLinearInterpolation;
|
} OpenSubdiv_FVarLinearInterpolation;
|
||||||
|
|
||||||
typedef struct OpenSubdiv_PatchCoord {
|
|
||||||
int ptex_face;
|
|
||||||
|
|
||||||
// Parametric location on patch.
|
|
||||||
float u, v;
|
|
||||||
} OpenSubdiv_PatchCoord;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -24,7 +24,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct OpenSubdiv_EvaluatorInternal;
|
struct OpenSubdiv_EvaluatorInternal;
|
||||||
struct OpenSubdiv_PatchCoord;
|
|
||||||
struct OpenSubdiv_TopologyRefiner;
|
struct OpenSubdiv_TopologyRefiner;
|
||||||
|
|
||||||
typedef struct OpenSubdiv_Evaluator {
|
typedef struct OpenSubdiv_Evaluator {
|
||||||
@@ -109,19 +108,6 @@ typedef struct OpenSubdiv_Evaluator {
|
|||||||
float face_v,
|
float face_v,
|
||||||
float face_varying[2]);
|
float face_varying[2]);
|
||||||
|
|
||||||
// Batched evaluation of multiple input coordinates.
|
|
||||||
|
|
||||||
// Evaluate limit surface.
|
|
||||||
// If derivatives are NULL, they will not be evaluated.
|
|
||||||
//
|
|
||||||
// NOTE: Output arrays must point to a memory of size float[3]*num_patch_coords.
|
|
||||||
void (*evaluatePatchesLimit)(struct OpenSubdiv_Evaluator *evaluator,
|
|
||||||
const struct OpenSubdiv_PatchCoord *patch_coords,
|
|
||||||
const int num_patch_coords,
|
|
||||||
float *P,
|
|
||||||
float *dPdu,
|
|
||||||
float *dPdv);
|
|
||||||
|
|
||||||
// Internal storage for the use in this module only.
|
// Internal storage for the use in this module only.
|
||||||
//
|
//
|
||||||
// This is where actual OpenSubdiv's evaluator is living.
|
// This is where actual OpenSubdiv's evaluator is living.
|
||||||
|
@@ -40,12 +40,6 @@ if(WITH_OPENVDB)
|
|||||||
${OPENVDB_DEFINITIONS}
|
${OPENVDB_DEFINITIONS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_definitions(
|
|
||||||
-DOPENVDB_STATICLIB
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
if(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-DOPENVDB_3_ABI_COMPATIBLE
|
-DOPENVDB_3_ABI_COMPATIBLE
|
||||||
|
@@ -30,14 +30,14 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts how many bytes is required for future utf-8 string using utf-16
|
* Counts how many bytes is requered for for future utf-8 string using utf-16
|
||||||
* \param string16: pointer to working utf-16 string
|
* \param string16: pointer to working utf-16 string
|
||||||
* \return How many bytes must be allocated includeng NULL.
|
* \return How many bytes must be allocated includeng NULL.
|
||||||
*/
|
*/
|
||||||
size_t count_utf_8_from_16(const wchar_t *string16);
|
size_t count_utf_8_from_16(const wchar_t *string16);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts how many wchar_t (two byte) is required for future utf-16 string using utf-8
|
* Counts how many wchar_t (two byte) is requered for for future utf-16 string using utf-8
|
||||||
* \param string8: pointer to working utf-8 string
|
* \param string8: pointer to working utf-8 string
|
||||||
* \return How many bytes must be allocated includeng NULL.
|
* \return How many bytes must be allocated includeng NULL.
|
||||||
*/
|
*/
|
||||||
|
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 2.4 MiB After Width: | Height: | Size: 2.6 MiB |
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user