[development] Migrated Atom CPU profiler to utilize new AzCore Profiler interface and related macros (#4160)

- Added new interface type AZ::Debug::Profiler to externally register profiler systems
 - Modified the Atom CPU profiler to register as an AzCore profiler
 -- This allows full engine markers to be visualized in the associated ImGui tool
 - Converted all AZ_ATOM_PROFILE_* macros to use AZ_PROFILE_* macros instead

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
This commit is contained in:
Scott Romero
2021-09-20 11:40:57 -07:00
committed by GitHub
parent 6565b91854
commit 36bcf5849a
72 changed files with 239 additions and 336 deletions
@@ -75,8 +75,7 @@ namespace AZ
void MeshFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet)
{
AZ_PROFILE_FUNCTION(AzRender);
AZ_ATOM_PROFILE_FUNCTION("RPI", "MeshFeatureProcessor: Simulate");
AZ_PROFILE_SCOPE(RPI, "MeshFeatureProcessor: Simulate");
AZ_UNUSED(packet);
AZStd::concurrency_check_scope scopeCheck(m_meshDataChecker);
@@ -149,7 +148,7 @@ namespace AZ
const MeshHandleDescriptor& descriptor,
const MaterialAssignmentMap& materials)
{
AZ_PROFILE_FUNCTION(AzRender);
AZ_PROFILE_SCOPE(AzRender, "MeshFeatureProcessor: AcquireMesh");
// don't need to check the concurrency during emplace() because the StableDynamicArray won't move the other elements during insertion
MeshHandle meshDataHandle = m_meshData.emplace();
@@ -984,7 +983,7 @@ namespace AZ
void MeshDataInstance::UpdateDrawPackets(bool forceUpdate /*= false*/)
{
AZ_PROFILE_FUNCTION(AzRender);
AZ_PROFILE_SCOPE(AzRender, "MeshDataInstance:: UpdateDrawPackets");
for (auto& drawPacketList : m_drawPacketListsByLod)
{
for (auto& drawPacket : drawPacketList)
@@ -999,7 +998,7 @@ namespace AZ
void MeshDataInstance::BuildCullable()
{
AZ_PROFILE_FUNCTION(AzRender);
AZ_PROFILE_SCOPE(AzRender, "MeshDataInstance: BuildCullable");
AZ_Assert(m_cullableNeedsRebuild, "This function only needs to be called if the cullable to be rebuilt");
AZ_Assert(m_model, "The model has not finished loading yet");
@@ -1076,7 +1075,7 @@ namespace AZ
void MeshDataInstance::UpdateCullBounds(const TransformServiceFeatureProcessor* transformService)
{
AZ_PROFILE_FUNCTION(AzRender);
AZ_PROFILE_SCOPE(AzRender, "MeshDataInstance: UpdateCullBounds");
AZ_Assert(m_cullBoundsNeedsUpdate, "This function only needs to be called if the culling bounds need to be rebuilt");
AZ_Assert(m_model, "The model has not finished loading yet");