@ -404,6 +404,7 @@ namespace AZ
{
{
AZ_PROFILE_SCOPE ( Debug : : ProfileCategory : : AzRender , " WaitForSimulationCompletion " ) ;
AZ_PROFILE_SCOPE ( Debug : : ProfileCategory : : AzRender , " WaitForSimulationCompletion " ) ;
AZ_ATOM_PROFILE_TIME_GROUP_REGION ( " RPI " , " WaitForSimulationCompletion " ) ;
WaitAndCleanCompletionJob ( m_simulationCompletion ) ;
WaitAndCleanCompletionJob ( m_simulationCompletion ) ;
}
}
@ -420,12 +421,15 @@ namespace AZ
// Get active pipelines which need to be rendered and notify them frame started
// Get active pipelines which need to be rendered and notify them frame started
AZStd : : vector < RenderPipelinePtr > activePipelines ;
AZStd : : vector < RenderPipelinePtr > activePipelines ;
for ( auto & pipeline : m_pipelines )
{
{
if ( pipeline - > NeedsRender ( ) )
AZ_ATOM_PROFILE_TIME_GROUP_REGION ( " RPI " , " OnStartFrame " ) ;
for ( auto & pipeline : m_pipelines )
{
{
activePipelines . push_back ( pipeline ) ;
if ( pipeline - > NeedsRender ( ) )
pipeline - > OnStartFrame ( tickInfo ) ;
{
activePipelines . push_back ( pipeline ) ;
pipeline - > OnStartFrame ( tickInfo ) ;
}
}
}
}
}
@ -444,7 +448,7 @@ namespace AZ
{
{
AZ_ PROFILE_SCOPE( Debug : : ProfileCategory : : AzRender , " Setup Views " ) ;
AZ_ ATOM_PROFILE_TIME_GROUP_REGION( " RPI " , " Setup Views " ) ;
// Collect persistent views from all pipelines to be rendered
// Collect persistent views from all pipelines to be rendered
AZStd : : map < ViewPtr , RHI : : DrawListMask > persistentViews ;
AZStd : : map < ViewPtr , RHI : : DrawListMask > persistentViews ;
@ -490,7 +494,6 @@ namespace AZ
{
{
const auto renderLambda = [ this , & fp ] ( )
const auto renderLambda = [ this , & fp ] ( )
{
{
AZ_PROFILE_SCOPE_DYNAMIC ( Debug : : ProfileCategory : : AzRender , " renderJob - fp:%s " , fp - > RTTI_GetTypeName ( ) ) ;
fp - > Render ( m_renderPacket ) ;
fp - > Render ( m_renderPacket ) ;
} ;
} ;
@ -526,12 +529,14 @@ namespace AZ
// Add dynamic draw data for all the views
// Add dynamic draw data for all the views
if ( m_dynamicDrawSystem )
if ( m_dynamicDrawSystem )
{
{
AZ_ATOM_PROFILE_TIME_GROUP_REGION ( " RPI " , " DynamicDraw SubmitDrawData " ) ;
m_dynamicDrawSystem - > SubmitDrawData ( this , m_renderPacket . m_views ) ;
m_dynamicDrawSystem - > SubmitDrawData ( this , m_renderPacket . m_views ) ;
}
}
}
}
{
{
AZ_PROFILE_SCOPE ( AZ : : Debug : : ProfileCategory : : AzRender , " FinalizeDrawLists " ) ;
AZ_PROFILE_SCOPE ( AZ : : Debug : : ProfileCategory : : AzRender , " FinalizeDrawLists " ) ;
AZ_ATOM_PROFILE_TIME_GROUP_REGION ( " RPI " , " FinalizeDrawLists " ) ;
if ( jobPolicy = = RHI : : JobPolicy : : Serial )
if ( jobPolicy = = RHI : : JobPolicy : : Serial )
{
{
for ( auto & view : m_renderPacket . m_views )
for ( auto & view : m_renderPacket . m_views )
@ -542,7 +547,6 @@ namespace AZ
else
else
{
{
AZ : : JobCompletion * finalizeDrawListsCompletion = aznew AZ : : JobCompletion ( ) ;
AZ : : JobCompletion * finalizeDrawListsCompletion = aznew AZ : : JobCompletion ( ) ;
AZ_PROFILE_EVENT_BEGIN ( Debug : : ProfileCategory : : AzRender , " StartFinalizeDrawListsJobs " ) ;
for ( auto & view : m_renderPacket . m_views )
for ( auto & view : m_renderPacket . m_views )
{
{
const auto finalizeDrawListsLambda = [ view ] ( )
const auto finalizeDrawListsLambda = [ view ] ( )
@ -559,11 +563,15 @@ namespace AZ
}
}
}
}
SceneNotificationBus : : Event ( GetId ( ) , & SceneNotification : : OnEndPrepareRender ) ;
{
AZ_ATOM_PROFILE_TIME_GROUP_REGION ( " RPI " , " Scene OnEndPrepareRender " ) ;
SceneNotificationBus : : Event ( GetId ( ) , & SceneNotification : : OnEndPrepareRender ) ;
}
}
}
void Scene : : OnFrameEnd ( )
void Scene : : OnFrameEnd ( )
{
{
AZ_ATOM_PROFILE_FUNCTION ( " RPI " , " Scene: OnFrameEnd " ) ;
for ( auto & pipeline : m_pipelines )
for ( auto & pipeline : m_pipelines )
{
{
if ( pipeline - > NeedsRender ( ) )
if ( pipeline - > NeedsRender ( ) )
@ -702,6 +710,7 @@ namespace AZ
void Scene : : RebuildPipelineStatesLookup ( )
void Scene : : RebuildPipelineStatesLookup ( )
{
{
AZ_ATOM_PROFILE_FUNCTION ( " RPI " , " Scene: RebuildPipelineStatesLookup " ) ;
m_pipelineStatesLookup . clear ( ) ;
m_pipelineStatesLookup . clear ( ) ;
AZStd : : queue < ParentPass * > parents ;
AZStd : : queue < ParentPass * > parents ;