Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

enable_language(CXX)
include(GNUInstallDirs)

## Establish project ##

project(openpgl VERSION 0.8.0 LANGUAGES C CXX)

enable_language(CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(openpgl_macros)

Expand Down
4 changes: 4 additions & 0 deletions openpgl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ else()
list(APPEND OPENPGL_COMMON_OPTIONS -fno-strict-aliasing) # disables strict aliasing rules
list(APPEND OPENPGL_COMMON_OPTIONS -fno-tree-vectorize) # disable auto vectorizer

list(APPEND OPENPGL_COMMON_OPTIONS -Wunused-parameter)
list(APPEND OPENPGL_COMMON_OPTIONS -Wsign-compare)
#list(APPEND OPENPGL_COMMON_OPTIONS -Wdeprecated-copy-with-user-provided-copy)

if (OPENPGL_ARM)
list(APPEND OPENPGL_COMMON_OPTIONS -fsigned-char) # treat 'char' as 'signed char'
list(APPEND OPENPGL_COMMON_OPTIONS -flax-vector-conversions) # allow lax vector type conversions
Expand Down
6 changes: 3 additions & 3 deletions openpgl/directional/dqt/DQT.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct DirectionalQuadtree
return pdf;
}

void performRelativeParallaxShift(const Vector3 &shiftDirection) {};
void performRelativeParallaxShift(const Vector3 &) {};

const std::string toString() const
{
Expand Down Expand Up @@ -110,15 +110,15 @@ struct DirectionalQuadtree
is.read(reinterpret_cast<char *>(nodes.data()), size * sizeof(nodes[0]));
};

void decay(const float alpha) {};
void decay(const float) {};

size_t getNumComponents() const
{
return nodes.size();
}

// TODO: Needs to be implmented
bool operator==(const DirectionalQuadtree &b) const
bool operator==(const DirectionalQuadtree &) const
{
return true;
}
Expand Down
15 changes: 8 additions & 7 deletions openpgl/directional/dqt/DQTFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DirectionalQuadtreeFactory
stream.read(reinterpret_cast<char *>(this), sizeof(*this));
};

bool operator==(const Configuration &b) const
bool operator==(const Configuration &) const
{
return true;
}
Expand All @@ -95,7 +95,8 @@ class DirectionalQuadtreeFactory
// TODO this is very ugly
struct SufficientStatistics
{
void applyParallaxShift(const Distribution &dist, const Vector3 shift) {}
void applyParallaxShift(const Distribution &, const Vector3) {}

bool isValid() const
{
return true;
Expand Down Expand Up @@ -160,7 +161,7 @@ class DirectionalQuadtreeFactory
};

// TODO: Needs to be implmented
bool operator==(const Statistics &b) const
bool operator==(const Statistics &) const
{
return true;
}
Expand All @@ -174,7 +175,7 @@ class DirectionalQuadtreeFactory
uint32_t numMerges = 0;
};

void prepareSamples(SampleData *samples, const size_t numSamples, const SampleStatistics &sampleStatistics, const Configuration &cfg) const {}
void prepareSamples(SampleData *, const size_t , const SampleStatistics &, const Configuration &) const {}

void updateFluenceEstimate(Distribution &dist, const SampleData *samples, const size_t numSamples, const size_t numZeroValueSamples,
const SampleStatistics &sampleStatistics) const
Expand Down Expand Up @@ -274,7 +275,7 @@ class DirectionalQuadtreeFactory
// Compute sampling and split weights
traverse(
ctx.stats->nodes.data(),
[&](uint32_t i, Rect<float> &rect) {
[&]([[maybe_unused]] uint32_t i, [[maybe_unused]] Rect<float> &rect) {
return true; // We want to traverse all nodes
},
[&](uint32_t i, Rect<float> &rect) {
Expand Down Expand Up @@ -357,12 +358,12 @@ class DirectionalQuadtreeFactory
// TODO switch to disable this
traverse(
old_nodes.data(),
[&](uint32_t i, Rect<float> &rect) {
[&](uint32_t i, [[maybe_unused]] Rect<float> &rect) {
if (old_nodes[i].offsetChildren > 0)
ctx.fitStats->numMerges++;
return true;
},
[&](uint32_t i, Rect<float> &rect) {
[&]([[maybe_unused]] uint32_t i, [[maybe_unused]] Rect<float> &rect) {
},
i, rect);
}
Expand Down
4 changes: 2 additions & 2 deletions openpgl/directional/dqt/DQTSurfaceSamplingDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ struct DQTSurfaceSamplingDistribution : public ISurfaceSamplingDistribution

virtual ~DQTSurfaceSamplingDistribution() override{};

virtual void init(const void *distribution, Point3 samplePosition) override
virtual void init(const void *distribution, Point3) override
{
this->distribution = *(TDirectionalQuadtree *)distribution;
};

inline void applyCosineProduct(const Vector3 &normal) override
inline void applyCosineProduct(const Vector3 &) override
{
// not supported by quadtree
return;
Expand Down
4 changes: 2 additions & 2 deletions openpgl/directional/dqt/DQTVolumeSamplingDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct DQTVolumeSamplingDistribution : public IVolumeSamplingDistribution

virtual ~DQTVolumeSamplingDistribution() override{};

virtual void init(const void *distribution, Point3 samplePosition) override
virtual void init(const void *distribution, Point3) override
{
this->distribution = *(TDirectionalQuadtree *)distribution;
};
Expand Down Expand Up @@ -67,7 +67,7 @@ struct DQTVolumeSamplingDistribution : public IVolumeSamplingDistribution

inline void clear() override {};

inline void applySingleLobeHenyeyGreensteinProduct(const Vector3 &dir, const float meanCosine) override
inline void applySingleLobeHenyeyGreensteinProduct(const Vector3 &, const float) override
{
// not supported by quadtree
return;
Expand Down
2 changes: 1 addition & 1 deletion openpgl/directional/dqt/SphereToSquare.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SphereToSquareCylindrical
return embree::clamp(Vector3(sinTheta * std::cos(phi), sinTheta * std::sin(phi), cosTheta), Vector3(-1), Vector3(1));
}

static float jacobian(const Vector2 &point_)
static float jacobian(const Vector2 &)
{
return 4.0f * M_PI_F;
}
Expand Down
2 changes: 1 addition & 1 deletion openpgl/directional/dqt/Traversal.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void splat(TNode *nodes, float footprintFactor, Vector2 point, F apply)
apply(node, nodeArea / filterArea);
return true;
},
[&](uint32_t i, Rect<float> rect) {
[&]([[maybe_unused]] uint32_t i, [[maybe_unused]] Rect<float> rect) {
});
}
else
Expand Down
2 changes: 1 addition & 1 deletion openpgl/directional/vmm/AdaptiveSplitandMergeFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void AdaptiveSplitAndMergeFactory<TVMMDistribution>::prepareSamples(SampleData *

template <class TVMMDistribution>
void AdaptiveSplitAndMergeFactory<TVMMDistribution>::fit(VMM &vmm, Statistics &stats, const SampleData *samples, const size_t numSamples, const Configuration &cfg,
FittingStatistics &fitStats) const
FittingStatistics &) const
{
const size_t numComponents = cfg.weightedEMCfg.initK;
stats.clear(numComponents);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ void ParallaxAwareVonMisesFisherMixture<VecSize, maxComponents, UseParallaxCompe
}

template <int VecSize, int maxComponents, bool UseParallaxCompensation>
void ParallaxAwareVonMisesFisherMixture<VecSize, maxComponents, UseParallaxCompensation>::decay(float alpha)
void ParallaxAwareVonMisesFisherMixture<VecSize, maxComponents, UseParallaxCompensation>::decay([[maybe_unused]] float alpha)
{
#ifdef OPENPGL_RADIANCE_CACHES
_numFluenceSamples *= alpha;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ void ParallaxAwareVonMisesFisherWeightedEMFactory<TVMMDistribution>::reprojectSa

template <class TVMMDistribution>
void ParallaxAwareVonMisesFisherWeightedEMFactory<TVMMDistribution>::prepareSamples(SampleData *samples, const size_t numSamples, const SampleStatistics &sampleStatistics,
const Configuration &cfg) const
const Configuration &) const
{
if (TVMMDistribution::ParallaxCompensation)
{
Expand Down
2 changes: 0 additions & 2 deletions openpgl/directional/vmm/VMMChiSquareComponentSplitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ bool VonMisesFisherChiSquareComponentSplitter<TVMMFactory>::SplitComponent(VMM &
ComponentSplitinfo splitInfo;
const div_t tmpK = div(idx, static_cast<int>(VMM::VectorSize));

float numAssignedSamples = splitStats.sumAssignedSamples[tmpK.quot][tmpK.rem];

float inv_sumWeights = embree::rcp(splitStats.sumWeights[tmpK.quot][tmpK.rem]);
OPENPGL_ASSERT(embree::isvalid(inv_sumWeights));
splitInfo.mean = Vector2(splitStats.splitMeans[tmpK.quot].x[tmpK.rem], splitStats.splitMeans[tmpK.quot].y[tmpK.rem]);
Expand Down
5 changes: 3 additions & 2 deletions openpgl/field/Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ struct Field
{
OPENPGL_ASSERT(knnTree.isBuild());
const uint32_t regionIdx = knnTree.sampleClosestRegionIdx(p, sample);
id = regionIdx;
return regionIdx;
}

Expand Down Expand Up @@ -433,7 +434,7 @@ struct Field
}
}

inline void fitRegions(SampleContainerInternal &samples, ZeroValueSampleContainerInternal &zeroValueSamples)
inline void fitRegions(SampleContainerInternal &samples, [[maybe_unused]] ZeroValueSampleContainerInternal &zeroValueSamples)
{
size_t nGuidingRegions = m_regionStorageContainer.size();
#if defined(OPENPGL_SHOW_PRINT_OUTS)
Expand Down Expand Up @@ -505,7 +506,7 @@ struct Field
OPENPGL_ASSERT(this->isValid());
}

void updateRegions(SampleContainerInternal &samples, ZeroValueSampleContainerInternal &zeroValueSamples)
void updateRegions(SampleContainerInternal &samples, [[maybe_unused]] ZeroValueSampleContainerInternal &zeroValueSamples)
{
size_t nGuidingRegions = m_regionStorageContainer.size();
#if defined(OPENPGL_SHOW_PRINT_OUTS)
Expand Down
2 changes: 1 addition & 1 deletion openpgl/field/SurfaceVolumeField.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ struct SurfaceVolumeField : public ISurfaceVolumeField
m_volumeField.deserialize(is);
}

virtual bool validate(const bool checkSurface, const bool checkVolume) const override
virtual bool validate([[maybe_unused]] const bool checkSurface, [[maybe_unused]] const bool checkVolume) const override
{
bool valid = true;
if (m_surfaceField.isInitialized())
Expand Down
2 changes: 1 addition & 1 deletion openpgl/spatial/Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct Region : public IRegion
}
*/

const TDistribution *getDistribution(Point3 samplePosition) const
const TDistribution *getDistribution(Point3) const
{
return &distribution;
}
Expand Down
2 changes: 0 additions & 2 deletions openpgl/spatial/kdtree/KDTreeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ struct KDTreePartitionBuilder
BBox bondsLeftRight[2];
// sample bounds for the splitting of a leaf node
BBox tmpBounds = bounds;
bool nodeSplit = false;

if (node.isLeaf())
{
Expand All @@ -347,7 +346,6 @@ struct KDTreePartitionBuilder
bool validBoundRange = mergedSampleStats.hasValidBoundRange();
if (validBoundRange && depth < buildSettings.maxDepth && regionAndRangeData.first.sampleStatistics.getNumSamples() + sampleRange.size() > buildSettings.maxSamples)
{
nodeSplit = true;
splitDim = parentSplitDim;
getSplitDimensionAndPosition(mergedSampleStats, splitDim, splitPos);
// update the sample bound to the measured sampled bound of the current and previous leaf node samples
Expand Down
1 change: 1 addition & 0 deletions superbuild/dependencies/dep_ispc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ExternalProject_Add(${COMPONENT_NAME}
STAMP_DIR ${COMPONENT_NAME}/stamp
SOURCE_DIR ${COMPONENT_NAME}/src
BINARY_DIR ${COMPONENT_NAME}
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL ${ISPC_URL}
${ISPC_URL_HASH}
CONFIGURE_COMMAND ""
Expand Down
1 change: 1 addition & 0 deletions superbuild/dependencies/dep_oidn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if (BUILD_OIDN_FROM_SOURCE)
STAMP_DIR ${COMPONENT_NAME}/stamp
SOURCE_DIR ${COMPONENT_NAME}/src
BINARY_DIR ${COMPONENT_NAME}/build
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
LIST_SEPARATOR | # Use the alternate list separator
${OIDN_CLONE_URL}
${OIDN_URL_HASH}
Expand Down
1 change: 1 addition & 0 deletions superbuild/dependencies/dep_tbb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ else()
STAMP_DIR ${COMPONENT_NAME}/stamp
SOURCE_DIR ${COMPONENT_NAME}/src
BINARY_DIR ${COMPONENT_NAME}
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL ${TBB_URL}
${TBB_HASH_ARGS}
CONFIGURE_COMMAND ""
Expand Down
8 changes: 4 additions & 4 deletions third-party/embreeSrc/common/algorithms/parallel_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace embree
: array(array), N(N), is_left(is_left), reduction_t(reduction_t), reduction_v(reduction_v), identity(identity),
numTasks(min((N+BLOCK_SIZE-1)/BLOCK_SIZE,min(TaskScheduler::threadCount(),MAX_TASKS))) {}

__forceinline const range<ssize_t>* findStartRange(size_t& index, const range<ssize_t>* const r, const size_t numRanges)
__forceinline const range<ssize_t>* findStartRange(size_t& index, const range<ssize_t>* const r, [[maybe_unused]] const size_t numRanges)
{
size_t i = 0;
while(index >= (size_t)r[i].size())
Expand Down Expand Up @@ -274,7 +274,7 @@ namespace embree
size_t rightReduction = 0;
return serial_partitioning(
array,begin,end,leftReduction,rightReduction,is_left,
[] (size_t& t,const T& ref) { });
[] ([[maybe_unused]] size_t& t, [[maybe_unused]] const T& ref) { });
}

template<typename T, typename IsLeft>
Expand All @@ -288,8 +288,8 @@ namespace embree
size_t rightReduction = 0;
return parallel_partitioning(
array,begin,end,0,leftReduction,rightReduction,is_left,
[] (size_t& t,const T& ref) { },
[] (size_t& t0,size_t& t1) { },
[] ([[maybe_unused]] size_t& t,[[maybe_unused]] const T& ref) { },
[] ([[maybe_unused]] size_t& t0, [[maybe_unused]] size_t& t1) { },
BLOCK_SIZE);
}

Expand Down
Loading