Graphics/CullingList: Add forceInvalidation parameter
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Nz
|
||||
|
||||
std::size_t Cull(const Frustumf& frustum, bool* forceInvalidation = nullptr);
|
||||
|
||||
std::size_t FillWithAllEntries();
|
||||
std::size_t FillWithAllEntries(bool* forceInvalidation = nullptr);
|
||||
|
||||
NoTestEntry RegisterNoTest(const T* renderable);
|
||||
SphereEntry RegisterSphereTest(const T* renderable);
|
||||
|
||||
@@ -71,29 +71,52 @@ namespace Nz
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::size_t CullingList<T>::FillWithAllEntries()
|
||||
std::size_t CullingList<T>::FillWithAllEntries(bool* forceInvalidation)
|
||||
{
|
||||
m_results.clear();
|
||||
|
||||
bool forcedInvalidation = false;
|
||||
|
||||
std::size_t visibleHash = 0U;
|
||||
for (NoTestVisibilityEntry& entry : m_noTestList)
|
||||
{
|
||||
m_results.push_back(entry.renderable);
|
||||
Nz::HashCombine(visibleHash, entry.renderable);
|
||||
|
||||
if (entry.forceInvalidation)
|
||||
{
|
||||
forcedInvalidation = true;
|
||||
entry.forceInvalidation = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (SphereVisibilityEntry& entry : m_sphereTestList)
|
||||
{
|
||||
m_results.push_back(entry.renderable);
|
||||
Nz::HashCombine(visibleHash, entry.renderable);
|
||||
|
||||
if (entry.forceInvalidation)
|
||||
{
|
||||
forcedInvalidation = true;
|
||||
entry.forceInvalidation = false;
|
||||
}
|
||||
}
|
||||
|
||||
for (VolumeVisibilityEntry& entry : m_volumeTestList)
|
||||
{
|
||||
m_results.push_back(entry.renderable);
|
||||
Nz::HashCombine(visibleHash, entry.renderable);
|
||||
|
||||
if (entry.forceInvalidation)
|
||||
{
|
||||
forcedInvalidation = true;
|
||||
entry.forceInvalidation = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (forceInvalidation)
|
||||
*forceInvalidation = forcedInvalidation;
|
||||
|
||||
return visibleHash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user