diff --git a/EyesightSrc/CMakeLists.txt b/EyesightSrc/CMakeLists.txt index e23cdcd8..34498c68 100644 --- a/EyesightSrc/CMakeLists.txt +++ b/EyesightSrc/CMakeLists.txt @@ -153,16 +153,17 @@ option_defaults_init( 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_CYCLES_OPENSUBDIV OFF) - set(_init_IMAGE_OPENEXR OFF) + # Restored for Linux build + #set(_init_CODEC_FFMPEG OFF) + #set(_init_CYCLES_OSL OFF) + #set(_init_CYCLES_OPENSUBDIV OFF) + #set(_init_IMAGE_OPENEXR OFF) set(_init_JACK OFF) - set(_init_OPENCOLLADA OFF) - set(_init_OPENCOLORIO OFF) + #set(_init_OPENCOLLADA OFF) + #set(_init_OPENCOLORIO OFF) set(_init_SDL OFF) - set(_init_FFTW3 OFF) - set(_init_OPENSUBDIV OFF) + #set(_init_FFTW3 OFF) + #set(_init_OPENSUBDIV OFF) elseif(WIN32) set(_init_JACK OFF) elseif(APPLE) @@ -260,9 +261,9 @@ if(NOT WITH_AUDASPACE) set(WITH_SYSTEM_AUDASPACE OFF) endif() -option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) +option(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON) if(UNIX AND NOT APPLE) - option(WITH_OPENMP_STATIC "Link OpenMP statically (only used by the release environment)" OFF) + option(WITH_OPENMP_STATIC "Link OpenMP statically (only used by the release environment)" ON) mark_as_advanced(WITH_OPENMP_STATIC) endif() @@ -405,13 +406,14 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" ON) #{{ robobeg: 2021-08-24 #option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF) #}} robobeg: 2021-08-24 -set(CYCLES_CUDA_BINARIES_ARCH sm_35 sm_37 sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") -set(CYCLES_CUDA_BINARIES_ARCH2 sm_30 sm_32 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") -set(CYCLES_CUDA_BINARIES_ARCH3 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") +# Simplify for Linux +set(CYCLES_CUDA_BINARIES_ARCH sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 sm_80 sm_86 sm_87 sm_89 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") +#set(CYCLES_CUDA_BINARIES_ARCH2 sm_30 sm_32 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") +#set(CYCLES_CUDA_BINARIES_ARCH3 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for with CUDA SDK") mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH) #{{ robobeg : 2018-07-02, CUDA TOOLKIT ADDITIONAL VERISONS -mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH2) -mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH3) +#mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH2) +#mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH3) #}} robobeg : 2018-07-02, CUDA TOOLKIT ADDITIONAL VERISONS unset(PLATFORM_DEFAULT) option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON) @@ -940,9 +942,13 @@ if(WITH_CYCLES) set(GIFLIB_LIBRARIES optimized ${GIFLIB_LIBPATH}/giflib5.lib debug ${GIFLIB_LIBPATH}/giflib5d.lib ) + elseif(UNIX AND NOT APPLE) + set(GIFLIB_LIBRARIES + optimized ${GIFLIB_LIBPATH}/libgif.a debug ${GIFLIB_LIBPATH}/libgif.a + ) elseif(APPLE) set(GIFLIB_LIBRARIES - optimized ${GIFLIB_LIBPATH}/giflib5.a debug $GIFLIB_LIBPATH}/giflib5d.a + optimized ${GIFLIB_LIBPATH}/giflib5.a debug ${GIFLIB_LIBPATH}/giflib5d.a ) endif() endif() @@ -954,7 +960,8 @@ if(WITH_CYCLES) find_package(ANTTWEAKBAR) if(NOT ANTTWEAKBAR_FOUND) message(WARNING "Using HARDCODED AntTweakBar locations") - set(ANTTWEAKBAR ${LIBDIR}/anttweakbar) + # dirty hack for Linux build + set(ANTTWEAKBAR /home/sylvain/BuildEyesight/libs/AntTweakBar) set(ANTTWEAKBAR_INCLUDE_DIR ${ANTTWEAKBAR}/include) set(ANTTWEAKBAR_INCLUDE_DIRS ${ANTTWEAKBAR}/include) set(ANTTWEAKBAR_LIBPATH ${ANTTWEAKBAR}/lib) @@ -962,6 +969,10 @@ if(WITH_CYCLES) set(ANTTWEAKBAR_LIBRARIES optimized ${ANTTWEAKBAR_LIBPATH}/AntTweakBarStatic.lib debug ${ANTTWEAKBAR_LIBPATH}/AntTweakBarStaticD.lib ) + elseif(UNIX AND NOT APPLE) + set(ANTTWEAKBAR_LIBRARIES + optimized ${ANTTWEAKBAR_LIBPATH}/libAntTweakBar.a debug ${ANTTWEAKBAR_LIBPATH}/libAntTweakBar.a + ) elseif(APPLE) set(ANTTWEAKBAR_LIBRARIES optimized ${ANTTWEAKBAR_LIBPATH}/libAntTweakBar.a debug ${ANTTWEAKBAR_LIBPATH}/libAntTweakBarD.a @@ -1540,6 +1551,14 @@ if(CMAKE_COMPILER_IS_GNUCC) ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable) endif() + # remove annoying warnings (bad devs!) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ENDIF_LABELS -Wno-endif-labels) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations) + ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation) + ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_ENDIF_LABELS -Wno-endif-labels) + ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations) + ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation) + elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to not fail all tests due presence of -fopenmp ! @@ -1658,7 +1677,8 @@ endif() if(WITH_CXX11) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") # TODO(sergey): Do we want c++11 or gnu-c++11 here? - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + # needs c++14 for recent libs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") elseif(MSVC) # Nothing special is needed, C++11 features are available by default. else() diff --git a/EyesightSrc/build_files/cmake/Modules/FindOpenEXR.cmake b/EyesightSrc/build_files/cmake/Modules/FindOpenEXR.cmake index 41e60a75..a8d04c5f 100644 --- a/EyesightSrc/build_files/cmake/Modules/FindOpenEXR.cmake +++ b/EyesightSrc/build_files/cmake/Modules/FindOpenEXR.cmake @@ -38,11 +38,13 @@ ENDIF() SET(_openexr_libs_ver_init "2.0") SET(_openexr_FIND_COMPONENTS - Half + #Half # new OpenEXR Iex - IlmImf - IlmThread + #IlmImf # new OpenEXR + #IlmThread # new OpenEXR Imath + OpenEXR # new OpenEXR + IlmThread # new OpenEXR ) SET(_openexr_SEARCH_DIRS diff --git a/EyesightSrc/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/EyesightSrc/build_files/cmake/Modules/FindPythonLibsUnix.cmake index 9d79bdd7..025a755c 100644 --- a/EyesightSrc/build_files/cmake/Modules/FindPythonLibsUnix.cmake +++ b/EyesightSrc/build_files/cmake/Modules/FindPythonLibsUnix.cmake @@ -38,7 +38,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "") SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR}) ENDIF() -SET(PYTHON_VERSION 3.5 CACHE STRING "Python Version (major and minor only)") +SET(PYTHON_VERSION 3.12 CACHE STRING "Python Version (major and minor only)") MARK_AS_ADVANCED(PYTHON_VERSION) diff --git a/EyesightSrc/build_files/cmake/platform/platform_unix.cmake b/EyesightSrc/build_files/cmake/platform/platform_unix.cmake index d92c70b0..e63e86d5 100644 --- a/EyesightSrc/build_files/cmake/platform/platform_unix.cmake +++ b/EyesightSrc/build_files/cmake/platform/platform_unix.cmake @@ -142,7 +142,8 @@ endif() #{{ robobeg: 2018-05-21 -set(FFMPEG /usr CACHE PATH "FFMPEG Directory") +# dirty hack for Linux build +set(FFMPEG /home/sylvain/Build/libs/ffmpeg_inst CACHE PATH "FFMPEG Directory") # lame, but until we have proper find module for ffmpeg set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) @@ -156,7 +157,7 @@ if(WITH_CODEC_FFMPEG) #{{ robobeg: 2018-05-21 #set(FFMPEG /usr CACHE PATH "FFMPEG Directory") #}} robobeg: 2018-05-21 - set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") + set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale swresample avfilter CACHE STRING "FFMPEG Libraries") mark_as_advanced(FFMPEG) #{{ robobeg: 2018-05-21 diff --git a/EyesightSrc/intern/cycles/CMakeLists.txt b/EyesightSrc/intern/cycles/CMakeLists.txt index c5d93040..b89d8b8e 100644 --- a/EyesightSrc/intern/cycles/CMakeLists.txt +++ b/EyesightSrc/intern/cycles/CMakeLists.txt @@ -304,11 +304,12 @@ include_directories(../atomic) # Warnings if(CMAKE_COMPILER_IS_GNUCXX) - ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion") - ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion") +# too many such errors +# ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion") +# ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion") ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_no_error_unused_macros "-Wno-error=unused-macros") - unset(_has_cxxflag_float_conversion) - unset(_has_cxxflag_double_promotion) +# unset(_has_cxxflag_float_conversion) +# unset(_has_cxxflag_double_promotion) unset(_has_no_error_unused_macros) endif() diff --git a/EyesightSrc/intern/cycles/app/eyesight_standalone.cpp b/EyesightSrc/intern/cycles/app/eyesight_standalone.cpp index a2f75477..4f255740 100644 --- a/EyesightSrc/intern/cycles/app/eyesight_standalone.cpp +++ b/EyesightSrc/intern/cycles/app/eyesight_standalone.cpp @@ -3535,7 +3535,7 @@ bool Cycles_Standalone::SaveImage(const char* pszFilepath, PassType eLayer, bool bRet = false; std::string strTmpPath = path_join(path_join(strCommonDir, strTmpDir), strTmpFile); - ImageOutput *out = ImageOutput::create(strTmpPath.c_str()); + ImageOutput::unique_ptr out = ImageOutput::create(strTmpPath.c_str()); if (out != nullptr) { int specchannels = channels; @@ -3553,13 +3553,11 @@ bool Cycles_Standalone::SaveImage(const char* pszFilepath, PassType eLayer, if (out->open(strTmpPath.c_str(), spec) == false) { - ImageOutput::destroy(out); goto out; } bool bWriteImage = out->write_image(format.channel_type, (char*)vecbDisplayBuffer.data() , channels*elmsize, AutoStride, AutoStride); - ImageOutput::destroy(out); if (bWriteImage == false) { diff --git a/EyesightSrc/intern/cycles/collada/collada_DocumentImporter.cpp b/EyesightSrc/intern/cycles/collada/collada_DocumentImporter.cpp index 77f1d94b..0ba15569 100644 --- a/EyesightSrc/intern/cycles/collada/collada_DocumentImporter.cpp +++ b/EyesightSrc/intern/cycles/collada/collada_DocumentImporter.cpp @@ -19,7 +19,7 @@ #include "COLLADAFWIndexList.h" #include "COLLADAFWLibraryNodes.h" #include "COLLADAFWLight.h" -#include "COLLADAFWLookAt.h" +#include "COLLADAFWLookat.h" #include "COLLADAFWMatrix.h" #include "COLLADAFWMeshPrimitiveWithFaceVertexCount.h" #include "COLLADAFWNode.h" diff --git a/EyesightSrc/intern/cycles/movie/movie_writeavi.cpp b/EyesightSrc/intern/cycles/movie/movie_writeavi.cpp index 8f5434dd..9ddfb8d3 100644 --- a/EyesightSrc/intern/cycles/movie/movie_writeavi.cpp +++ b/EyesightSrc/intern/cycles/movie/movie_writeavi.cpp @@ -418,7 +418,7 @@ bool movie_check_format_supported(ustring uFormat) #ifdef WITH_FFMPEG return movie_ffmpeg_check_format_supported(uFormat); #else // - return ustring(); + return false; #endif //WITH_FFMPEG } @@ -430,7 +430,7 @@ bool movie_check_format_codec_compatible(ustring uFormat, ustring uCodec) #ifdef WITH_FFMPEG return movie_ffmpeg_check_format_codec_compatible(uFormat, uCodec); #else // - return ustring(); + return false; #endif //WITH_FFMPEG } diff --git a/EyesightSrc/intern/cycles/movie/movie_writeffmpeg.cpp b/EyesightSrc/intern/cycles/movie/movie_writeffmpeg.cpp index 2d73384b..402f5a98 100644 --- a/EyesightSrc/intern/cycles/movie/movie_writeffmpeg.cpp +++ b/EyesightSrc/intern/cycles/movie/movie_writeffmpeg.cpp @@ -1544,7 +1544,7 @@ int BKE_ffmpeg_append(void *context_v, int frame, int *pixels) fs::path to_path = fs::path(std::string(name)); boost::system::error_code er; fs::rename(tmp_path, to_path, er); - if (er != 0) + if (er != boost::system::errc::success) return false; } diff --git a/EyesightSrc/intern/cycles/postprocess/postprocess_postprocess.cpp b/EyesightSrc/intern/cycles/postprocess/postprocess_postprocess.cpp index 0b8a844e..42a126fb 100644 --- a/EyesightSrc/intern/cycles/postprocess/postprocess_postprocess.cpp +++ b/EyesightSrc/intern/cycles/postprocess/postprocess_postprocess.cpp @@ -522,7 +522,7 @@ void Postprocess::findOutputExecutionGroup(vector *result) con template -static bool _file_load_image(PostprocessImage *img, TypeDesc::BASETYPE FileFormat, ImageDataType type, ImageInput *in +static bool _file_load_image(PostprocessImage *img, TypeDesc::BASETYPE FileFormat, ImageDataType type, ImageInput::unique_ptr const&in , int width, int height, int depth, int components) { @@ -685,7 +685,7 @@ const PostprocessImageBase* Postprocess::add_image(const string& filename) return nullptr; /* load image from file through OIIO */ - ImageInput* in = ImageInput::create(strFilename); + ImageInput::unique_ptr in = ImageInput::create(strFilename); if (in == nullptr) return nullptr; @@ -694,7 +694,6 @@ const PostprocessImageBase* Postprocess::add_image(const string& filename) if (!in->open(strFilename, spec)) { - delete in; return nullptr; } @@ -879,7 +878,6 @@ const PostprocessImageBase* Postprocess::add_image(const string& filename) } m_vecImages.push_back(pImageBase); - delete in; return pImageBase; } diff --git a/EyesightSrc/intern/cycles/render/attribute.cpp b/EyesightSrc/intern/cycles/render/attribute.cpp index 8cfbb3b8..544b9a6e 100644 --- a/EyesightSrc/intern/cycles/render/attribute.cpp +++ b/EyesightSrc/intern/cycles/render/attribute.cpp @@ -674,7 +674,7 @@ void AttributeRequestSet::add(AttributeRequestSet& reqs) void AttributeRequestSet::add_standard(ustring name) { - if(!name) { + if(name.empty()) { return; } diff --git a/EyesightSrc/intern/cycles/render/buffers.cpp b/EyesightSrc/intern/cycles/render/buffers.cpp index b8dff949..a39fbcc5 100644 --- a/EyesightSrc/intern/cycles/render/buffers.cpp +++ b/EyesightSrc/intern/cycles/render/buffers.cpp @@ -1095,7 +1095,7 @@ void DisplayBuffer::write(const string& filename) uchar4 *pixels = rgba_byte.copy_from_device(0, w, h); /* write image */ - ImageOutput *out = ImageOutput::create(filename); + ImageOutput::unique_ptr out = ImageOutput::create(filename); ImageSpec spec(w, h, 4, TypeDesc::UINT8); out->open(filename, spec); @@ -1108,8 +1108,6 @@ void DisplayBuffer::write(const string& filename) AutoStride); out->close(); - - delete out; } #endif /* WITH_CYCLES_OPENGL */ diff --git a/EyesightSrc/intern/cycles/render/image.cpp b/EyesightSrc/intern/cycles/render/image.cpp index d70eeb92..011e3cf0 100644 --- a/EyesightSrc/intern/cycles/render/image.cpp +++ b/EyesightSrc/intern/cycles/render/image.cpp @@ -153,7 +153,7 @@ bool ImageManager::get_image_metadata(const string& filename, return false; } - ImageInput *in = ImageInput::create(filename); + ImageInput::unique_ptr in = ImageInput::create(filename); if(!in) { return false; @@ -161,7 +161,6 @@ bool ImageManager::get_image_metadata(const string& filename, ImageSpec spec; if(!in->open(filename, spec)) { - delete in; return false; } @@ -225,7 +224,6 @@ bool ImageManager::get_image_metadata(const string& filename, } in->close(); - delete in; return true; } @@ -491,7 +489,7 @@ void ImageManager::tag_reload_image(const string& filename, } bool ImageManager::file_load_image_generic(Image *img, - ImageInput **in, + ImageInput::unique_ptr *in, int &width, int &height, int &depth, @@ -519,7 +517,6 @@ bool ImageManager::file_load_image_generic(Image *img, config.attribute("oiio:UnassociatedAlpha", 1); if(!(*in)->open(img->filename, spec, config)) { - delete *in; *in = NULL; return false; } @@ -547,7 +544,6 @@ bool ImageManager::file_load_image_generic(Image *img, if(!(components >= 1 && components <= 4)) { if(*in) { (*in)->close(); - delete *in; *in = NULL; } @@ -568,7 +564,7 @@ bool ImageManager::file_load_image(Image *img, //}} azureheaven, 2019-01-23, Adaptive Image Resolution device_vector& tex_img) { - ImageInput *in = NULL; + ImageInput::unique_ptr in = NULL; int width, height, depth, components; if(!file_load_image_generic(img, &in, width, height, depth, components)) { return false; @@ -629,7 +625,6 @@ bool ImageManager::file_load_image(Image *img, } cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4; in->close(); - delete in; } else { if(FileFormat == TypeDesc::FLOAT) { diff --git a/EyesightSrc/intern/cycles/render/image.h b/EyesightSrc/intern/cycles/render/image.h index 8bb170c2..55af5c81 100644 --- a/EyesightSrc/intern/cycles/render/image.h +++ b/EyesightSrc/intern/cycles/render/image.h @@ -148,7 +148,7 @@ private: void *osl_texture_system; bool file_load_image_generic(Image *img, - ImageInput **in, + ImageInput::unique_ptr *in, int &width, int &height, int &depth, diff --git a/EyesightSrc/intern/cycles/util/util_bli_path_util.cpp b/EyesightSrc/intern/cycles/util/util_bli_path_util.cpp index dab635a7..db8f2cbe 100644 --- a/EyesightSrc/intern/cycles/util/util_bli_path_util.cpp +++ b/EyesightSrc/intern/cycles/util/util_bli_path_util.cpp @@ -656,7 +656,7 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char */ bool BLI_parent_dir(char *path) { - const char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */ + const char parent_dir[] = {'.', '.', BLI_SEP, '\0'}; /* "../" or "..\\" */ char tmp[FILE_MAX + 4]; BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir); @@ -1539,8 +1539,8 @@ void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__re size_t dirlen = BLI_strnlen(dst, maxlen); /* inline BLI_add_slash */ - if ((dirlen > 0) && (dst[dirlen - 1] != SEP)) { - dst[dirlen++] = SEP; + if ((dirlen > 0) && (dst[dirlen - 1] != BLI_SEP)) { + dst[dirlen++] = BLI_SEP; dst[dirlen] = '\0'; } @@ -1576,8 +1576,8 @@ void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__r } /* inline BLI_add_slash */ - if ((dirlen > 0) && !ELEM(dst[dirlen - 1], SEP, ALTSEP)) { - dst[dirlen++] = SEP; + if ((dirlen > 0) && !ELEM(dst[dirlen - 1], BLI_SEP, ALTBLI_SEP)) { + dst[dirlen++] = BLI_SEP; dst[dirlen] = '\0'; } @@ -1592,7 +1592,7 @@ void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__r * Join multiple strings into a path, ensuring only a single path separator between each, * and trailing slash is kept. * - * \note If you want a trailing slash, add ``SEP_STR`` as the last path argument, + * \note If you want a trailing slash, add ``BLI_SEP_STR`` as the last path argument, * duplicate slashes will be cleaned up. */ size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *path, ...) @@ -1612,7 +1612,7 @@ size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *pat bool has_trailing_slash = false; if (ofs != 0) { size_t len = ofs; - while ((len != 0) && ELEM(path[len - 1], SEP, ALTSEP)) { + while ((len != 0) && ELEM(path[len - 1], BLI_SEP, ALTBLI_SEP)) { len -= 1; } if (len != 0) { @@ -1626,19 +1626,19 @@ size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *pat while ((path = (const char *) va_arg(args, const char *))) { has_trailing_slash = false; const char *path_init = path; - while (ELEM(path[0], SEP, ALTSEP)) { + while (ELEM(path[0], BLI_SEP, ALTBLI_SEP)) { path++; } size_t len = strlen(path); if (len != 0) { - while ((len != 0) && ELEM(path[len - 1], SEP, ALTSEP)) { + while ((len != 0) && ELEM(path[len - 1], BLI_SEP, ALTBLI_SEP)) { len -= 1; } if (len != 0) { /* the very first path may have a slash at the end */ - if (ofs && !ELEM(dst[ofs - 1], SEP, ALTSEP)) { - dst[ofs++] = SEP; + if (ofs && !ELEM(dst[ofs - 1], BLI_SEP, ALTBLI_SEP)) { + dst[ofs++] = BLI_SEP; if (ofs == dst_last) { break; } @@ -1661,8 +1661,8 @@ size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *pat va_end(args); if (has_trailing_slash) { - if ((ofs != dst_last) && (ofs != 0) && (ELEM(dst[ofs - 1], SEP, ALTSEP) == 0)) { - dst[ofs++] = SEP; + if ((ofs != dst_last) && (ofs != 0) && (ELEM(dst[ofs - 1], BLI_SEP, ALTBLI_SEP) == 0)) { + dst[ofs++] = BLI_SEP; } } @@ -1701,7 +1701,7 @@ bool BLI_path_name_at_index(const char *path, const int index, int *r_offset, in int i = 0; while (true) { const char c = path[i]; - if (ELEM(c, SEP, ALTSEP, '\0')) { + if (ELEM(c, BLI_SEP, ALTBLI_SEP, '\0')) { if (prev + 1 != i) { prev += 1; if (index_step == index) { @@ -1728,7 +1728,7 @@ bool BLI_path_name_at_index(const char *path, const int index, int *r_offset, in int i = prev - 1; while (true) { const char c = i >= 0 ? path[i] : '\0'; - if (ELEM(c, SEP, ALTSEP, '\0')) { + if (ELEM(c, BLI_SEP, ALTBLI_SEP, '\0')) { if (prev - 1 != i) { i += 1; if (index_step == index) { @@ -1915,8 +1915,8 @@ const char *BLI_last_slash(const char *string) int BLI_add_slash(char *string) { int len = strlen(string); - if (len == 0 || string[len - 1] != SEP) { - string[len] = SEP; + if (len == 0 || string[len - 1] != BLI_SEP) { + string[len] = BLI_SEP; string[len + 1] = '\0'; return len + 1; } @@ -1930,7 +1930,7 @@ void BLI_del_slash(char *string) { int len = strlen(string); while (len) { - if (string[len - 1] == SEP) { + if (string[len - 1] == BLI_SEP) { string[len - 1] = '\0'; len--; } diff --git a/EyesightSrc/intern/cycles/util/util_bli_path_util.h b/EyesightSrc/intern/cycles/util/util_bli_path_util.h index eb511590..e5cc6917 100644 --- a/EyesightSrc/intern/cycles/util/util_bli_path_util.h +++ b/EyesightSrc/intern/cycles/util/util_bli_path_util.h @@ -117,15 +117,15 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char #endif #ifdef WIN32 -# define SEP '\\' -# define ALTSEP '/' -# define SEP_STR "\\" -# define ALTSEP_STR "/" +# define BLI_SEP '\\' +# define ALTBLI_SEP '/' +# define BLI_SEP_STR "\\" +# define ALTBLI_SEP_STR "/" #else -# define SEP '/' -# define ALTSEP '\\' -# define SEP_STR "/" -# define ALTSEP_STR "\\" +# define BLI_SEP '/' +# define ALTBLI_SEP '\\' +# define BLI_SEP_STR "/" +# define ALTBLI_SEP_STR "\\" #endif /* Parent and current dir helpers. */ diff --git a/EyesightSrc/intern/cycles/util/util_math_float3.h b/EyesightSrc/intern/cycles/util/util_math_float3.h index a0a62ae9..c8a3d029 100644 --- a/EyesightSrc/intern/cycles/util/util_math_float3.h +++ b/EyesightSrc/intern/cycles/util/util_math_float3.h @@ -320,6 +320,14 @@ ccl_device_inline float len_squared(const float3 a) return dot(a, a); } +// missing in CUDA toolkit 12.0 +#ifdef __KERNEL_CUDA__ +ccl_device_inline float saturate(float a) +{ + return max(0.0f, min(1.0f, a)); +} +#endif + ccl_device_inline float3 saturate3(float3 a) { return make_float3(saturate(a.x), saturate(a.y), saturate(a.z)); diff --git a/EyesightSrc/intern/cycles/util/util_xml.h b/EyesightSrc/intern/cycles/util/util_xml.h index 1180693a..cb82397b 100644 --- a/EyesightSrc/intern/cycles/util/util_xml.h +++ b/EyesightSrc/intern/cycles/util/util_xml.h @@ -30,8 +30,8 @@ CCL_NAMESPACE_BEGIN //}} robobeg: 2018-01-22 //#ifdef WITH_SYSTEM_PUGIXML -//# define PUGIXML_NAMESPACE pugi -# define PUGIXML_NAMESPACE OIIO_NAMESPACE::pugi +# define PUGIXML_NAMESPACE pugi +//# define PUGIXML_NAMESPACE OIIO_NAMESPACE::pugi //#else //# define PUGIXML_NAMESPACE OIIO_NAMESPACE::pugi //#endif -- 2.43.0