Improvements to pass statistics and SRG debugability

Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
This commit is contained in:
antonmic
2021-07-28 16:35:51 -07:00
parent 7eeaf7dad5
commit 72f808876c
17 changed files with 289 additions and 41 deletions
@@ -308,6 +308,7 @@ namespace AZ
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender);
AZ_ATOM_PROFILE_FUNCTION("RPI", "PassSystem: FrameUpdate");
ResetFrameStatistics();
ProcessQueuedChanges();
m_state = PassSystemState::Rendering;
@@ -392,6 +393,29 @@ namespace AZ
handler.Connect(m_loadTemplatesEvent);
}
void PassSystem::ResetFrameStatistics()
{
m_frameStatistics.m_numRenderPassesExecuted = 0;
m_frameStatistics.m_totalDrawItemsRendered = 0;
m_frameStatistics.m_maxDrawItemsRenderedInAPass = 0;
}
PassSystemFrameStatistics PassSystem::GetFrameStatistics()
{
return m_frameStatistics;
}
void PassSystem::IncrementFrameDrawItemCount(u32 numDrawItems)
{
m_frameStatistics.m_totalDrawItemsRendered += numDrawItems;
m_frameStatistics.m_maxDrawItemsRenderedInAPass = AZStd::max(m_frameStatistics.m_maxDrawItemsRenderedInAPass, numDrawItems);
}
void PassSystem::IncrementFrameRenderPassCount()
{
++m_frameStatistics.m_numRenderPassesExecuted;
}
// --- Pass Factory Functions ---
void PassSystem::AddPassCreator(Name className, PassCreator createFunction)