diff --git a/openpgl/data/PathSegmentDataStorage.h b/openpgl/data/PathSegmentDataStorage.h index 8f1bfb49..9fe31df4 100644 --- a/openpgl/data/PathSegmentDataStorage.h +++ b/openpgl/data/PathSegmentDataStorage.h @@ -126,7 +126,7 @@ struct PathSegmentDataStorage PathSegmentData *next() { #if defined(OPENPGL_PATHSEGMENT_STORAGE_USE_ARRAY) - if (m_seg_idx + 1 <= m_max_seg_size) + if (m_seg_idx + 1 < m_max_seg_size) { m_seg_idx++; m_segmentStorage[m_seg_idx] = PathSegmentData(); @@ -146,7 +146,7 @@ struct PathSegmentDataStorage void addSegment(const PGLPathSegmentData &segment) { #if defined(OPENPGL_PATHSEGMENT_STORAGE_USE_ARRAY) - if (m_seg_idx + 1 <= m_max_seg_size) + if (m_seg_idx + 1 < m_max_seg_size) { m_seg_idx++; m_segmentStorage[m_seg_idx] = segment; @@ -159,7 +159,7 @@ struct PathSegmentDataStorage void push_back(const PathSegmentData &psData) { #if defined(OPENPGL_PATHSEGMENT_STORAGE_USE_ARRAY) - if (m_seg_idx + 1 <= m_max_seg_size) + if (m_seg_idx + 1 < m_max_seg_size) { m_seg_idx++; m_segmentStorage[m_seg_idx] = psData; diff --git a/openpgl/field/Field.h b/openpgl/field/Field.h index 117241f8..5bbe4850 100644 --- a/openpgl/field/Field.h +++ b/openpgl/field/Field.h @@ -369,7 +369,7 @@ struct Field void estimateSceneBounds(const SampleContainerInternal &samples) { m_sceneBounds.lower = Vector3(std::numeric_limits::max()); - m_sceneBounds.upper = Vector3(std::numeric_limits::min()); + m_sceneBounds.upper = Vector3(-std::numeric_limits::max()); m_isSceneBoundsSet = false; if (samples.size() > 0) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index fb74840a..3afedb3b 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -88,6 +88,9 @@ option(DOWNLOAD_ISPC "Download ISPC or use the one found in the system environme if (BUILD_TBB) set(TBB_VERSION "2021.13.0" CACHE STRING "TBB version to download") + if(APPLE) + set(BUILD_TBB_FROM_SOURCE ON) + endif() if (BUILD_TBB_FROM_SOURCE) if (TBB_VERSION VERSION_LESS 2021) message(FATAL_ERROR "Only TBB 2021 and later are supported when building TBB from source")