32#include <memory_resource>
35#include <unordered_map>
52 using SPMap = std::pmr::unordered_map<SpecularPathId, SpecularPathData<Vec3>>;
53 using SPEntry = std::pair<SpecularPathId, SpecularPathData<Vec3>>;
54 using SPArray = std::pmr::vector<SPEntry>;
74 std::span<const int>
nodes,
86 template<
class SceneType>
104 DeallocatePathData(
path);
106 mInvalidPaths.clear();
114 DeallocatePathData(
path);
151 allocator.deallocate(data.Nodes.data(), data.Nodes.size());
160 return std::ranges::find_if(mValidPaths,
hasId) != std::ranges::end(mValidPaths)
161 || std::ranges::find_if(mInvalidPaths,
hasId) != std::ranges::end(mInvalidPaths);
185 template<
class SceneType>
200 "Path contains only source and listener verices, no reflections.");
203 "Path is deeper than max order allowed.");
215 return entry.second.bValid;
223 std::ranges::move(
invalidRange, std::back_inserter(mInvalidPaths));
227 DeallocatePathData(
path);
230 mValidPaths.erase(
invalidRange.begin(), mValidPaths.end());
#define JPL_ASSERT(inExpression,...)
Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
Definition ErrorReporting.h:76
A very experimental scene interface for specular ray tracing.
Definition SceneInterface.h:35
static bool ValidatePath(const SceneType &scene, std::span< const int > triCache, std::span< const Vec3 > imageSources, const Vec3 &receiver)
Definition SceneInterface.h:82
A very experimental specular path cache.
Definition SpecularPathCache.h:49
std::pmr::unordered_map< SpecularPathId, SpecularPathData< Vec3 > > SPMap
Definition SpecularPathCache.h:52
JPL_INLINE bool Contains(SpecularPathId pathId) const
Definition SpecularPathCache.h:157
JPL_INLINE std::size_t GetNumPaths() const
Definition SpecularPathCache.h:64
std::pair< SpecularPathId, SpecularPathData< Vec3 > > SPEntry
Definition SpecularPathCache.h:53
SpecularPathCache()=default
JPL_INLINE std::span< const SPEntry > GetValidPaths() const
Definition SpecularPathCache.h:89
void Add(SpecularPathId path, std::span< const int > nodes, const Vec3 &imageSource, const EnergyBands &energy, bool isPathValid)
Definition SpecularPathCache.h:165
JPL_INLINE std::size_t GetNumInvalidPaths() const
Definition SpecularPathCache.h:66
JPL_INLINE std::span< const SPEntry > GetInvalidPaths() const
Definition SpecularPathCache.h:90
static constexpr std::size_t cMaxOrder
Definition SpecularPathCache.h:56
JPL_INLINE std::size_t GetNumValidPaths() const
Definition SpecularPathCache.h:65
JPL_INLINE void Clear()
Definition SpecularPathCache.h:92
std::pmr::vector< SPEntry > SPArray
Definition SpecularPathCache.h:54
void Validate(const SceneType &scene)
Definition SpecularPathCache.h:186
~SpecularPathCache() noexcept
Definition SpecularPathCache.h:143
Definition AcousticMaterial.h:36
std::pmr::memory_resource * GetDefaultMemoryResource() noexcept
Definition Memory.h:42
JPL_INLINE simd min(const simd &a, const simd &b) noexcept
Element-wise min.
Definition SIMD.h:1813
Definition ChannelMap.h:268
Definition SpecularPath.h:57
std::span< int > Nodes
Definition SpecularPath.h:59
A very experimental specular path definition.
Definition SpecularPath.h:40
Minimal 4-wide 32-bit float vector implementation for SIMD.
Definition SIMD.h:60
static constexpr std::size_t size() noexcept
Get number of element of the vector.
Definition SIMD.h:97