diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 90b020f452..b83babc5c5 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -1047,7 +1047,7 @@ static bool TryRenameFile(const QString& oldPath, const QString& newPath, int re bool CCryEditDoc::SaveLevel(const QString& filename) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); QWaitCursor wait; CAutoCheckOutDialogEnableForAll enableForAll; @@ -1067,7 +1067,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel BackupBeforeSave"); + AZ_PROFILE_SCOPE(AzToolsFramework, "CCryEditDoc::SaveLevel BackupBeforeSave"); BackupBeforeSave(); } @@ -1178,7 +1178,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) CPakFile pakFile; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Open PakFile"); + AZ_PROFILE_SCOPE(AzToolsFramework, "CCryEditDoc::SaveLevel Open PakFile"); if (!pakFile.Open(tempSaveFile.toUtf8().data(), false)) { gEnv->pLog->LogWarning("Unable to open pack file %s for writing", tempSaveFile.toUtf8().data()); @@ -1209,7 +1209,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) AZ::IO::ByteContainerStream> entitySaveStream(&entitySaveBuffer); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Save Entities To Stream"); + AZ_PROFILE_SCOPE(AzToolsFramework, "CCryEditDoc::SaveLevel Save Entities To Stream"); EBUS_EVENT_RESULT( savedEntities, AzToolsFramework::EditorEntityContextRequestBus, SaveToStreamForEditor, entitySaveStream, layerEntities, instancesInLayers); @@ -1223,7 +1223,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename) if (savedEntities) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "CCryEditDoc::SaveLevel Updated PakFile levelEntities.editor_xml"); + AZ_PROFILE_SCOPE(AzToolsFramework, "CCryEditDoc::SaveLevel Updated PakFile levelEntities.editor_xml"); pakFile.UpdateFile("LevelEntities.editor_xml", entitySaveBuffer.begin(), entitySaveBuffer.size()); // Save XML archive to pak file. diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 28e8cce33e..37ddb993f2 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -1950,7 +1950,7 @@ QPoint EditorViewportWidget::WorldToViewParticleEditor(const Vec3& wp, int width Vec3 EditorViewportWidget::ViewToWorld( const QPoint& vp, bool* collideWithTerrain, bool onlyTerrain, bool bSkipVegetation, bool bTestRenderMesh, bool* collideWithObject) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); AZ_UNUSED(collideWithTerrain) AZ_UNUSED(onlyTerrain) @@ -1985,7 +1985,7 @@ Vec3 EditorViewportWidget::ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, AZ_UNUSED(onlyTerrain) AZ_UNUSED(bTestRenderMesh) - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); return Vec3(0, 0, 1); } diff --git a/Code/Editor/Objects/AxisGizmo.cpp b/Code/Editor/Objects/AxisGizmo.cpp index 8f81ea66b7..a603b2615d 100644 --- a/Code/Editor/Objects/AxisGizmo.cpp +++ b/Code/Editor/Objects/AxisGizmo.cpp @@ -274,7 +274,7 @@ Matrix34 CAxisGizmo::GetTransformation(RefCoordSys coordSys, IDisplayViewport* v ////////////////////////////////////////////////////////////////////////// bool CAxisGizmo::MouseCallback(CViewport* view, EMouseEvent event, QPoint& point, [[maybe_unused]] int nFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (event == eMouseLDown) { diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index 482055d7ed..c9002f2dfa 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -1233,7 +1233,7 @@ float CBaseObject::GetCameraVisRatio(const CCamera& camera) ////////////////////////////////////////////////////////////////////////// int CBaseObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (event == eMouseMove || event == eMouseLDown) { @@ -1928,7 +1928,7 @@ bool CBaseObject::HitTestRectBounds(HitContext& hc, const AABB& box) ////////////////////////////////////////////////////////////////////////// bool CBaseObject::HitTestRect(HitContext& hc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AABB box; @@ -1965,7 +1965,7 @@ bool CBaseObject::HitHelperTest(HitContext& hc) ////////////////////////////////////////////////////////////////////////// bool CBaseObject::HitHelperAtTest(HitContext& hc, const Vec3& pos) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool bResult = false; diff --git a/Code/Editor/Objects/EntityObject.cpp b/Code/Editor/Objects/EntityObject.cpp index 0f4a17f3ba..b42afb5c39 100644 --- a/Code/Editor/Objects/EntityObject.cpp +++ b/Code/Editor/Objects/EntityObject.cpp @@ -497,7 +497,7 @@ bool CEntityObject::HitTestRect(HitContext& hc) ////////////////////////////////////////////////////////////////////////// int CEntityObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (event == eMouseMove || event == eMouseLDown) { diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp index fbdd56f080..61a8944a90 100644 --- a/Code/Editor/Objects/ObjectManager.cpp +++ b/Code/Editor/Objects/ObjectManager.cpp @@ -368,7 +368,7 @@ CBaseObject* CObjectManager::NewObject(const QString& typeName, CBaseObject* pre ////////////////////////////////////////////////////////////////////////// void CObjectManager::DeleteObject(CBaseObject* obj) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (m_currEditObject == obj) { EndEditParams(); @@ -414,7 +414,7 @@ void CObjectManager::DeleteObject(CBaseObject* obj) ////////////////////////////////////////////////////////////////////////// void CObjectManager::DeleteSelection(CSelectionGroup* pSelection) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (pSelection == nullptr) { return; @@ -478,7 +478,7 @@ void CObjectManager::DeleteSelection(CSelectionGroup* pSelection) ////////////////////////////////////////////////////////////////////////// void CObjectManager::DeleteAllObjects() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); EndEditParams(); @@ -519,7 +519,7 @@ void CObjectManager::DeleteAllObjects() CBaseObject* CObjectManager::CloneObject(CBaseObject* obj) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); assert(obj); //CRuntimeClass *cls = obj->GetRuntimeClass(); //CBaseObject *clone = (CBaseObject*)cls->CreateObject(); @@ -1112,7 +1112,7 @@ void CObjectManager::SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading) ////////////////////////////////////////////////////////////////////////// int CObjectManager::ClearSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Make sure to unlock selection. GetIEditor()->LockSelection(false); @@ -1165,7 +1165,7 @@ int CObjectManager::ClearSelection() ////////////////////////////////////////////////////////////////////////// int CObjectManager::InvertSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); int selCount = 0; // iterate all objects. @@ -1189,7 +1189,7 @@ int CObjectManager::InvertSelection() void CObjectManager::SetSelection(const QString& name) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr); if (selection) { @@ -1202,7 +1202,7 @@ void CObjectManager::SetSelection(const QString& name) void CObjectManager::RemoveSelection(const QString& name) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); QString selName = name; CSelectionGroup* selection = stl::find_in_map(m_selections, name, (CSelectionGroup*)nullptr); @@ -1221,7 +1221,7 @@ void CObjectManager::RemoveSelection(const QString& name) void CObjectManager::SelectCurrent() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); for (int i = 0; i < m_currSelection->GetCount(); i++) { CBaseObject* obj = m_currSelection->GetObject(i); @@ -1236,7 +1236,7 @@ void CObjectManager::SelectCurrent() void CObjectManager::UnselectCurrent() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Make sure to unlock selection. GetIEditor()->LockSelection(false); @@ -1260,7 +1260,7 @@ void CObjectManager::UnselectCurrent() ////////////////////////////////////////////////////////////////////////// void CObjectManager::Display(DisplayContext& dc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); int currentHideMask = GetIEditor()->GetDisplaySettings()->GetObjectHideMask(); if (m_lastHideMask != currentHideMask) @@ -1320,7 +1320,7 @@ void CObjectManager::FindDisplayableObjects(DisplayContext& dc, [[maybe_unused]] return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); auto start = std::chrono::steady_clock::now(); CBaseObjectsCache* pDispayedViewObjects = dc.view->GetVisibleObjectsCache(); @@ -1451,7 +1451,7 @@ void CObjectManager::EndEditParams([[maybe_unused]] int flags) //! Select objects within specified distance from given position. int CObjectManager::SelectObjects(const AABB& box, bool bUnselect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); int numSel = 0; AABB objBounds; @@ -1551,7 +1551,7 @@ bool CObjectManager::IsObjectDeletionAllowed(CBaseObject* pObject) ////////////////////////////////////////////////////////////////////////// void CObjectManager::DeleteSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Make sure to unlock selection. GetIEditor()->LockSelection(false); @@ -1581,7 +1581,7 @@ void CObjectManager::DeleteSelection() ////////////////////////////////////////////////////////////////////////// bool CObjectManager::HitTestObject(CBaseObject* obj, HitContext& hc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (obj->IsFrozen()) { @@ -1648,7 +1648,7 @@ bool CObjectManager::HitTestObject(CBaseObject* obj, HitContext& hc) ////////////////////////////////////////////////////////////////////////// bool CObjectManager::HitTest(HitContext& hitInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); hitInfo.object = nullptr; hitInfo.dist = FLT_MAX; @@ -1766,7 +1766,7 @@ bool CObjectManager::HitTest(HitContext& hitInfo) } void CObjectManager::FindObjectsInRect(CViewport* view, const QRect& rect, std::vector& guids) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (rect.width() < 1 || rect.height() < 1) { @@ -1795,7 +1795,7 @@ void CObjectManager::FindObjectsInRect(CViewport* view, const QRect& rect, std:: ////////////////////////////////////////////////////////////////////////// void CObjectManager::SelectObjectsInRect(CViewport* view, const QRect& rect, bool bSelect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Ignore too small rectangles. if (rect.width() < 1 || rect.height() < 1) @@ -2363,7 +2363,7 @@ bool CObjectManager::ConvertToType(CBaseObject* pObject, const QString& typeName ////////////////////////////////////////////////////////////////////////// void CObjectManager::SetObjectSelected(CBaseObject* pObject, bool bSelect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Only select/unselect once. if ((pObject->IsSelected() && bSelect) || (!pObject->IsSelected() && !bSelect)) { diff --git a/Code/Editor/Objects/ObjectManagerLegacyUndo.cpp b/Code/Editor/Objects/ObjectManagerLegacyUndo.cpp index f21ba46e65..08a7f4cf48 100644 --- a/Code/Editor/Objects/ObjectManagerLegacyUndo.cpp +++ b/Code/Editor/Objects/ObjectManagerLegacyUndo.cpp @@ -204,7 +204,7 @@ CUndoBaseObjectBulkSelect::CUndoBaseObjectBulkSelect(const AZStd::unordered_set< void CUndoBaseObjectBulkSelect::Undo(bool bUndo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (!bUndo) { return; @@ -217,7 +217,7 @@ void CUndoBaseObjectBulkSelect::Undo(bool bUndo) void CUndoBaseObjectBulkSelect::Redo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); AzToolsFramework::ToolsApplicationRequestBus::Broadcast( &AzToolsFramework::ToolsApplicationRequests::MarkEntitiesSelected, @@ -256,7 +256,7 @@ CUndoBaseObjectClearSelection::CUndoBaseObjectClearSelection(const CSelectionGro void CUndoBaseObjectClearSelection::Undo(bool bUndo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (!bUndo) { @@ -270,7 +270,7 @@ void CUndoBaseObjectClearSelection::Undo(bool bUndo) void CUndoBaseObjectClearSelection::Redo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); AzToolsFramework::ToolsApplicationRequestBus::Broadcast( &AzToolsFramework::ToolsApplicationRequests::SetSelectedEntities, diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp index 85730d327b..ba08b5c069 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp @@ -679,7 +679,7 @@ bool CComponentEntityObject::HitHelperTest(HitContext& hc) bool CComponentEntityObject::HitTest(HitContext& hc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (m_iconOnlyHitTest) { @@ -705,7 +705,7 @@ bool CComponentEntityObject::HitTest(HitContext& hc) [&hc, &closestDistance, &rayIntersection, &preciseSelectionRequired, viewportId]( AzToolsFramework::EditorComponentSelectionRequests* handler) -> bool { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (handler->SupportsEditorRayIntersect()) { @@ -768,7 +768,7 @@ bool CComponentEntityObject::HitTest(HitContext& hc) void CComponentEntityObject::GetBoundBox(AABB& box) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); box.Reset(); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 6b60f96089..ac393607ae 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -472,7 +472,7 @@ void SandboxIntegrationManager::EntityParentChanged( const AZ::EntityId newParentId, const AZ::EntityId oldParentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_unsavedEntities.find(entityId) != m_unsavedEntities.end()) { @@ -858,7 +858,7 @@ void SandboxIntegrationManager::SetupLayerContextMenu(QMenu* menu) void SandboxIntegrationManager::SetupSliceContextMenu(QMenu* menu) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); AzToolsFramework::EntityIdList selectedEntities; GetSelectedOrHighlightedEntities(selectedEntities); @@ -960,7 +960,7 @@ void SandboxIntegrationManager::SetupSliceContextMenu(QMenu* menu) void SandboxIntegrationManager::SetupSliceContextMenu_Modify(QMenu* menu, const AzToolsFramework::EntityIdList& selectedEntities, [[maybe_unused]] const AZ::u32 numEntitiesInSlices) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); using namespace AzToolsFramework; // Gather the set of relevant entities from the selected entities and all descendants @@ -1083,7 +1083,7 @@ void SandboxIntegrationManager::CreateEditorRepresentation(AZ::Entity* entity) bool SandboxIntegrationManager::DestroyEditorRepresentation(AZ::EntityId entityId, bool deleteAZEntity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); IEditor* editor = GetIEditor(); if (editor->GetObjectManager()) @@ -1095,7 +1095,7 @@ bool SandboxIntegrationManager::DestroyEditorRepresentation(AZ::EntityId entityI { static_cast(object)->AssignEntity(nullptr, deleteAZEntity); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SandboxIntegrationManager::DestroyEditorRepresentation:ObjManagerDeleteObject"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SandboxIntegrationManager::DestroyEditorRepresentation:ObjManagerDeleteObject"); editor->GetObjectManager()->DeleteObject(object); } return true; @@ -1217,7 +1217,7 @@ void SandboxIntegrationManager::ClearRedoStack() void SandboxIntegrationManager::CloneSelection(bool& handled) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityIdList entities; AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( @@ -1850,7 +1850,7 @@ AZStd::string SandboxIntegrationManager::GetComponentEditorIcon(const AZ::Uuid& AZStd::string SandboxIntegrationManager::GetComponentIconPath(const AZ::Uuid& componentType, AZ::Crc32 componentIconAttrib, AZ::Component* component) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (componentIconAttrib != AZ::Edit::Attributes::Icon && componentIconAttrib != AZ::Edit::Attributes::ViewportIcon && componentIconAttrib != AZ::Edit::Attributes::HideIcon) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index 02d2174fb8..7d63f8e15b 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -1054,7 +1054,7 @@ bool OutlinerListModel::dropMimeDataEntities(const QMimeData* data, Qt::DropActi bool OutlinerListModel::CanReparentEntities(const AZ::EntityId& newParentId, const AzToolsFramework::EntityIdList &selectedEntityIds) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (selectedEntityIds.empty()) { return false; @@ -1143,7 +1143,7 @@ bool OutlinerListModel::CanReparentEntities(const AZ::EntityId& newParentId, con bool OutlinerListModel::ReparentEntities(const AZ::EntityId& newParentId, const AzToolsFramework::EntityIdList &selectedEntityIds, const AZ::EntityId& beforeEntityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!CanReparentEntities(newParentId, selectedEntityIds)) { return false; @@ -1233,7 +1233,7 @@ bool OutlinerListModel::ReparentEntities(const AZ::EntityId& newParentId, const QMimeData* OutlinerListModel::mimeData(const QModelIndexList& indexes) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::TypeId uuid1 = AZ::AzTypeInfo::Uuid(); AZ::TypeId uuid2 = AZ::AzTypeInfo::Uuid(); @@ -1323,7 +1323,7 @@ public: void OutlinerListModel::ProcessEntityUpdates() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); m_entityChangeQueued = false; if (m_layoutResetQueued) { @@ -1331,7 +1331,7 @@ void OutlinerListModel::ProcessEntityUpdates() } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "OutlinerListModel::ProcessEntityUpdates:ExpandQueue"); + AZ_PROFILE_SCOPE(Editor, "OutlinerListModel::ProcessEntityUpdates:ExpandQueue"); for (auto entityId : m_entityExpandQueue) { emit ExpandEntity(entityId, IsExpanded(entityId)); @@ -1340,7 +1340,7 @@ void OutlinerListModel::ProcessEntityUpdates() } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "OutlinerListModel::ProcessEntityUpdates:SelectQueue"); + AZ_PROFILE_SCOPE(Editor, "OutlinerListModel::ProcessEntityUpdates:SelectQueue"); for (auto entityId : m_entitySelectQueue) { emit SelectEntity(entityId, AzToolsFramework::IsSelected(entityId)); @@ -1350,7 +1350,7 @@ void OutlinerListModel::ProcessEntityUpdates() if (!m_entityChangeQueue.empty()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "OutlinerListModel::ProcessEntityUpdates:ChangeQueue"); + AZ_PROFILE_SCOPE(Editor, "OutlinerListModel::ProcessEntityUpdates:ChangeQueue"); // its faster to just do a bulk data change than to carefully pick out indices // so we'll just merge all ranges into a single range rather than try to make gaps @@ -1383,7 +1383,7 @@ void OutlinerListModel::ProcessEntityUpdates() } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "OutlinerListModel::ProcessEntityUpdates:LayoutChanged"); + AZ_PROFILE_SCOPE(Editor, "OutlinerListModel::ProcessEntityUpdates:LayoutChanged"); if (m_entityLayoutQueued) { emit layoutAboutToBeChanged(); @@ -1393,7 +1393,7 @@ void OutlinerListModel::ProcessEntityUpdates() } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "OutlinerListModel::ProcessEntityUpdates:InvalidateFilter"); + AZ_PROFILE_SCOPE(Editor, "OutlinerListModel::ProcessEntityUpdates:InvalidateFilter"); if (m_isFilterDirty) { InvalidateFilter(); @@ -1416,7 +1416,7 @@ void OutlinerListModel::OnEntityInfoResetEnd() void OutlinerListModel::ProcessEntityInfoResetEnd() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_layoutResetQueued = false; m_entityChangeQueued = false; m_entityChangeQueue.clear(); @@ -1437,7 +1437,7 @@ void OutlinerListModel::OnEntityInfoUpdatedAddChildBegin(AZ::EntityId parentId, void OutlinerListModel::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId parentId, AZ::EntityId childId) { (void)parentId; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); endInsertRows(); //expand ancestors if a new descendant is already selected @@ -1475,7 +1475,7 @@ void OutlinerListModel::OnEntityInfoUpdatedRemoveChildBegin(AZ::EntityId parentI void OutlinerListModel::OnEntityInfoUpdatedRemoveChildEnd(AZ::EntityId parentId, AZ::EntityId childId) { (void)childId; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); endResetModel(); @@ -1494,7 +1494,7 @@ void OutlinerListModel::OnEntityInfoUpdatedOrderBegin(AZ::EntityId parentId, AZ: void OutlinerListModel::OnEntityInfoUpdatedOrderEnd(AZ::EntityId parentId, AZ::EntityId childId, AZ::u64 index) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); (void)index; m_entityLayoutQueued = true; QueueEntityUpdate(parentId); @@ -1565,7 +1565,7 @@ QString OutlinerListModel::GetSliceAssetName(const AZ::EntityId& entityId) const QModelIndex OutlinerListModel::GetIndexFromEntity(const AZ::EntityId& entityId, int column) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityId.IsValid()) { @@ -1727,7 +1727,7 @@ void OutlinerListModel::OnEditorEntityDuplicated(const AZ::EntityId& oldEntity, void OutlinerListModel::ExpandAncestors(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //typically to reveal selected entities, expand all parent entities if (entityId.IsValid()) { @@ -1932,7 +1932,7 @@ bool OutlinerListModel::HasSelectedDescendant(const AZ::EntityId& entityId) cons bool OutlinerListModel::AreAllDescendantsSameLockState(const AZ::EntityId& entityId) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies bool isLocked = false; AzToolsFramework::EditorEntityInfoRequestBus::EventResult(isLocked, entityId, &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsJustThisEntityLocked); @@ -1953,7 +1953,7 @@ bool OutlinerListModel::AreAllDescendantsSameLockState(const AZ::EntityId& entit bool OutlinerListModel::AreAllDescendantsSameVisibleState(const AZ::EntityId& entityId) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies bool isVisible = AzToolsFramework::IsEntitySetToBeVisible(entityId); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp index 6e16ab6557..9ed7c4a144 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp @@ -96,7 +96,7 @@ namespace void SortEntityChildren(AZ::EntityId entityId, const EntityIdCompareFunc& comparer, AzToolsFramework::EntityOrderArray* newEntityOrder = nullptr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityOrderArray entityOrderArray = AzToolsFramework::GetEntityChildOrder(entityId); AZStd::sort(entityOrderArray.begin(), entityOrderArray.end(), comparer); @@ -110,7 +110,7 @@ namespace void SortEntityChildrenRecursively(AZ::EntityId entityId, const EntityIdCompareFunc& comparer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityOrderArray entityOrderArray; SortEntityChildren(entityId, comparer, &entityOrderArray); @@ -303,7 +303,7 @@ void OutlinerWidget::OnSelectionChanged(const QItemSelection& selected, const QI return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityIdList newlySelected; ExtractEntityIdsFromSelection(selected, newlySelected); @@ -450,7 +450,7 @@ void OutlinerWidget::UpdateSelection() { if (m_selectionChangeQueued) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_selectionChangeInProgress = true; @@ -458,7 +458,7 @@ void OutlinerWidget::UpdateSelection() { // Calling Deselect for a large number of items is very slow, // use a single ClearAndSelect call instead. - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect"); + AZ_PROFILE_SCOPE(AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect"); AzToolsFramework::EntityIdList selectedEntities; AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::Bus::Events::GetSelectedEntities); @@ -469,12 +469,12 @@ void OutlinerWidget::UpdateSelection() else { { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:Deselect"); + AZ_PROFILE_SCOPE(AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:Deselect"); m_gui->m_objectTree->selectionModel()->select( BuildSelectionFromEntities(m_entitiesToDeselect), QItemSelectionModel::Deselect); } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:Select"); + AZ_PROFILE_SCOPE(AzToolsFramework, "OutlinerWidget::ModelEntitySelectionChanged:Select"); m_gui->m_objectTree->selectionModel()->select( BuildSelectionFromEntities(m_entitiesToSelect), QItemSelectionModel::Select); } @@ -497,7 +497,7 @@ void OutlinerWidget::UpdateSelection() template QItemSelection OutlinerWidget::BuildSelectionFromEntities(const EntityIdCollection& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); QItemSelection selection; for (const auto& entityId : entityIds) @@ -517,7 +517,7 @@ QItemSelection OutlinerWidget::BuildSelectionFromEntities(const EntityIdCollecti void OutlinerWidget::contextMenuEvent(QContextMenuEvent* event) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); bool isDocumentOpen = false; EBUS_EVENT_RESULT(isDocumentOpen, AzToolsFramework::EditorRequests::Bus, IsLevelDocumentOpen); @@ -1272,7 +1272,7 @@ void OutlinerWidget::ExtractEntityIdsFromSelection(const QItemSelection& selecti void OutlinerWidget::OnSearchTextChanged(const QString& activeTextFilter) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::string filterString = activeTextFilter.toUtf8().data(); m_listModel->SearchStringChanged(filterString); @@ -1388,7 +1388,7 @@ void OutlinerWidget::QueueContentUpdateSort(const AZ::EntityId& entityId) void OutlinerWidget::SortContent() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_sortContentQueued = false; @@ -1424,7 +1424,7 @@ void OutlinerWidget::OnSortModeChanged(EntityOutliner::DisplaySortMode sortMode) if (sortMode != EntityOutliner::DisplaySortMode::Manually) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto comparer = AZStd::bind(&CompareEntitiesForSorting, AZStd::placeholders::_1, AZStd::placeholders::_2, sortMode); SortEntityChildrenRecursively(AZ::EntityId(), comparer); } diff --git a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp index db6e355799..c7e14d9c4e 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp +++ b/Code/Editor/Plugins/EditorAssetImporter/AssetImporterDocument.cpp @@ -43,7 +43,7 @@ AssetImporterDocument::AssetImporterDocument() bool AssetImporterDocument::LoadScene(const AZStd::string& sceneFullPath) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); namespace SceneEvents = AZ::SceneAPI::Events; SceneEvents::SceneSerializationBus::BroadcastResult(m_scene, &SceneEvents::SceneSerializationBus::Events::LoadScene, sceneFullPath, AZ::Uuid::CreateNull()); return !!m_scene; diff --git a/Code/Editor/Plugins/EditorAssetImporter/ImporterRootDisplay.cpp b/Code/Editor/Plugins/EditorAssetImporter/ImporterRootDisplay.cpp index 34527e598a..4f942a4251 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/ImporterRootDisplay.cpp +++ b/Code/Editor/Plugins/EditorAssetImporter/ImporterRootDisplay.cpp @@ -45,7 +45,7 @@ AZ::SceneAPI::UI::ManifestWidget* ImporterRootDisplay::GetManifestWidget() void ImporterRootDisplay::SetSceneDisplay(const QString& headerText, const AZStd::shared_ptr& scene) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (!scene) { AZ_Assert(scene, "No scene provided to display."); @@ -62,7 +62,7 @@ void ImporterRootDisplay::SetSceneDisplay(const QString& headerText, const AZStd void ImporterRootDisplay::HandleSceneWasReset(const AZStd::shared_ptr& scene) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Don't accept updates while the widget is being filled in. BusDisconnect(); m_manifestWidget->BuildFromScene(scene); diff --git a/Code/Editor/Plugins/EditorAssetImporter/SceneSerializationHandler.cpp b/Code/Editor/Plugins/EditorAssetImporter/SceneSerializationHandler.cpp index c087a27ba4..b1d07af41c 100644 --- a/Code/Editor/Plugins/EditorAssetImporter/SceneSerializationHandler.cpp +++ b/Code/Editor/Plugins/EditorAssetImporter/SceneSerializationHandler.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -37,7 +38,7 @@ namespace AZ AZStd::shared_ptr SceneSerializationHandler::LoadScene( const AZStd::string& filePath, Uuid sceneSourceGuid) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); namespace Utilities = AZ::SceneAPI::Utilities; using AZ::SceneAPI::Events::AssetImportRequest; diff --git a/Code/Editor/Viewport.cpp b/Code/Editor/Viewport.cpp index 873f555c80..fe60778c13 100644 --- a/Code/Editor/Viewport.cpp +++ b/Code/Editor/Viewport.cpp @@ -969,7 +969,7 @@ void QtViewport::MakeConstructionPlane(int axis) ////////////////////////////////////////////////////////////////////////// Vec3 QtViewport::MapViewToCP(const QPoint& point, int axis) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (axis == AXIS_TERRAIN) { @@ -1336,7 +1336,7 @@ bool QtViewport::GetAdvancedSelectModeFlag() ////////////////////////////////////////////////////////////////////////// bool QtViewport::MouseCallback(EMouseEvent event, const QPoint& point, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); // Ignore any mouse events in game mode. if (GetIEditor()->IsInGameMode()) diff --git a/Code/Framework/AzCore/AzCore/Android/APKFileHandler.h b/Code/Framework/AzCore/AzCore/Android/APKFileHandler.h index 0d9d3c984d..8df97a0cea 100644 --- a/Code/Framework/AzCore/AzCore/Android/APKFileHandler.h +++ b/Code/Framework/AzCore/AzCore/Android/APKFileHandler.h @@ -26,8 +26,8 @@ #if AZ_ENABLED_VERBOSE_ANDROID_IO_PROFILING #include - #define ANDROID_IO_PROFILE_SECTION AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore) - #define ANDROID_IO_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, __VA_ARGS__) + #define ANDROID_IO_PROFILE_SECTION AZ_PROFILE_FUNCTION(AzCore) + #define ANDROID_IO_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE(AzCore, __VA_ARGS__) #else #define ANDROID_IO_PROFILE_SECTION #define ANDROID_IO_PROFILE_SECTION_ARGS(...) diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp index 425c729806..305ec0617b 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp @@ -27,7 +27,7 @@ namespace AZ::Data void AssetDataStream::Open(const AZStd::vector& data) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(!m_isOpen, "Attempting to open the stream when it is already open."); @@ -45,7 +45,7 @@ namespace AZ::Data void AssetDataStream::Open(AZStd::vector&& data) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(!m_isOpen, "Attempting to open the stream when it is already open."); @@ -62,7 +62,7 @@ namespace AZ::Data AZStd::chrono::milliseconds deadline, AZ::IO::IStreamerTypes::Priority priority, OnCompleteCallback loadCallback) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(!m_isOpen, "Attempting to open the stream when it is already open."); AZ_Assert(!m_curReadRequest, "Queueing an asset stream load while one is still in progress."); @@ -80,7 +80,7 @@ namespace AZ::Data // Set up the callback that will process the asset data once the raw file load is finished. auto streamerCallback = [this, loadCallback](AZ::IO::FileRequestHandle fileHandle) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "AZ::Data::LoadAssetDataStreamCallback %s", + AZ_PROFILE_SCOPE(AzCore, "AZ::Data::LoadAssetDataStreamCallback %s", m_filePath.c_str()); // Get the results @@ -183,13 +183,13 @@ namespace AZ::Data // the real interval we want to record below won't show up unless this is here. /**/ { - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::AzCore, this + 1, "AssetDataStream: %s", streamName); - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::AzCore, this + 1); + AZ_PROFILE_INTERVAL_START(AzCore, this + 1, "AssetDataStream: %s", streamName); + AZ_PROFILE_INTERVAL_END(AzCore, this + 1); } /**/ // Start a timespan marker to track the full load time for the requested asset. - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::AzCore, this, "AssetLoad: %s", streamName); + AZ_PROFILE_INTERVAL_START(AzCore, this, "AssetLoad: %s", streamName); // Lock the allocator to ensure it remains active from Open to Close. m_bufferAllocator->LockAllocator(); @@ -216,7 +216,7 @@ namespace AZ::Data ClearInternalStateData(); // End the load time timespan marker for this asset. - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::AzCore, this); + AZ_PROFILE_INTERVAL_END(AzCore, this); } void AssetDataStream::RequestCancel() @@ -231,7 +231,7 @@ namespace AZ::Data void AssetDataStream::Seek(AZ::IO::OffsetType bytes, AZ::IO::GenericStream::SeekMode mode) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ::IO::OffsetType requestedOffset = 0; switch (mode) @@ -261,7 +261,7 @@ namespace AZ::Data AZ::IO::SizeType AssetDataStream::Read(AZ::IO::SizeType bytes, void* oBuffer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (m_curOffset >= m_loadedSize) { return 0; diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp index 2a71baea46..f31859c14d 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp @@ -163,7 +163,7 @@ namespace AZ else { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "AZ::Data::LoadAssetJob::Process: %s", + AZ_PROFILE_SCOPE(AzCore, "AZ::Data::LoadAssetJob::Process: %s", asset.GetHint().c_str()); AZ_ASSET_ATTACH_TO_SCOPE(this); @@ -198,7 +198,7 @@ namespace AZ if(cl_assetLoadDelay > 0) { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::AzCore, "LoadData suspended"); + AZ_PROFILE_SCOPE(AzCore, "LoadData suspended"); AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(cl_assetLoadDelay)); } @@ -314,7 +314,7 @@ namespace AZ protected: void Wait() { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "WaitForAsset - %s", m_assetData.GetHint().c_str()); + AZ_PROFILE_SCOPE(AzCore, "WaitForAsset - %s", m_assetData.GetHint().c_str()); // Continue to loop until the load completes. (Most of the time in the loop will be spent in a thread-blocking state) while (!m_loadCompleted) @@ -344,7 +344,7 @@ namespace AZ void Finish() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); m_loadCompleted = true; m_waitEvent.release(); } @@ -403,7 +403,7 @@ namespace AZ void SaveAsset() { auto asset = m_asset.GetStrongReference(); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); bool isSaved = false; AssetStreamInfo saveInfo = m_owner->GetSaveStreamInfoForAsset(asset.GetId(), asset.GetType()); if (saveInfo.IsValid()) @@ -565,7 +565,7 @@ namespace AZ //========================================================================= void AssetManager::DispatchEvents() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AssetManagerNotificationBus::Broadcast(&AssetManagerNotificationBus::Events::OnAssetEventsDispatchBegin); AssetBus::ExecuteQueuedEvents(); AssetManagerNotificationBus::Broadcast(&AssetManagerNotificationBus::Events::OnAssetEventsDispatchEnd); @@ -937,14 +937,14 @@ namespace AZ Asset AssetManager::GetAssetInternal(const AssetId& assetId, [[maybe_unused]] const AssetType& assetType, AssetLoadBehavior assetReferenceLoadBehavior, const AssetLoadParameters& loadParams, AssetInfo assetInfo /*= () */, bool signalLoaded /*= false */) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Error("AssetDatabase", assetId.IsValid(), "GetAsset called with invalid asset Id."); AZ_Error("AssetDatabase", !assetType.IsNull(), "GetAsset called with invalid asset type."); bool assetMissing = false; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "GetAsset: GetAssetInfo"); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: GetAssetInfo"); // Attempt to look up asset info from catalog // This is so that when assetId is a legacy id, we're operating on the canonical id anyway @@ -974,7 +974,7 @@ namespace AZ } } - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "GetAsset: %s", assetInfo.m_relativePath.c_str()); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: %s", assetInfo.m_relativePath.c_str()); AZ_ASSET_NAMED_SCOPE("GetAsset: %s", assetInfo.m_relativePath.c_str()); AZStd::shared_ptr dataStream; @@ -992,7 +992,7 @@ namespace AZ // check if asset already exists { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "GetAsset: FindAsset"); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: FindAsset"); AssetMap::iterator it = m_assets.find(assetInfo.m_assetId); if (it != m_assets.end()) @@ -1007,7 +1007,7 @@ namespace AZ } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "GetAsset: FindAssetHandler"); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: FindAssetHandler"); // find the asset type handler AssetHandlerMap::iterator handlerIt = m_handlers.find(assetInfo.m_assetType); @@ -1019,7 +1019,7 @@ namespace AZ handler = handlerIt->second; if (isNewEntry) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "GetAsset: CreateAsset"); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: CreateAsset"); assetData = handler->CreateAsset(assetInfo.m_assetId, assetInfo.m_assetType); if (assetData) @@ -1043,7 +1043,7 @@ namespace AZ { if (isNewEntry && assetData->IsRegisterReadonlyAndShareable()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "GetAsset: RegisterAsset"); + AZ_PROFILE_SCOPE(AzCore, "GetAsset: RegisterAsset"); m_assets.insert(AZStd::make_pair(assetInfo.m_assetId, assetData)); } if (assetData->GetStatus() == AssetData::AssetStatus::NotLoaded) @@ -1596,7 +1596,7 @@ namespace AZ const AZ::Data::AssetStreamInfo& streamInfo, bool isReload, AssetHandler* handler, const AssetLoadParameters& loadParams, bool signalLoaded) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Set up the callback that will process the asset data once the raw file load is finished. // The callback is declared as mutable so that we can clear weakAsset within the callback. The refcount in weakAsset @@ -1613,7 +1613,7 @@ namespace AZ if (loadingAsset) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "AZ::Data::LoadAssetStreamerCallback %s", + AZ_PROFILE_SCOPE(AzCore, "AZ::Data::LoadAssetStreamerCallback %s", loadingAsset.GetHint().c_str()); { AZStd::scoped_lock assetLock(m_assetMutex); @@ -1788,7 +1788,7 @@ namespace AZ //========================================================================= void AssetManager::RegisterAssetLoading(const Asset& asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AssetData* data = asset.Get(); if (data) @@ -1803,7 +1803,7 @@ namespace AZ //========================================================================= void AssetManager::UnregisterAssetLoading([[maybe_unused]] const Asset& asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); } //========================================================================= @@ -2050,7 +2050,7 @@ namespace AZ AZStd::shared_ptr stream, const AssetFilterCB& assetLoadFilterCB) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "AssetHandler::LoadAssetData - %s", asset.GetHint().c_str()); + AZ_PROFILE_SCOPE(AzCore, "AssetHandler::LoadAssetData - %s", asset.GetHint().c_str()); #ifdef AZ_ENABLE_TRACING auto start = AZStd::chrono::system_clock::now(); @@ -2119,7 +2119,7 @@ namespace AZ void AssetManager::PostLoad(AZ::Data::Asset& asset, bool loadSucceeded, bool isReload, AZ::Data::AssetHandler* assetHandler) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!assetHandler) { assetHandler = GetHandler(asset.GetType()); diff --git a/Code/Framework/AzCore/AzCore/AzCoreModule.cpp b/Code/Framework/AzCore/AzCore/AzCoreModule.cpp index 6afcb6a334..d2b1b141a9 100644 --- a/Code/Framework/AzCore/AzCore/AzCoreModule.cpp +++ b/Code/Framework/AzCore/AzCore/AzCoreModule.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -45,9 +44,6 @@ namespace AZ LoggerSystemComponent::CreateDescriptor(), EventSchedulerSystemComponent::CreateDescriptor(), -#if !defined(_RELEASE) - Statistics::StatisticalProfilerProxySystemComponent::CreateDescriptor(), -#endif // #if !defined(_RELEASE) #if !defined(AZCORE_EXCLUDE_LUA) ScriptSystemComponent::CreateDescriptor(), #endif // #if !defined(AZCORE_EXCLUDE_LUA) @@ -61,10 +57,6 @@ namespace AZ azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), - -#if !defined(_RELEASE) - azrtti_typeid(), -#endif // #if !defined(_RELEASE) }; } } diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 7b1060a10f..5114ea19ec 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -1394,8 +1394,7 @@ namespace AZ void ComponentApplication::Tick(float deltaOverride /*= -1.f*/) { { - AZ_PROFILE_TIMER("System", "Component application simulation tick function"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_SCOPE(System, "Component application simulation tick"); AZStd::chrono::system_clock::time_point now = AZStd::chrono::system_clock::now(); @@ -1408,12 +1407,12 @@ namespace AZ } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "ComponentApplication::Tick:ExecuteQueuedEvents"); + AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:ExecuteQueuedEvents"); TickBus::ExecuteQueuedEvents(); } m_currentTime = now; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "ComponentApplication::Tick:OnTick"); + AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:OnTick"); EBUS_EVENT(TickBus, OnTick, m_deltaTime, ScriptTimePoint(now)); } } @@ -1428,8 +1427,7 @@ namespace AZ //========================================================================= void ComponentApplication::TickSystem() { - AZ_PROFILE_TIMER("System", "Component application system tick function"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_SCOPE(System, "Component application tick"); SystemTickBus::ExecuteQueuedEvents(); EBUS_EVENT(SystemTickBus, OnSystemTick); diff --git a/Code/Framework/AzCore/AzCore/Component/Entity.cpp b/Code/Framework/AzCore/AzCore/Component/Entity.cpp index 09b5526b6c..00c1895261 100644 --- a/Code/Framework/AzCore/AzCore/Component/Entity.cpp +++ b/Code/Framework/AzCore/AzCore/Component/Entity.cpp @@ -189,7 +189,7 @@ namespace AZ void Entity::Activate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(m_state == State::Init, "Entity should be in Init state to be Activated!"); @@ -226,7 +226,7 @@ namespace AZ void Entity::Deactivate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ::ComponentApplicationRequests* componentApplication = AZ::Interface::Get(); if (componentApplication != nullptr) @@ -1034,7 +1034,7 @@ namespace AZ Entity::DependencySortOutcome Entity::DependencySort(ComponentArrayType& inOutComponents) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); using DependencySortInternal::ComponentInfo; using DependencySortInternal::InvalidEntry; diff --git a/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp b/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp index 9bb41bfd58..8241400aac 100644 --- a/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Component/EntityUtils.cpp @@ -40,7 +40,7 @@ namespace AZ //========================================================================= void EnumerateEntityIds(const void* classPtr, const Uuid& classUuid, const EntityIdVisitor& visitor, SerializeContext* context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!context) { diff --git a/Code/Framework/AzCore/AzCore/Component/EntityUtils.h b/Code/Framework/AzCore/AzCore/Component/EntityUtils.h index a5d0e4e53f..ce258bc637 100644 --- a/Code/Framework/AzCore/AzCore/Component/EntityUtils.h +++ b/Code/Framework/AzCore/AzCore/Component/EntityUtils.h @@ -54,7 +54,7 @@ namespace AZ template unsigned int ReplaceEntityRefs(T* classPtr, const EntityIdMapper& mapper, SerializeContext* context = nullptr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto idMapper = [&mapper](const EntityId& originalId, bool isEntityId, const IdUtils::Remapper::IdGenerator&) -> EntityId { return mapper(originalId, isEntityId); @@ -83,7 +83,7 @@ namespace AZ template unsigned int ReplaceEntityIds(T* classPtr, const EntityIdMapper& mapper, SerializeContext* context = nullptr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto idMapper = [&mapper](const EntityId& originalId, bool isEntityId, const IdUtils::Remapper::IdGenerator&) -> EntityId { return mapper(originalId, isEntityId); @@ -97,7 +97,7 @@ namespace AZ template unsigned int ReplaceEntityIdsAndEntityRefs(T* classPtr, const EntityIdMapper& mapper, SerializeContext* context = nullptr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto idMapper = [&mapper](const EntityId& originalId, bool isEntityId, const IdUtils::Remapper::IdGenerator&) -> EntityId { return mapper(originalId, isEntityId); diff --git a/Code/Framework/AzCore/AzCore/Debug/EventTrace.h b/Code/Framework/AzCore/AzCore/Debug/EventTrace.h index 5faf08f46e..8d096707ba 100644 --- a/Code/Framework/AzCore/AzCore/Debug/EventTrace.h +++ b/Code/Framework/AzCore/AzCore/Debug/EventTrace.h @@ -42,11 +42,11 @@ namespace AZ # define AZ_TRACE_METHOD_NAME_CATEGORY(name, category) AZ::Debug::EventTrace::ScopedSlice AZ_JOIN(ScopedSlice__, __LINE__)(name, category); # define AZ_TRACE_METHOD_NAME(name) \ AZ_TRACE_METHOD_NAME_CATEGORY(name, "") \ - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzTrace, name) + AZ_PROFILE_SCOPE(AzTrace, name) # define AZ_TRACE_METHOD() \ AZ_TRACE_METHOD_NAME_CATEGORY(AZ_FUNCTION_SIGNATURE, "") \ - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzTrace) + AZ_PROFILE_FUNCTION(AzTrace) #else # define AZ_TRACE_METHOD_NAME_CATEGORY(name, category) # define AZ_TRACE_METHOD_NAME(name) AZ_TRACE_METHOD_NAME_CATEGORY(name, "") diff --git a/Code/Framework/AzCore/AzCore/Debug/MemoryProfiler.h b/Code/Framework/AzCore/AzCore/Debug/MemoryProfiler.h new file mode 100644 index 0000000000..5b22e20c60 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Debug/MemoryProfiler.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#ifndef AZ_PROFILE_MEMORY_ALLOC +// No other profiler has defined the performance markers AZ_PROFILE_MEMORY_ALLOC (and friends), fall back to a Driller implementation (currently empty) +# define AZ_PROFILE_MEMORY_ALLOC(category, address, size, context) +# define AZ_PROFILE_MEMORY_ALLOC_EX(category, filename, lineNumber, address, size, context) +# define AZ_PROFILE_MEMORY_FREE(category, address) +# define AZ_PROFILE_MEMORY_FREE_EX(category, filename, lineNumber, address) +#endif diff --git a/Code/Framework/AzCore/AzCore/Debug/Profiler.cpp b/Code/Framework/AzCore/AzCore/Debug/Profiler.cpp index eda7330cfc..649bb0b8d7 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Profiler.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Profiler.cpp @@ -18,14 +18,14 @@ #include #include -#ifdef USE_PIX -#include -#include -#endif - - namespace AZ { + uint32_t ProfileScope::GetSystemID(const char* system) + { + // TODO: stable ids for registered budgets + return AZ::Crc32(system); + } + namespace Debug { ////////////////////////////////////////////////////////////////////////// @@ -501,10 +501,6 @@ namespace AZ ProfilerRegister* ProfilerRegister::TimerCreateAndStart(const char* systemName, const char* name, ProfilerSection * section, const char* function, int line) { -#if defined(USE_PIX) - PIXBeginEvent(PIX_COLOR(0, 0, 1), "%s:%s", name, function); -#endif - AZStd::chrono::system_clock::time_point start = AZStd::chrono::system_clock::now(); ProfilerRegister* reg = CreateRegister(systemName, name, function, line, ProfilerRegister::PRT_TIME); AZStd::chrono::system_clock::time_point end = AZStd::chrono::system_clock::now(); @@ -548,10 +544,6 @@ namespace AZ { ProfilerRegister* reg = this; -#if defined(USE_PIX) - PIXBeginEvent(PIX_COLOR(0, 0, 1), "%s:%s", reg->m_name, reg->m_function); -#endif - if (reg->m_isActive) { section->m_register = reg; @@ -570,10 +562,6 @@ namespace AZ //========================================================================= void ProfilerRegister::TimerStop() { -#if defined(USE_PIX) - PIXEndEvent(); -#endif - AZStd::chrono::system_clock::time_point end = AZStd::chrono::system_clock::now(); ProfilerSection* section = m_threadData->m_stack.back(); AZStd::chrono::microseconds elapsedTime = end - section->m_start; diff --git a/Code/Framework/AzCore/AzCore/Debug/Profiler.h b/Code/Framework/AzCore/AzCore/Debug/Profiler.h index 6dcdcfdddc..faf511e375 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Profiler.h +++ b/Code/Framework/AzCore/AzCore/Debug/Profiler.h @@ -10,304 +10,48 @@ #include #include -namespace AZ -{ - namespace Debug - { - using ProfileCategoryPrimitiveType = AZ::u64; +#ifdef USE_PIX +#include +#include +// The pix3 header unfortunately brings in other Windows macros we need to undef +#undef DeleteFile +#undef LoadImage +#endif - /** - * Profiling categories consumed by AZ_PROFILE_FUNCTION and AZ_PROFILE_SCOPE variants for profile filtering - */ - enum class ProfileCategory : ProfileCategoryPrimitiveType - { - // These initial categories match up with the legacy EProfiledSubsystem categories - Any = 0, - Renderer, - ThreeDEngine, - Particle, - AI, - Animation, - Movie, - Entity, - Font, - Network, - Physics, - Script, - ScriptCFunc, - Audio, - Editor, - System, - Action, - Game, - Input, - Sync, - - // Legacy network traffic categories - LegacyNetworkTrafficReserved, - LegacyDeviceReserved, - - // must match EProfiledSubsystem::PROFILE_LAST_SUBSYSTEM - LegacyLast, - - // Bulk category via AZ_TRACE_METHOD - AzTrace, - - AzCore, - AzRender, - AzFramework, - AzToolsFramework, - ScriptCanvas, - LegacyTerrain, - Terrain, - Cloth, - // Add new major categories here (and add names to the parallel position in ProfileCategoryNames) - these categories are enabled by default - - FirstDetailedCategory, - RendererDetailed = FirstDetailedCategory, - ThreeDEngineDetailed, - JobManagerDetailed, - - AzRenderDetailed, - ClothDetailed, - // Add new detailed categories here (and add names to the parallel position in ProfileCategoryNames) -- these categories are disabled by default - - // Internal reserved categories, not for use with performance events - FirstReservedCategory, - MemoryReserved = FirstReservedCategory, - Global, - - // Must be last - Count - }; - static_assert(static_cast(ProfileCategory::Count) < (sizeof(ProfileCategoryPrimitiveType) * 8), "The number of profile categories must not exceed the number of bits in ProfileCategoryPrimitiveType"); - - /** - * Parallel array to ProfileCategory as string category names to be used as Driller category names or for debug purposes - */ - static const char * ProfileCategoryNames[] = - { - "Any", - "Renderer", - "3DEngine", - "Particle", - "AI", - "Animation", - "Movie", - "Entity", - "Font", - "Network", - "Physics", - "Script", - "ScriptCFunc", - "Audio", - "Editor", - "System", - "Action", - "Game", - "Input", - "Sync", - - "LegacyNetworkTrafficReserved", - "LegacyDeviceReserved", - - "LegacyLast", - - "AzTrace", - "AzCore", - "AzRender", - "AzFramework", - "AzToolsFramework", - "ScriptCanvas", - "LegacyTerrain", - "Terrain", - "Cloth", - - "RendererDetailed", - "3DEngineDetailed", - "JobManagerDetailed", - "AzRenderDetailed", - "ClothDetailed", - - "MemoryReserved", - "Global" - }; - static_assert(AZ_ARRAY_SIZE(ProfileCategoryNames) == static_cast(ProfileCategory::Count), "ProfileCategory and ProfileCategoryNames size mismatch"); - } -} - -// Must be included below ProfileCategory #ifdef AZ_PROFILE_TELEMETRY # include #endif #if defined(AZ_PROFILER_MACRO_DISABLE) // by default we never disable the profiler registers as their overhead should be minimal, you can still do that for your code though. -# define AZ_PROFILE_TIMER(...) -# define AZ_PROFILE_TIMER_END(_SectionVariableName) -# define AZ_PROFILE_VALUE_SET(...) -# define AZ_PROFILE_VALUE_ADD(...) -# define AZ_PROFILE_VALUE_SET_NAMED(...) -# define AZ_PROFILE_VALUE_ADD_NAMED(...) +# define AZ_PROFILE_SCOPE(...) +# define AZ_PROFILE_FUNCTION(...) +# define AZ_PROFILE_BEGIN(...) +# define AZ_PROFILE_END(...) #else -/// Implementation when we have only 1 param system name -# define AZ_PROFILE_TIMER_1(_1) AZ_PROFILE_TIMER_2(_1, nullptr) -/// Implementation when we have 2 params (_1 system name and _2 is name of the "section"/register/profiled section - used for debug) -# define AZ_PROFILE_TIMER_2(_1, _2) AZ_PROFILE_TIMER_3(_1, _2, AZ_JOIN(azProfileSection, __LINE__)) -/// Implementation when we have all 3 params (system name, section/register name, section variable name) -# define AZ_PROFILE_TIMER_3(_1, _2, _3) \ - AZ::Debug::ProfilerSection _3; \ - if (AZ::u64 profilerId = AZ::Debug::Profiler::GetId()) { \ - static AZ_THREAD_LOCAL AZ::Internal::RegisterData AZ_JOIN(azProfileRegister, __LINE__) = {0, 0}; \ - if (AZ_JOIN(azProfileRegister, __LINE__).m_profilerId != profilerId) { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register = AZ::Debug::ProfilerRegister::TimerCreateAndStart(_1, _2, &_3, AZ_FUNCTION_SIGNATURE, __LINE__); \ - AZ_JOIN(azProfileRegister, __LINE__).m_profilerId = profilerId; \ - } else { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register->TimerStart(&_3); \ - } \ - } - /** * Macro to declare a profile section for the current scope { }. - * format is: AZ_PROFILE_TIMER(const char* systemName, const char* sectionDescription = nullptr , optional sectionName ) - * \param _1 is required and it's 'const char*' of the system name of which system this scope/register belongs to. - * \param _2 is optional and it's 'const char*' with a name for the "section"/register/profiled section - used as description. If not provided a "Anonymous" will be set. - * \param _3 is optional unique name for a section C++ variable (so you can stop the SCOPE as you wish). If not provided a default unique name is created. + * format is: AZ_PROFILE_SCOPE(categoryName, const char* formatStr, ...) */ -# define AZ_PROFILE_TIMER(...) AZ_MACRO_SPECIALIZE(AZ_PROFILE_TIMER_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__)) - -// Optional (USE ONLY IN EXTREME CASES!!!) scope end command for named sections, so you stop the profiler register timing before it goes out of scope. -# define AZ_PROFILE_TIMER_END(_SectionVariableName) { _SectionVariableName.Stop(); } - -/** - * Macro to operate on custom values. All values are AZ::s64. You can provide up to 5 values. - * format is AZ_PROFILE_VALUE_SET/ADD(const char* systemName, const char* valueName, - * value1, optional value2, optional value3, optional value 4, optional value5, optional registerName (for direct register manipulation for EXPERTS ONLY)). - * \param _SystemName is required and it's 'const char*' of the system name of which system this scope/register belongs to. - * \param _RegisterName is required and it's 'const char*' with a name for the register - used as description. - * \param 3 is required and it's AZ::s64, operates on m_value1. - * \param 4 is optional and it's AZ::s64, operates on m_value2. - * \param 5 is optional and it's AZ::s64, operates on m_value3. - * \param 6 is optional and it's AZ::s64, operates on m_value4. - * \param 7 is optional and it's AZ::s64, operates on m_value5. - */ -# define AZ_PROFILE_VALUE_SET(_SystemName, _RegisterName, ...) \ - if (AZ::u64 profilerId = AZ::Debug::Profiler::GetId()) { \ - static AZ_THREAD_LOCAL AZ::Internal::RegisterData AZ_JOIN(azProfileRegister, __LINE__) = {0, 0}; \ - if (AZ_JOIN(azProfileRegister, __LINE__).m_profilerId != profilerId) { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register = AZ::Debug::ProfilerRegister::ValueCreate(_SystemName, _RegisterName, AZ_FUNCTION_SIGNATURE, __LINE__); \ - AZ_JOIN(azProfileRegister, __LINE__).m_profilerId = profilerId; \ - } \ - AZ_JOIN(azProfileRegister, __LINE__).m_register->ValueSet(__VA_ARGS__); \ - } - -/// Same as AZ_PROFILE_VALUE_SET except is add the values passed in the macro (you can use -(value), to subtract values) -# define AZ_PROFILE_VALUE_ADD(_SystemName, _RegisterName, ...) \ - if (AZ::u64 profilerId = AZ::Debug::Profiler::GetId()) { \ - static AZ_THREAD_LOCAL AZ::Internal::RegisterData AZ_JOIN(azProfileRegister, __LINE__) = {0, 0}; \ - if (AZ_JOIN(azProfileRegister, __LINE__).m_profilerId != profilerId) { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register = AZ::Debug::ProfilerRegister::ValueCreate(_SystemName, _RegisterName, AZ_FUNCTION_SIGNATURE, __LINE__); \ - AZ_JOIN(azProfileRegister, __LINE__).m_profilerId = profilerId; \ - } \ - AZ_JOIN(azProfileRegister, __LINE__).m_register->ValueAdd(__VA_ARGS__); \ - } - -/** - * Same as AZ_PROFILER_VALUE_SET but with option to access the register by name. (USE ONLY IN EXTREME CASES!!!) - * \param _RegisterVaribaleName is optional unique name for a register C++ variable so you can manipulate the register. - */ -# define AZ_PROFILE_VALUE_SET_NAMED(_SystemName, _RegisterName, _RegisterVaribaleName, ...) \ - AZ::Debug::ProfilerRegister * _RegisterVaribaleName = nullptr; \ - if (AZ::u64 profilerId = AZ::Debug::Profiler::GetId()) { \ - static AZ_THREAD_LOCAL AZ::Internal::RegisterData AZ_JOIN(azProfileRegister, __LINE__) = {0, 0}; \ - if (AZ_JOIN(azProfileRegister, __LINE__).m_profilerId != profilerId) { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register = AZ::Debug::ProfilerRegister::ValueCreate(_SystemName, _RegisterName, AZ_FUNCTION_SIGNATURE, __LINE__); \ - AZ_JOIN(azProfileRegister, __LINE__).m_profilerId = profilerId; \ - } \ - AZ_JOIN(azProfileRegister, __LINE__).m_register->ValueSet(__VA_ARGS__); \ - _RegisterVaribaleName = AZ_JOIN(azProfileRegister, __LINE__).m_register; \ - } - -/// Same as AZ_PROFILE_VALUE_SET_NAMED but add the values to the current. (USE ONLY IN EXTREME CASES!!!) -# define AZ_PROFILE_VALUE_ADD_NAMED(_SystemName, _RegisterName, _RegisterVaribaleName, ...) \ - AZ::Debug::ProfilerRegister * _RegisterVaribaleName = nullptr; \ - if (AZ::u64 profilerId = AZ::Debug::Profiler::GetId()) { \ - static AZ_THREAD_LOCAL AZ::Internal::RegisterData AZ_JOIN(azProfileRegister, __LINE__) = {0, 0}; \ - if (AZ_JOIN(azProfileRegister, __LINE__).m_profilerId != profilerId) { \ - AZ_JOIN(azProfileRegister, __LINE__).m_register = AZ::Debug::ProfilerRegister::ValueCreate(_SystemName, _RegisterName, AZ_FUNCTION_SIGNATURE, __LINE__); \ - AZ_JOIN(azProfileRegister, __LINE__).m_profilerId = profilerId; \ - } \ - AZ_JOIN(azProfileRegister, __LINE__).m_register->ValueAdd(__VA_ARGS__); \ - _RegisterVaribaleName = AZ_JOIN(azProfileRegister, __LINE__).m_register; \ - } +# define AZ_PROFILE_SCOPE(category, formatStr, ...) ::AZ::ProfileScope AZ_JOIN(azProfileScope, __LINE__){ #category, formatStr, __VA_ARGS__ } +# define AZ_PROFILE_FUNCTION(category) AZ_PROFILE_SCOPE(category, AZ_FUNCTION_SIGNATURE) +// Prefer using the scoped macros which automatically end the event (AZ_PROFILE_SCOPE/AZ_PROFILE_FUNCTION) +# define AZ_PROFILE_BEGIN(category, name, ...) ::AZ::ProfileScope::BeginRegion(#category, name, __VA_ARGS__) +# define AZ_PROFILE_END() ::AZ::ProfileScope::EndRegion() #endif // AZ_PROFILER_MACRO_DISABLE -#ifndef AZ_PROFILE_FUNCTION -// No other profiler has defined the performance markers AZ_PROFILE_SCOPE (and friends), fallback to a Driller implementation -# define AZ_INTERNAL_PROF_VERIFY_CAT(category) static_assert(category < AZ::Debug::ProfileCategory::Count, "Invalid profile category") -# define AZ_INTERNAL_PROF_CAT_NAME(category) AZ::Debug::ProfileCategoryNames[static_cast(category)] - -# define AZ_PROFILE_FUNCTION(category) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) -# define AZ_PROFILE_FUNCTION_STALL(category) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) -# define AZ_PROFILE_FUNCTION_IDLE(category) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) - -# define AZ_PROFILE_SCOPE(category, name) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)); (void)(name) -# define AZ_PROFILE_SCOPE_STALL(category, name) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)); (void)(name) -# define AZ_PROFILE_SCOPE_IDLE(category, name) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)); (void)(name) - -# define AZ_PROFILE_SCOPE_DYNAMIC(category, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) -# define AZ_PROFILE_SCOPE_STALL_DYNAMIC(category, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) -# define AZ_PROFILE_SCOPE_IDLE_DYNAMIC(category, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_PROFILE_TIMER(AZ_INTERNAL_PROF_CAT_NAME(category)) -#endif - -#ifndef AZ_PROFILE_EVENT_BEGIN -// No other profiler has defined the performance markers AZ_PROFILE_EVENT_START/END, fallback to a Driller implementation (currently empty) -# define AZ_PROFILE_EVENT_BEGIN(category, name) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); (void)(name) -# define AZ_PROFILE_EVENT_END(category) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category) -#endif - #ifndef AZ_PROFILE_INTERVAL_START // No other profiler has defined the performance markers AZ_PROFILE_INTERVAL_START/END, fallback to a Driller implementation (currently empty) -# define AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) static_assert(sizeof(id) <= sizeof(AZ::u64), "Interval id must be a unique value no larger than 64-bits") -# define AZ_PROFILE_INTERVAL_START(category, id, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) -# define AZ_PROFILE_INTERVAL_START_COLORED(category, id, color, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); (void)(color); AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) -# define AZ_PROFILE_INTERVAL_END(category, id) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) -# define AZ_PROFILE_INTERVAL_SCOPED(category, id, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) +# define AZ_PROFILE_INTERVAL_START(...) +# define AZ_PROFILE_INTERVAL_START_COLORED(...) +# define AZ_PROFILE_INTERVAL_END(...) +# define AZ_PROFILE_INTERVAL_SCOPED(...) #endif #ifndef AZ_PROFILE_DATAPOINT // No other profiler has defined the performance markers AZ_PROFILE_DATAPOINT, fallback to a Driller implementation (currently empty) -#define AZ_PROFILE_DATAPOINT(category, value, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); static_cast(value) -#define AZ_PROFILE_DATAPOINT_PERCENT(category, value, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); static_cast(value) -#endif - -#ifndef AZ_PROFILE_MEMORY_ALLOC -// No other profiler has defined the performance markers AZ_PROFILE_MEMORY_ALLOC (and friends), fall back to a Driller implementation (currently empty) -# define AZ_PROFILE_MEMORY_ALLOC(category, address, size, context) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); (void)(context) -# define AZ_PROFILE_MEMORY_ALLOC_EX(category, filename, lineNumber, address, size, context) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); (void)(context) -# define AZ_PROFILE_MEMORY_FREE(category, address) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category) -# define AZ_PROFILE_MEMORY_FREE_EX(category, filename, lineNumber, address) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category) +# define AZ_PROFILE_DATAPOINT(...) +# define AZ_PROFILE_DATAPOINT_PERCENT(...) #endif namespace AZStd @@ -317,6 +61,43 @@ namespace AZStd namespace AZ { + class ProfileScope + { + public: + static uint32_t GetSystemID(const char* system); + + template + static void BeginRegion(const char* system, char const* eventName, [[maybe_unused]] T const&... args) + { + // TODO: Verification that the supplied system name corresponds to a known budget +#if defined(USE_PIX) + PIXBeginEvent(PIX_COLOR_INDEX(GetSystemID(system) & 0xff), eventName, args...); +#else + (void)system; + (void)eventName; +#endif + // TODO: injecting instrumentation for other profilers + } + + static void EndRegion() + { +#if defined(USE_PIX) + PIXEndEvent(); +#endif + } + + template + ProfileScope(const char* system, char const* eventName, T const&... args) + { + BeginRegion(system, eventName, args...); + } + + ~ProfileScope() + { + EndRegion(); + } + }; + namespace Debug { class ProfilerSection; diff --git a/Code/Framework/AzCore/AzCore/IO/FileIO.cpp b/Code/Framework/AzCore/AzCore/IO/FileIO.cpp index 125951c261..a6ce8cf101 100644 --- a/Code/Framework/AzCore/AzCore/IO/FileIO.cpp +++ b/Code/Framework/AzCore/AzCore/IO/FileIO.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ @@ -353,7 +354,7 @@ namespace AZ m_filename = path; } - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, &m_filename, 0xff0000ff, "FileIO: %s", m_filename.c_str()); + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, &m_filename, 0xff0000ff, "FileIO: %s", m_filename.c_str()); return result; } @@ -372,7 +373,7 @@ namespace AZ FileIOBase::GetInstance()->Close(m_handle); m_handle = InvalidHandle; m_ownsHandle = false; - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::AzCore, &m_filename); + AZ_PROFILE_INTERVAL_END(AzCore, &m_filename); } } @@ -425,7 +426,7 @@ namespace AZ void FileIOStream::Seek(OffsetType bytes, SeekMode mode) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "FileIO Seek: %s", m_filename.c_str()); + AZ_PROFILE_SCOPE(AzCore, "FileIO Seek: %s", m_filename.c_str()); AZ_Assert(FileIOBase::GetInstance(), "FileIO is not initialized."); AZ_Assert(IsOpen(), "Cannot seek on a FileIOStream that is not open."); @@ -453,7 +454,7 @@ namespace AZ SizeType FileIOStream::Read(SizeType bytes, void* oBuffer) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "FileIO Read: %s", m_filename.c_str()); + AZ_PROFILE_SCOPE(AzCore, "FileIO Read: %s", m_filename.c_str()); AZ_Assert(FileIOBase::GetInstance(), "FileIO is not initialized."); AZ_Assert(IsOpen(), "Cannot read from a FileIOStream that is not open."); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp index f358370be5..09ab10b8cf 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -245,7 +246,7 @@ namespace AZ auto continueReadFile = [this, request](FileRequest& fileSizeRequest) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(m_numMetaDataRetrievalInProgress > 0, "More requests have completed meta data retrieval in the Block Cache than were requested."); m_numMetaDataRetrievalInProgress--; @@ -454,7 +455,7 @@ namespace AZ section.m_readSize, sharedRead); readRequest->SetCompletionCallback([this](FileRequest& request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); CompleteRead(request); }); section.m_cacheBlockIndex = cacheLocation; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp index 2e9dd43e83..44bf36bd9d 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -367,7 +368,7 @@ namespace AZ { auto callback = [this, nextRequest](const FileRequest& checkRequest) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareReadRequest expected FileExistsCheck but got another command."); @@ -426,7 +427,7 @@ namespace AZ { auto callback = [this, nextRequest](const FileRequest& checkRequest) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareDedicatedCache expected FileExistsCheck but got another command."); @@ -508,7 +509,7 @@ namespace AZ archiveReadRequest->SetCompletionCallback( [this, readSlot = i](FileRequest& request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); FinishArchiveRead(&request, readSlot); }); m_next->QueueRequest(archiveReadRequest); @@ -596,7 +597,7 @@ namespace AZ waitRequest->SetCompletionCallback([this, jobSlot](FileRequest& request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); FinishDecompression(&request, jobSlot); }); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp index 9e019745a3..00c1c63933 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -218,7 +219,7 @@ namespace AZ subRequest->CreateRead(pending.m_request, pending.m_output, bufferSize, data->m_path, pending.m_offset, readSize, data->m_sharedRead); subRequest->SetCompletionCallback([this](FileRequest&) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); QueuePendingRequest(); }); m_next->QueueRequest(subRequest); @@ -302,7 +303,7 @@ namespace AZ offset, readSize, data->m_sharedRead); subRequest->SetCompletionCallback([this, bufferSlot]([[maybe_unused]] FileRequest& request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); BufferCopyInformation& copyInfo = m_bufferCopyInformation[bufferSlot]; memcpy(copyInfo.m_target, GetBufferSlot(bufferSlot) + copyInfo.m_bufferOffset, copyInfo.m_size); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp index d6e5a7bb2c..e7f9b0fd18 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -138,14 +139,14 @@ namespace AZ::IO while (m_isRunning) { { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::AzCore, "Scheduler suspended."); + AZ_PROFILE_SCOPE(AzCore, "Scheduler suspended."); m_context.SuspendSchedulingThread(); } // Only do processing if the thread hasn't been suspended. while (!m_isSuspended) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "Scheduler main loop."); + AZ_PROFILE_SCOPE(AzCore, "Scheduler main loop."); // Always schedule requests first as the main Streamer thread could have been asleep for a long time due to slow reading // but also don't schedule after every change in the queue as scheduling is not cheap. @@ -154,7 +155,7 @@ namespace AZ::IO { do { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "Scheduler queue requests."); + AZ_PROFILE_SCOPE(AzCore, "Scheduler queue requests."); // If there are pending requests and available slots, queue the next requests. while(m_context.GetNumPreparedRequests() > 0) { @@ -208,7 +209,7 @@ namespace AZ::IO void Scheduler::Thread_QueueNextRequest() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); FileRequest* next = m_context.PopPreparedRequest(); next->SetStatus(IStreamerTypes::RequestStatus::Processing); @@ -279,7 +280,7 @@ namespace AZ::IO m_processingSize += info.m_uncompressedSize; #endif } - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, next, ProfilerColor, + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, next, ProfilerColor, "Streamer queued %zu: %s", next->GetCommand().index(), parentReadRequest->m_path.GetRelativePath()); m_threadData.m_streamStack->QueueRequest(next); } @@ -293,7 +294,7 @@ namespace AZ::IO } else if constexpr (AZStd::is_same_v || AZStd::is_same_v) { - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, next, ProfilerColor, + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, next, ProfilerColor, "Streamer queued %zu", next->GetCommand().index()); // Flushing becomes a lot less complicated if there are no jobs and/or asynchronous I/O running. This does mean overall // longer processing time as bubbles are introduced into the pipeline, but flushing is an infrequent event that only @@ -303,7 +304,7 @@ namespace AZ::IO } else { - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, next, ProfilerColor, + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, next, ProfilerColor, "Streamer queued %zu", next->GetCommand().index()); m_threadData.m_streamStack->QueueRequest(next); } @@ -312,13 +313,13 @@ namespace AZ::IO bool Scheduler::Thread_ExecuteRequests() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); return m_threadData.m_streamStack->ExecuteRequests(); } bool Scheduler::Thread_PrepareRequests(AZStd::vector& outstandingRequests) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); { AZStd::scoped_lock lock(m_pendingRequestsLock); @@ -372,7 +373,7 @@ namespace AZ::IO void Scheduler::Thread_ProcessTillIdle() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); while (true) { @@ -390,7 +391,7 @@ namespace AZ::IO void Scheduler::Thread_ProcessCancelRequest(FileRequest* request, FileRequest::CancelData& data) { - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, request, ProfilerColor, "Streamer queued cancel"); + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued cancel"); auto& pending = m_context.GetPreparedRequests(); auto pendingIt = pending.begin(); while (pendingIt != pending.end()) @@ -412,7 +413,7 @@ namespace AZ::IO void Scheduler::Thread_ProcessRescheduleRequest(FileRequest* request, FileRequest::RescheduleData& data) { - AZ_PROFILE_INTERVAL_START_COLORED(AZ::Debug::ProfileCategory::AzCore, request, ProfilerColor, "Streamer queued reschedule"); + AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued reschedule"); auto& pendingRequests = m_context.GetPreparedRequests(); for (FileRequest* pending : pendingRequests) { @@ -543,7 +544,7 @@ namespace AZ::IO void Scheduler::Thread_ScheduleRequests() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZStd::chrono::system_clock::time_point now = AZStd::chrono::system_clock::now(); auto& pendingQueue = m_context.GetPreparedRequests(); @@ -554,7 +555,7 @@ namespace AZ::IO if (m_context.GetNumPreparedRequests() > 1) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, + AZ_PROFILE_SCOPE(AzCore, "Scheduler::Thread_ScheduleRequests - Sorting %i requests", m_context.GetNumPreparedRequests()); auto sorter = [this](const FileRequest* lhs, const FileRequest* rhs) -> bool { diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Statistics.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Statistics.cpp index 593c052853..e64c3cae74 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Statistics.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Statistics.cpp @@ -48,7 +48,7 @@ namespace AZ [[maybe_unused]] AZStd::string_view name, [[maybe_unused]] double value) { - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::AzCore, value, + AZ_PROFILE_DATAPOINT(AzCore, value, "Streamer/%.*s/%.*s (Raw)", aznumeric_cast(owner.size()), owner.data(), aznumeric_cast(name.size()), name.data()); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp index c4f9840a0b..6f33c0a216 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp @@ -59,7 +59,7 @@ namespace AZ void StorageDrive::PrepareRequest(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); if (AZStd::holds_alternative(request->GetCommand())) @@ -254,7 +254,7 @@ namespace AZ void StorageDrive::ReadFile(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "FileRequest queued on StorageDrive to be read didn't contain read data."); @@ -341,7 +341,7 @@ namespace AZ void StorageDrive::FileExistsRequest(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); auto& fileExists = AZStd::get(request->GetCommand()); @@ -359,7 +359,7 @@ namespace AZ void StorageDrive::FileMetaDataRetrievalRequest(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileMetaDataTimeAverage); auto& command = AZStd::get(request->GetCommand()); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp index 792ef8ea1e..e634f2eac8 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -262,15 +263,15 @@ namespace AZ::IO switch (stat.GetType()) { case Statistic::Type::FloatingPoint: - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::AzCore, stat.GetFloatValue(), "Streamer/%.*s/%.*s", + AZ_PROFILE_DATAPOINT(AzCore, stat.GetFloatValue(), "Streamer/%.*s/%.*s", aznumeric_cast(stat.GetOwner().length()), stat.GetOwner().data(), aznumeric_cast(stat.GetName().length()), stat.GetName().data()); break; case Statistic::Type::Integer: - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::AzCore, stat.GetIntegerValue(), "Streamer/%.*s/%.*s", + AZ_PROFILE_DATAPOINT(AzCore, stat.GetIntegerValue(), "Streamer/%.*s/%.*s", aznumeric_cast(stat.GetOwner().length()), stat.GetOwner().data(), aznumeric_cast(stat.GetName().length()), stat.GetName().data()); break; case Statistic::Type::Percentage: - AZ_PROFILE_DATAPOINT_PERCENT(AZ::Debug::ProfileCategory::AzCore, stat.GetPercentage(), "Streamer/%.*s/%.*s (percent)", + AZ_PROFILE_DATAPOINT_PERCENT(AzCore, stat.GetPercentage(), "Streamer/%.*s/%.*s (percent)", aznumeric_cast(stat.GetOwner().length()), stat.GetOwner().data(), aznumeric_cast(stat.GetName().length()), stat.GetName().data()); break; default: diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp index e870e29786..823ab6e050 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp @@ -153,7 +153,7 @@ namespace AZ bool StreamerContext::FinalizeCompletedRequests() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); #if AZ_STREAMER_ADD_EXTRA_PROFILING_INFO auto now = AZStd::chrono::system_clock::now(); @@ -218,10 +218,10 @@ namespace AZ bool isInternal = top->m_usage == FileRequest::Usage::Internal; { - AZ_PROFILE_SCOPE_STALL(AZ::Debug::ProfileCategory::AzCore, + AZ_PROFILE_SCOPE(AzCore, isInternal ? "Completion callback internal" : "Completion callback external"); top->m_onCompletion(*top); - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::AzCore, top); + AZ_PROFILE_INTERVAL_END(AzCore, top); } if (parent) diff --git a/Code/Framework/AzCore/AzCore/IO/SystemFile.cpp b/Code/Framework/AzCore/AzCore/IO/SystemFile.cpp index d98b7e1d36..8de8b6b70f 100644 --- a/Code/Framework/AzCore/AzCore/IO/SystemFile.cpp +++ b/Code/Framework/AzCore/AzCore/IO/SystemFile.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -97,9 +96,6 @@ SystemFile& SystemFile::operator=(SystemFile&& other) bool SystemFile::Open(const char* fileName, int mode, int platformFlags) { - AZ_PROFILE_INTERVAL_SCOPED(AZ::Debug::ProfileCategory::AzCore, this, "SystemFile::Open - %s", fileName); - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Open - %s", fileName); - if (fileName) // If we reopen the file we are allowed to have NULL file name { if (strlen(fileName) > m_fileName.max_size()) @@ -136,9 +132,6 @@ bool SystemFile::ReOpen(int mode, int platformFlags) void SystemFile::Close() { - AZ_PROFILE_INTERVAL_SCOPED(AZ::Debug::ProfileCategory::AzCore, this, "SystemFile::Close - %s", m_fileName.c_str()); - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Close - %s", m_fileName.c_str()); - if (FileIOBus::HasHandlers()) { bool isHandled = false; @@ -154,8 +147,6 @@ void SystemFile::Close() void SystemFile::Seek(SeekSizeType offset, SeekMode mode) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Seek - %s:%i", m_fileName.c_str(), offset); - if (FileIOBus::HasHandlers()) { bool isHandled = false; @@ -181,16 +172,11 @@ bool SystemFile::Eof() AZ::u64 SystemFile::ModificationTime() { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::ModTime - %s", m_fileName.c_str()); - return Platform::ModificationTime(m_handle, this); } SystemFile::SizeType SystemFile::Read(SizeType byteSize, void* buffer) { - AZ_PROFILE_INTERVAL_SCOPED(AZ::Debug::ProfileCategory::AzCore, this, "SystemFile::Read - %s:%i", m_fileName.c_str(), byteSize); - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Read - %s:%i", m_fileName.c_str(), byteSize); - if (FileIOBus::HasHandlers()) { SizeType numRead = 0; @@ -207,9 +193,6 @@ SystemFile::SizeType SystemFile::Read(SizeType byteSize, void* buffer) SystemFile::SizeType SystemFile::Write(const void* buffer, SizeType byteSize) { - AZ_PROFILE_INTERVAL_SCOPED(AZ::Debug::ProfileCategory::AzCore, this, "SystemFile::Write - %s:%i", m_fileName.c_str(), byteSize); - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Write - %s:%i", m_fileName.c_str(), byteSize); - if (FileIOBus::HasHandlers()) { SizeType numWritten = 0; @@ -226,15 +209,11 @@ SystemFile::SizeType SystemFile::Write(const void* buffer, SizeType byteSize) void SystemFile::Flush() { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Flush - %s", m_fileName.c_str()); - Platform::Flush(m_handle, this); } SystemFile::SizeType SystemFile::Length() const { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Length - %s", m_fileName.c_str()); - return Platform::Length(m_handle, this); } @@ -253,36 +232,26 @@ SystemFile::SizeType SystemFile::DiskOffset() const bool SystemFile::Exists(const char* fileName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Exists(util) - %s", fileName); - return Platform::Exists(fileName); } void SystemFile::FindFiles(const char* filter, FindFileCB cb) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::FindFiles(util) - %s", filter); - Platform::FindFiles(filter, cb); } AZ::u64 SystemFile::ModificationTime(const char* fileName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::ModTime(util) - %s", fileName); - return Platform::ModificationTime(fileName); } SystemFile::SizeType SystemFile::Length(const char* fileName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Length(util) - %s", fileName); - return Platform::Length(fileName); } SystemFile::SizeType SystemFile::Read(const char* fileName, void* buffer, SizeType byteSize, SizeType byteOffset) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Read(util) - %s:[%i,%i]", fileName, byteOffset, byteSize); - SizeType numBytesRead = 0; SystemFile f; if (f.Open(fileName, SF_OPEN_READ_ONLY)) @@ -305,8 +274,6 @@ SystemFile::SizeType SystemFile::Read(const char* fileName, void* buffer, SizeTy bool SystemFile::Delete(const char* fileName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Delete(util) - %s", fileName); - if (!Exists(fileName)) { return false; @@ -317,8 +284,6 @@ bool SystemFile::Delete(const char* fileName) bool SystemFile::Rename(const char* sourceFileName, const char* targetFileName, bool overwrite) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::Rename(util) - %s", sourceFileName); - if (!Exists(sourceFileName)) { return false; @@ -329,29 +294,21 @@ bool SystemFile::Rename(const char* sourceFileName, const char* targetFileName, bool SystemFile::IsWritable(const char* sourceFileName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::IsWritable(util) - %s", sourceFileName); - return Platform::IsWritable(sourceFileName); } bool SystemFile::SetWritable(const char* sourceFileName, bool writable) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::SetWritable(util) - %s", sourceFileName); - return Platform::SetWritable(sourceFileName, writable); } bool SystemFile::CreateDir(const char* dirName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::CreateDir(util) - %s", dirName); - return Platform::CreateDir(dirName); } bool SystemFile::DeleteDir(const char* dirName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::DeleteDir(util) - %s", dirName); - return Platform::DeleteDir(dirName); } diff --git a/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerBase.cpp b/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerBase.cpp index 130ff8da6b..a17290d8c5 100644 --- a/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerBase.cpp +++ b/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerBase.cpp @@ -23,10 +23,10 @@ void JobManagerBase::Process(Job* job) Job* dependent = job->GetDependent(); bool isDelete = job->IsAutoDelete(); - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::JobManagerDetailed, job); + AZ_PROFILE_INTERVAL_END(JobManagerDetailed, job); if (!job->IsCancelled()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "AZ::JobManagerBase::Process Job"); + AZ_PROFILE_SCOPE(AzCore, "AZ::JobManagerBase::Process Job"); job->Process(); } diff --git a/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerWorkStealing.cpp b/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerWorkStealing.cpp index bdf137f621..73fb4ecfe8 100644 --- a/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerWorkStealing.cpp +++ b/Code/Framework/AzCore/AzCore/Jobs/Internal/JobManagerWorkStealing.cpp @@ -122,7 +122,7 @@ void JobManagerWorkStealing::AddPendingJob(Job* job) } #endif - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::JobManagerDetailed, job, "AzCore Job Queued Awaiting Execute"); + AZ_PROFILE_INTERVAL_START(JobManagerDetailed, job, "AzCore Job Queued Awaiting Execute"); if (job->IsCompletion()) { @@ -371,7 +371,7 @@ void JobManagerWorkStealing::ProcessJobsInternal(ThreadInfo* info, Job* suspende { //no available work, so go to sleep (or we have already been signaled by another thread and will acquire the semaphore but not actually sleep) info->m_waitEvent.acquire(); - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::JobManagerDetailed, info); + AZ_PROFILE_INTERVAL_END(JobManagerDetailed, info); if (m_quitRequested) { @@ -457,7 +457,7 @@ void JobManagerWorkStealing::ProcessJobsInternal(ThreadInfo* info, Job* suspende else { //attempt to steal a job from another thread's queue - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "JobManagerWorkStealing::ProcessJobsInternal:WorkStealing"); + AZ_PROFILE_SCOPE(AzCore, "JobManagerWorkStealing::ProcessJobsInternal:WorkStealing"); unsigned int numStealAttempts = 0; const unsigned int maxStealAttempts = (unsigned int)m_workerThreads.size() * 3; //try every thread a few times before giving up @@ -674,7 +674,7 @@ inline void JobManagerWorkStealing::ActivateWorker() m_numAvailableWorkers.fetch_sub(1, AZStd::memory_order_acq_rel); // resume the thread execution - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::JobManagerDetailed, info, "AzCore WakeJobThread %d", info->m_workerId); + AZ_PROFILE_INTERVAL_START(JobManagerDetailed, info, "AzCore WakeJobThread %d", info->m_workerId); info->m_waitEvent.release(); return; } diff --git a/Code/Framework/AzCore/AzCore/Jobs/JobCompletion.h b/Code/Framework/AzCore/AzCore/Jobs/JobCompletion.h index 50776a30da..eda03bb5f6 100644 --- a/Code/Framework/AzCore/AzCore/Jobs/JobCompletion.h +++ b/Code/Framework/AzCore/AzCore/Jobs/JobCompletion.h @@ -33,7 +33,7 @@ namespace AZ */ void StartAndWaitForCompletion() { - AZ_PROFILE_FUNCTION_STALL(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // start the job Start(); diff --git a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h b/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h index dd626a9829..8018cf409f 100644 --- a/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h +++ b/Code/Framework/AzCore/AzCore/Jobs/LegacyJobExecutor.h @@ -72,7 +72,7 @@ namespace AZ while (m_running) { - AZ_PROFILE_FUNCTION_STALL(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); m_completionCondition.wait(uniqueLock, [this] { return !this->m_running; }); } } diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp index fc75f3c37e..7d644c6917 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include diff --git a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h index 08e8098dac..e9d001aec3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h @@ -12,9 +12,7 @@ #include #include #include -#include - -#include +#include namespace AZ { @@ -82,7 +80,7 @@ namespace AZ if (ProfileAllocations) { - AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName()); + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName()); AZ_MEMORY_PROFILE(ProfileAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord)); } @@ -102,7 +100,7 @@ namespace AZ if (ProfileAllocations) { - AZ_PROFILE_MEMORY_FREE(AZ::Debug::ProfileCategory::MemoryReserved, ptr); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); } @@ -128,7 +126,7 @@ namespace AZ { if (ProfileAllocations) { - AZ_PROFILE_MEMORY_FREE(AZ::Debug::ProfileCategory::MemoryReserved, ptr); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); } newSize = MemorySizeAdjustedUp(newSize); @@ -142,7 +140,7 @@ namespace AZ if (ProfileAllocations) { - AZ_PROFILE_MEMORY_ALLOC(AZ::Debug::ProfileCategory::MemoryReserved, newPtr, newSize, GetName()); + AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newPtr, newSize, GetName()); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment)); } diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index ada6c8f330..41c70b4e30 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -254,7 +254,7 @@ SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, co AZ_Assert(address != 0, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); - AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, fileName, lineNum, address, byteSize, name); + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, address, byteSize, name); AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); return address; @@ -268,7 +268,7 @@ void SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) { byteSize = MemorySizeAdjustedUp(byteSize); - AZ_PROFILE_MEMORY_FREE(AZ::Debug::ProfileCategory::MemoryReserved, ptr); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); m_allocator->DeAllocate(ptr, byteSize, alignment); } @@ -283,9 +283,9 @@ SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAl newSize = MemorySizeAdjustedUp(newSize); AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); - AZ_PROFILE_MEMORY_FREE(AZ::Debug::ProfileCategory::MemoryReserved, ptr); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); - AZ_PROFILE_MEMORY_ALLOC(AZ::Debug::ProfileCategory::MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); + AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); return newAddress; diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp index fa61a225c8..018f9ed15a 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp @@ -291,7 +291,7 @@ void ScriptSystemComponent::OnSystemTick() if (contextContainer.m_context->GetId() == ScriptContextIds::DefaultScriptContextId) { size_t memoryUsageBytes = contextContainer.m_context->GetMemoryUsage(); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Script, memoryUsageBytes / 1024.0, "Script Memory (KB)"); + AZ_PROFILE_DATAPOINT(Script, memoryUsageBytes / 1024.0, "Script Memory (KB)"); } #endif // AZ_PROFILE_TELEMETRY diff --git a/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp b/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp index 12bb474cfe..edc0e8398b 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/DataPatch.cpp @@ -143,7 +143,7 @@ namespace AZ //========================================================================= void DataNodeTree::Build(const void* rootClassPtr, const Uuid& rootClassId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); m_root.Reset(); m_currentNode = nullptr; @@ -1400,7 +1400,7 @@ namespace AZ AddressTypeElement AddressTypeSerializer::LoadAddressElementFromPath(const AZStd::string& pathElement) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // AddressTypeElement default constructor defaults to an invalid addressElement AddressTypeElement addressElement; @@ -1485,13 +1485,13 @@ namespace AZ /// Load the class data from a stream. bool AddressTypeSerializer::Load(void* classPtr, IO::GenericStream& stream, unsigned int version, bool isDataBigEndian /*= false*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); (void)isDataBigEndian; constexpr unsigned int version1PathAddress = 1; if (version < version1PathAddress) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "AddressTypeSerializer::Load::LegacyUpgrade"); + AZ_PROFILE_SCOPE(AzCore, "AddressTypeSerializer::Load::LegacyUpgrade"); // Grab the AddressType object to be filled AddressType* address = reinterpret_cast(classPtr); address->clear(); @@ -1516,7 +1516,7 @@ namespace AZ } else { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "AddressTypeSerializer::Load::CurrentFlow"); + AZ_PROFILE_SCOPE(AzCore, "AddressTypeSerializer::Load::CurrentFlow"); // Grab the AddressType object to be filled AddressType* address = reinterpret_cast(classPtr); address->clear(); @@ -1749,7 +1749,7 @@ namespace AZ const FlagsMap& targetFlagsMap, SerializeContext* context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!source || !target) { @@ -1804,7 +1804,7 @@ namespace AZ targetTree.Build(target, targetClassId); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "DataPatch::Create:RecursiveCallToCompareElements"); + AZ_PROFILE_SCOPE(AzCore, "DataPatch::Create:RecursiveCallToCompareElements"); sourceTree.CompareElements( &sourceTree.m_root, @@ -1829,7 +1829,7 @@ namespace AZ const FlagsMap& sourceFlagsMap, const FlagsMap& targetFlagsMap) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!source) { @@ -1870,7 +1870,7 @@ namespace AZ { // Loop over the original data patch and make a copy of the key value pair - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "DataPatch::Apply:UpgradeDataPatch"); + AZ_PROFILE_SCOPE(AzCore, "DataPatch::Apply:UpgradeDataPatch"); // Copy of the patch element is purposefully being created here(notice no ampersand) so that the UpgradeDataPatch // function can modify the key and insert it into the fixed patch map for (PatchMap::value_type patch : m_patch) @@ -1883,7 +1883,7 @@ namespace AZ // Build a mapping of child patches for quick look-up: [parent patch address] -> [list of patches for child elements (parentAddress + one more address element)] ChildPatchMap childPatchMap; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "DataPatch::Apply:GenerateChildPatchMap"); + AZ_PROFILE_SCOPE(AzCore, "DataPatch::Apply:GenerateChildPatchMap"); for (auto& patch : fixedPatch) { AddressType parentAddress = patch.first; @@ -1921,7 +1921,7 @@ namespace AZ } } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "DataPatch::Apply:RecursiveCallToApplyToElements"); + AZ_PROFILE_SCOPE(AzCore, "DataPatch::Apply:RecursiveCallToApplyToElements"); int rootContainerElementCounter = 0; result = DataNodeTree::ApplyToElements( @@ -2015,7 +2015,7 @@ namespace AZ */ bool LegacyDataPatchConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ::Outcome conversionResult = LegacyDataPatchConverter_Impl(context, classElement); if (!conversionResult.IsSuccess()) @@ -2043,7 +2043,7 @@ namespace AZ */ AZ::Outcome LegacyDataPatchConverter_Impl(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Pull the targetClassId value out of the class element before it gets cleared when converting the DataPatch TypeId AZ::TypeId targetClassTypeId; if (!classElement.GetChildData(AZ_CRC("m_targetClassId", 0xcabab9dc), targetClassTypeId)) diff --git a/Code/Framework/AzCore/AzCore/Serialization/ObjectStream.cpp b/Code/Framework/AzCore/AzCore/Serialization/ObjectStream.cpp index e0ee18633b..73ab174699 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/ObjectStream.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/ObjectStream.cpp @@ -786,7 +786,7 @@ namespace AZ // Serializable leaf element. else if (classData->m_serializer) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "ObjectStreamImpl::LoadClass Load"); + AZ_PROFILE_SCOPE(AzCore, "ObjectStreamImpl::LoadClass Load"); // Wrap the stream IO::GenericStream* currentStream = &m_inStream; @@ -1929,7 +1929,7 @@ namespace AZ //========================================================================= bool ObjectStreamImpl::Start() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); ++m_pending; diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializationUtils.cpp b/Code/Framework/AzCore/AzCore/Serialization/SerializationUtils.cpp index fdc7cd94b6..c8e6c28679 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializationUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializationUtils.cpp @@ -24,7 +24,7 @@ namespace AZ { bool LoadObjectFromStreamInPlace(IO::GenericStream& stream, AZ::SerializeContext* context, const SerializeContext::ClassData* objectClassData, void* targetPointer, const FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(objectClassData, "Class data is required."); @@ -72,7 +72,7 @@ namespace AZ bool LoadObjectFromStreamInPlace(IO::GenericStream& stream, AZ::SerializeContext* context, const Uuid& targetClassId, void* targetPointer, const FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!context) { @@ -111,7 +111,7 @@ namespace AZ void* LoadObjectFromStream(IO::GenericStream& stream, AZ::SerializeContext* context, const Uuid* targetClassId, const FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!context) { @@ -169,7 +169,7 @@ namespace AZ void* LoadObjectFromFile(const AZStd::string& filePath, const Uuid& targetClassId, SerializeContext* context, const FilterDescriptor& filterDesc, int /*platformFlags*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ::IO::FileIOStream fileStream; if (!fileStream.Open(filePath.c_str(), IO::OpenMode::ModeRead | IO::OpenMode::ModeBinary)) @@ -183,7 +183,7 @@ namespace AZ bool SaveObjectToStream(IO::GenericStream& stream, DataStream::StreamType streamType, const void* classPtr, const Uuid& classId, SerializeContext* context, const SerializeContext::ClassData* classData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!context) { @@ -243,7 +243,7 @@ namespace AZ bool SaveObjectToFile(const AZStd::string& filePath, DataStream::StreamType fileType, const void* classPtr, const Uuid& classId, SerializeContext* context, int platformFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // \note This is ok for tools, but we should use the streamer to write objects directly (no memory store) AZStd::vector dstData; diff --git a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp index 4cfccfa8bb..23a197b2ad 100644 --- a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp @@ -198,7 +198,7 @@ namespace AZ const EntityIdToEntityIdMap* remapFromIdToId/*=nullptr*/, const DataFlagsTransformFunction& dataFlagsTransformFn/*=nullptr*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); for (const auto& entityIdFlagsMapPair : from.m_entityToDataFlags) { @@ -240,7 +240,7 @@ namespace AZ //========================================================================= DataPatch::FlagsMap SliceComponent::DataFlagsPerEntity::GetDataFlagsForPatching(const EntityIdToEntityIdMap* remapFromIdToId /*=nullptr*/) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Collect together data flags from all entities DataPatch::FlagsMap dataFlagsForAllEntities; @@ -423,7 +423,7 @@ namespace AZ //========================================================================= void SliceComponent::DataFlagsPerEntity::Cleanup(const EntityList& validEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); EntityIdSet validEntityIds; for (const Entity* entity : validEntities) @@ -677,7 +677,7 @@ namespace AZ //========================================================================= SliceComponent::SliceInstance* SliceComponent::SliceReference::PrepareCreateInstance(const SliceInstanceId& sliceInstanceId, bool allowUninstantiated) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // create an empty instance (just copy of the existing data) SliceInstance* instance = CreateEmptyInstance(sliceInstanceId); @@ -737,7 +737,7 @@ namespace AZ AZ::SerializeContext* serializeContext, const AZ::IdUtils::Remapper::IdMapper& customMapper) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!remapContainer) { @@ -808,7 +808,7 @@ namespace AZ SliceComponent::SliceInstance* SliceComponent::SliceReference::CreateInstance(const AZ::IdUtils::Remapper::IdMapper& customMapper, SliceInstanceId sliceInstanceId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Validate that we are able to create an instance at this time // If we are instantiated then this includes verifying that we have a valid component and asset @@ -842,7 +842,7 @@ namespace AZ const EntityIdToEntityIdMap assetToLiveIdMap, SliceInstanceId sliceInstanceId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Validate that we are able to create an instance at this time // This includes verifying that we are instantiated, and have a valid component and asset @@ -883,7 +883,7 @@ namespace AZ SliceComponent::SliceInstance* SliceComponent::SliceReference::CloneInstance(SliceComponent::SliceInstance* instance, SliceComponent::EntityIdToEntityIdMap& sourceToCloneEntityIdMap) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // check if source instance belongs to this slice reference auto findIt = AZStd::find_if(m_instances.begin(), m_instances.end(), [instance](const SliceInstance& element) -> bool { return &element == instance; }); @@ -1053,7 +1053,7 @@ namespace AZ //========================================================================= bool SliceComponent::SliceReference::Instantiate(const AZ::ObjectStream::FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (m_isInstantiated) { @@ -1145,7 +1145,7 @@ namespace AZ //========================================================================= void SliceComponent::SliceReference::InstantiateInstance(SliceInstance& instance, const AZ::ObjectStream::FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Could have set this during SliceInstance() constructor, but we wait until instantiation since it involves allocation. instance.m_dataFlags.SetIsValidEntityFunction([&instance](EntityId entityId) { return instance.IsValidEntity(entityId); }); @@ -1167,7 +1167,7 @@ namespace AZ // An empty map indicates its a fresh instance (i.e. has never be instantiated and then serialized). if (entityIdMap.empty()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "SliceComponent::SliceReference::InstantiateInstance:FreshInstanceClone"); + AZ_PROFILE_SCOPE(AzCore, "SliceComponent::SliceReference::InstantiateInstance:FreshInstanceClone"); // Generate new Ids and populate the map. AZ_Assert(!dataPatch.IsValid(), "Data patch is valid for slice instance, but entity Id map is not!"); @@ -1175,7 +1175,7 @@ namespace AZ } else { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "SliceComponent::SliceReference::InstantiateInstance:CloneAndApplyDataPatches"); + AZ_PROFILE_SCOPE(AzCore, "SliceComponent::SliceReference::InstantiateInstance:CloneAndApplyDataPatches"); // Clone entities while applying any data patches. AZ_Assert(dataPatch.IsValid(), "Data patch is not valid for existing slice instance!"); @@ -1261,7 +1261,7 @@ namespace AZ // Broadcast OnSliceEntitiesLoaded for freshly instantiated entities. if (!instance.m_instantiated->m_entities.empty()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "SliceComponent::SliceReference::InstantiateInstance:OnSliceEntitiesLoaded"); + AZ_PROFILE_SCOPE(AzCore, "SliceComponent::SliceReference::InstantiateInstance:OnSliceEntitiesLoaded"); SliceAssetSerializationNotificationBus::Broadcast(&SliceAssetSerializationNotificationBus::Events::OnSliceEntitiesLoaded, instance.m_instantiated->m_entities); } } @@ -1363,7 +1363,7 @@ namespace AZ //========================================================================= void SliceComponent::SliceReference::ComputeDataPatch() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // Get source entities from the base asset (instantiate if needed) InstantiatedContainer source(m_asset.Get()->GetComponent(), false); @@ -1499,7 +1499,7 @@ namespace AZ //========================================================================= bool SliceComponent::GetEntities(EntityList& entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); bool result = true; @@ -1532,7 +1532,7 @@ namespace AZ //========================================================================= bool SliceComponent::GetEntityIds(EntityIdSet& entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); bool result = true; @@ -1582,7 +1582,7 @@ namespace AZ //========================================================================= bool SliceComponent::GetMetadataEntityIds(EntityIdSet& metadataEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); bool result = true; @@ -1654,7 +1654,7 @@ namespace AZ //========================================================================= SliceComponent::InstantiateResult SliceComponent::Instantiate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZStd::unique_lock lock(m_instantiateMutex); if (m_slicesAreInstantiated) @@ -1856,7 +1856,7 @@ namespace AZ SliceComponent::SliceInstanceAddress SliceComponent::AddSliceUsingExistingEntities(const Data::Asset& sliceAsset, const AZ::SliceComponent::EntityIdToEntityIdMap& liveToAssetMap, SliceInstanceId sliceInstanceId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!sliceAsset.Get()->GetComponent()) { @@ -2337,7 +2337,7 @@ namespace AZ //========================================================================= bool SliceComponent::RemoveSliceInstance(SliceComponent::SliceInstanceAddress sliceAddress) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!sliceAddress.IsValid()) { AZ_Error("Slices", false, "Slice address is invalid."); @@ -2474,7 +2474,7 @@ namespace AZ bool SliceComponent::RemoveMetaDataEntity(EntityId metaDataEntityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); GetEntityInfoMap(); // Ensure map is built @@ -2567,7 +2567,7 @@ namespace AZ void SliceComponent::RemoveAllEntities(bool deleteEntities, bool removeEmptyInstances) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); // If we are deleting the entities, we need to do that one by one if (deleteEntities) @@ -2930,7 +2930,7 @@ namespace AZ //========================================================================= void SliceComponent::OnAssetReloaded(Data::Asset /*asset*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!m_myAsset) { @@ -3073,7 +3073,7 @@ namespace AZ /// Called right after we finish writing data to the instance pointed at by classPtr. void OnWriteEnd(void* classPtr) override { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); SliceComponent* sliceComponent = reinterpret_cast(classPtr); EBUS_EVENT(SliceAssetSerializationNotificationBus, OnWriteDataToSliceAssetEnd, *sliceComponent); @@ -3082,7 +3082,7 @@ namespace AZ // We can't broadcast this event for instanced entities yet, since they don't exist until instantiation. if (!sliceComponent->GetNewEntities().empty()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "SliceComponentSerializationEvents::OnWriteEnd:OnSliceEntitiesLoaded"); + AZ_PROFILE_SCOPE(AzCore, "SliceComponentSerializationEvents::OnWriteEnd:OnSliceEntitiesLoaded"); EBUS_EVENT(SliceAssetSerializationNotificationBus, OnSliceEntitiesLoaded, sliceComponent->GetNewEntities()); } } @@ -3093,7 +3093,7 @@ namespace AZ //========================================================================= void SliceComponent::PrepareSave() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (m_slicesAreInstantiated) { @@ -3262,7 +3262,7 @@ namespace AZ //========================================================================= void SliceComponent::BuildEntityInfoMap() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); m_entityInfoMap.clear(); m_metaDataEntityInfoMap.clear(); @@ -3425,7 +3425,7 @@ namespace AZ //========================================================================= void SliceComponent::BuildDataFlagsForInstances() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(IsInstantiated(), "Slice must be instantiated before the ancestry of its data flags can be calculated."); // Use lock since slice instantiation can occur from multiple threads @@ -3551,7 +3551,7 @@ namespace AZ { // if this function is a performance bottleneck, it could be optimized with caching // be wary not to create the cache in-game if the information is only needed by tools - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!IsInstantiated()) { @@ -3730,7 +3730,7 @@ namespace AZ //========================================================================= SliceComponent* SliceComponent::Clone(AZ::SerializeContext& serializeContext, SliceInstanceToSliceInstanceMap* sourceToCloneSliceInstanceMap) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); SliceComponent* clonedComponent = serializeContext.CloneObject(this); diff --git a/Code/Framework/AzCore/AzCore/Statistics/StatisticalProfilerProxy.h b/Code/Framework/AzCore/AzCore/Statistics/StatisticalProfilerProxy.h index 7d55a88f19..4f58e0cb73 100644 --- a/Code/Framework/AzCore/AzCore/Statistics/StatisticalProfilerProxy.h +++ b/Code/Framework/AzCore/AzCore/Statistics/StatisticalProfilerProxy.h @@ -24,7 +24,7 @@ #endif // #if defined(AZ_PROFILE_SCOPE) #define AZ_PROFILE_SCOPE(profiler, scopeNameId) \ - static_assert(profiler < AZ::Debug::ProfileCategory::Count, "Invalid profiler category"); \ + static_assert(profiler < Count, "Invalid profiler category"); \ static const AZStd::string AZ_JOIN(blockName, __LINE__)(scopeNameId); \ AZ::Statistics::StatisticalProfilerProxy::TimedScope AZ_JOIN(scope, __LINE__)(profiler, AZ_JOIN(blockName, __LINE__)); @@ -34,7 +34,7 @@ namespace AZ { namespace Statistics { - using StatisticalProfilerId = AZ::Debug::ProfileCategory; + using StatisticalProfilerId = AZ::Name; //! This AZ::Interface<> (Yes, it is an application wide singleton) owns an array of StatisticalProfilers. //! When is this useful? @@ -124,8 +124,8 @@ namespace AZ StatisticalProfilerProxy() { - m_profilers.reserve(static_cast(AZ::Debug::ProfileCategory::Count)); - for (AZStd::size_t i = 0; i < static_cast(AZ::Debug::ProfileCategory::Count); i++) + m_profilers.reserve(static_cast(Count)); + for (AZStd::size_t i = 0; i < static_cast(Count); i++) { m_profilers.emplace_back(StatisticalProfilerType()); } @@ -162,7 +162,7 @@ namespace AZ } private: - AZStd::bitset(AZ::Debug::ProfileCategory::Count)> m_activeProfilersFlag; + AZStd::bitset(Count)> m_activeProfilersFlag; AZStd::vector m_profilers; }; //class StatisticalProfilerProxy diff --git a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h index c9adc4de2f..4b5c58f426 100644 --- a/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h +++ b/Code/Framework/AzCore/AzCore/Statistics/TimeDataStatisticsManager.h @@ -17,7 +17,7 @@ namespace AZ /** * @brief Specialization useful for data generated with AZ::Debug::FrameProfileComponent * - * Timer based data collection using AZ_PROFILE_TIMER(...), available in + * Timer based data collection using AZ_PROFILE_SCOPE(...), available in * AzCore/Debug/Profiler.h can be collected when using AZ::Debug::FrameProfilerComponent * and AZ::Debug::FrameProfilerBus. The method PushTimeDataSample(...) is a convenience * to convert those Timer registers into a RunningStatistic. diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index 0c95b9d592..79d3e321ec 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -99,6 +99,7 @@ set(FILES Debug/FrameProfilerComponent.cpp Debug/FrameProfilerComponent.h Debug/IEventLogger.h + Debug/MemoryProfiler.h Debug/ProfileModuleInit.cpp Debug/ProfileModuleInit.h Debug/Profiler.cpp @@ -565,10 +566,6 @@ set(FILES Statistics/NamedRunningStatistic.h Statistics/RunningStatistic.cpp Statistics/RunningStatistic.h - Statistics/StatisticalProfiler.h - Statistics/StatisticalProfilerProxy.h - Statistics/StatisticalProfilerProxySystemComponent.cpp - Statistics/StatisticalProfilerProxySystemComponent.h Statistics/StatisticsManager.h Statistics/TimeDataStatisticsManager.cpp Statistics/TimeDataStatisticsManager.h diff --git a/Code/Framework/AzCore/AzCore/std/parallel/spin_mutex.h b/Code/Framework/AzCore/AzCore/std/parallel/spin_mutex.h index 926e404668..2fc4c331ee 100644 --- a/Code/Framework/AzCore/AzCore/std/parallel/spin_mutex.h +++ b/Code/Framework/AzCore/AzCore/std/parallel/spin_mutex.h @@ -8,7 +8,6 @@ #ifndef AZSTD_PARALLEL_SPIN_MUTEX_H #define AZSTD_PARALLEL_SPIN_MUTEX_H 1 -#include #include #include @@ -32,8 +31,6 @@ namespace AZStd bool expected = false; if (!m_flag.compare_exchange_weak(expected, true, memory_order_acq_rel, memory_order_acquire)) { - AZ_PROFILE_FUNCTION_STALL(AZ::Debug::ProfileCategory::AzCore); - exponential_backoff backoff; for (;; ) { diff --git a/Code/Framework/AzCore/Platform/Common/RadTelemetry/ProfileTelemetry.h b/Code/Framework/AzCore/Platform/Common/RadTelemetry/ProfileTelemetry.h index 3337df9ede..7677c985c6 100644 --- a/Code/Framework/AzCore/Platform/Common/RadTelemetry/ProfileTelemetry.h +++ b/Code/Framework/AzCore/Platform/Common/RadTelemetry/ProfileTelemetry.h @@ -35,21 +35,17 @@ namespace ProfileTelemetryInternal } } -#define AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category) (static_cast(1) << static_cast(category)) +#define AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category) (static_cast(1) << static_cast(category)) // Helpers -#define AZ_INTERNAL_PROF_VERIFY_CAT(category) static_assert(category < AZ::Debug::ProfileCategory::Count, "Invalid profile category") - #define AZ_INTERNAL_PROF_MEMORY_CAT_TO_FLAGS(category) (AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category) | \ AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(AZ::Debug::ProfileCategory::MemoryReserved)) #define AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id) static_assert(sizeof(id) <= sizeof(tm_uint64), "Interval id must be a unique value no larger than 64-bits") #define AZ_INTERNAL_PROF_TM_FUNC_VERIFY_CAT(category, flags) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmFunction(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), flags) #define AZ_INTERNAL_PROF_TM_ZONE_VERIFY_CAT(category, flags, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmZone(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), flags, __VA_ARGS__) // AZ_PROFILE_FUNCTION @@ -91,28 +87,23 @@ namespace ProfileTelemetryInternal // For profiling events that do not start and stop in the same scope (they MUST start/stop on the same thread) // ALWAYS favor using scoped events (AZ_PROFILE_FUNCTION, AZ_PROFILE_SCOPE) as debugging an unmatched begin/end can be challenging #define AZ_PROFILE_EVENT_BEGIN(category, name) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmEnter(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), TMZF_NONE, name) #define AZ_PROFILE_EVENT_END(category) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmLeave(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category)) // AZ_PROFILE_INTERVAL (mapped to Telemetry Timespan APIs) // Note: using C-style casting as we allow either pointers or integral types as IDs #define AZ_PROFILE_INTERVAL_START(category, id, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id); \ tmBeginTimeSpan(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), (tm_uint64)(id), TMZF_NONE, __VA_ARGS__) #define AZ_PROFILE_INTERVAL_START_COLORED(category, id, color, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id); \ tmBeginColoredTimeSpan(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), (tm_uint64)(id), 0, ProfileTelemetryInternal::ConvertColor(color), TMZF_NONE, __VA_ARGS__) #define AZ_PROFILE_INTERVAL_END(category, id) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id); \ tmEndTimeSpan(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), (tm_uint64)(id)) @@ -122,7 +113,6 @@ namespace ProfileTelemetryInternal // Note: the first variable argument must be a const format string // Usage: AZ_PROFILE_INTERVAL_SCOPED(AZ::Debug::ProfileCategory, , , format args...) #define AZ_PROFILE_INTERVAL_SCOPED(category, id, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ AZ_INTERNAL_PROF_VERIFY_INTERVAL_ID(id); \ tmTimeSpan(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), (tm_uint64)(id), TM_MIN_TIME_SPAN_TRACK_ID + static_cast(category), 0, TMZF_NONE, __VA_ARGS__) @@ -131,29 +121,23 @@ namespace ProfileTelemetryInternal // Note: data points can have static or dynamic names, if using a dynamic name the first variable argument must be a const format string // Usage: AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory, , format args...) #define AZ_PROFILE_DATAPOINT(category, value, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmPlot(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), TM_PLOT_UNITS_REAL, TM_PLOT_DRAW_LINE, static_cast(value), __VA_ARGS__) #define AZ_PROFILE_DATAPOINT_PERCENT(category, value, ...) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmPlot(AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(category), TM_PLOT_UNITS_PERCENTAGE_DIRECT, TM_PLOT_DRAW_LINE, static_cast(value), __VA_ARGS__) // AZ_PROFILE_MEMORY_ALLOC #define AZ_PROFILE_MEMORY_ALLOC(category, address, size, context) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmAlloc(AZ_INTERNAL_PROF_MEMORY_CAT_TO_FLAGS(category), address, size, context) #define AZ_PROFILE_MEMORY_ALLOC_EX(category, filename, lineNumber, address, size, context) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmAllocEx(AZ_INTERNAL_PROF_MEMORY_CAT_TO_FLAGS(category), filename, lineNumber, address, size, context) #define AZ_PROFILE_MEMORY_FREE(category, address) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmFree(AZ_INTERNAL_PROF_MEMORY_CAT_TO_FLAGS(category), address) #define AZ_PROFILE_MEMORY_FREE_EX(category, filename, lineNumber, address) \ - AZ_INTERNAL_PROF_VERIFY_CAT(category); \ tmFreeEx(AZ_INTERNAL_PROF_MEMORY_CAT_TO_FLAGS(category), filename, lineNumber, address) #endif diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/IO/SystemFile_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/IO/SystemFile_UnixLike.cpp index 797f3e35e8..8f651a9559 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/IO/SystemFile_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/IO/SystemFile_UnixLike.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -208,7 +209,7 @@ namespace Platform bool DeleteDir(const char* dirName) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "SystemFile::DeleteDir(util) - %s", dirName); + AZ_PROFILE_SCOPE(AzCore, "SystemFile::DeleteDir(util) - %s", dirName); if (dirName) { diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp index 2489749b51..2462af861b 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp @@ -169,7 +169,7 @@ namespace AZ::IO void StorageDriveWin::PrepareRequest(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); if (AZStd::holds_alternative(request->GetCommand())) @@ -189,7 +189,7 @@ namespace AZ::IO void StorageDriveWin::QueueRequest(FileRequest* request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "QueueRequest was provided a null request."); AZStd::visit([this, request](auto&& args) @@ -459,7 +459,7 @@ namespace AZ::IO // Adding explicit scope here for profiling file Open & Close { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::ReadRequest OpenFile %s", m_name.c_str()); + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::ReadRequest OpenFile %s", m_name.c_str()); TIMED_AVERAGE_WINDOW_SCOPE(m_fileOpenCloseTimeAverage); // All reads are overlapped (asynchronous). @@ -516,7 +516,7 @@ namespace AZ::IO bool StorageDriveWin::ReadRequest(FileRequest* request) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::ReadRequest %s", m_name.c_str()); + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::ReadRequest %s", m_name.c_str()); if (!m_cachesInitialized) { @@ -545,7 +545,7 @@ namespace AZ::IO bool StorageDriveWin::ReadRequest(FileRequest* request, size_t readSlot) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::ReadRequest %s", m_name.c_str()); + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::ReadRequest %s", m_name.c_str()); if (!m_context->GetStreamerThreadSynchronizer().AreEventHandlesAvailable()) { @@ -666,7 +666,7 @@ namespace AZ::IO bool result = false; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::ReadRequest ::ReadFile"); + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::ReadRequest ::ReadFile"); result = ::ReadFile(file, output, readSize, nullptr, overlapped); } @@ -782,7 +782,7 @@ namespace AZ::IO { auto& fileExists = AZStd::get(request->GetCommand()); - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::FileExistsRequest %s : %s", + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileExistsRequest %s : %s", m_name.c_str(), fileExists.m_path.GetRelativePath()); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); @@ -838,7 +838,7 @@ namespace AZ::IO { auto& command = AZStd::get(request->GetCommand()); - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, "StorageDriveWin::FileMetaDataRetrievalRequest %s : %s", + AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileMetaDataRetrievalRequest %s : %s", m_name.c_str(), command.m_path.GetRelativePath()); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileMetaDataRetrievalTimeAverage); @@ -954,7 +954,7 @@ namespace AZ::IO bool StorageDriveWin::FinalizeReads() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); bool hasWorked = false; for (size_t readSlot = 0; readSlot < m_readSlots_active.size(); ++readSlot) diff --git a/Code/Framework/AzCore/Tests/Components.cpp b/Code/Framework/AzCore/Tests/Components.cpp index b14dcbbe53..45193f4d1e 100644 --- a/Code/Framework/AzCore/Tests/Components.cpp +++ b/Code/Framework/AzCore/Tests/Components.cpp @@ -1244,19 +1244,18 @@ namespace UnitTest int ChildFunction(int input) { - AZ_PROFILE_TIMER("UnitTest", nullptr, NamedRegister); + AZ_PROFILE_FUNCTION(System); int result = 5; for (int i = 0; i < 10000; ++i) { result += i % (input + 3); } - AZ_PROFILE_TIMER_END(NamedRegister); return result; } int ChildFunction1(int input) { - AZ_PROFILE_TIMER("UnitTest", "Child1"); + AZ_PROFILE_SCOPE(System, "Child1"); int result = 5; for (int i = 0; i < 10000; ++i) { @@ -1267,7 +1266,7 @@ namespace UnitTest int Profile1(int numIterations) { - AZ_PROFILE_TIMER("UnitTest", "Custom name"); + AZ_PROFILE_SCOPE(System, "Custom name"); int result = 0; for (int i = 0; i < numIterations; ++i) { diff --git a/Code/Framework/AzCore/Tests/Debug.cpp b/Code/Framework/AzCore/Tests/Debug.cpp index 6181823737..0d6e1a51e0 100644 --- a/Code/Framework/AzCore/Tests/Debug.cpp +++ b/Code/Framework/AzCore/Tests/Debug.cpp @@ -171,276 +171,6 @@ namespace UnitTest run(); } - class ProfilerTest - : public AllocatorsFixture - { - public: - int m_numRegistersReceived; - - bool ReadRegisterCallback(const ProfilerRegister& reg, const AZStd::thread_id& id) - { - (void)reg; - (void)id; - switch (reg.m_type) - { - case ProfilerRegister::PRT_TIME: - { - AZ_TEST_ASSERT(reg.m_timeData.m_time > 0); - AZ_TEST_ASSERT(reg.m_timeData.m_calls > 0); - } break; - case ProfilerRegister::PRT_VALUE: - { - AZ_TEST_ASSERT(reg.m_userValues.m_value1 == 1 || reg.m_userValues.m_value1 == 2); - AZ_TEST_ASSERT(reg.m_userValues.m_value2 == 0 || reg.m_userValues.m_value2 == 2 || reg.m_userValues.m_value2 == 4); - AZ_TEST_ASSERT(reg.m_userValues.m_value3 == 0 || reg.m_userValues.m_value3 == 3 || reg.m_userValues.m_value3 == 6); - AZ_TEST_ASSERT(reg.m_userValues.m_value4 == 0 || reg.m_userValues.m_value4 == 4 || reg.m_userValues.m_value4 == 8); - AZ_TEST_ASSERT(reg.m_userValues.m_value5 == 0 || reg.m_userValues.m_value5 == 5 || reg.m_userValues.m_value5 == 10); - } break; - } - - //AZ::u64 threadId = (AZ::u64)id.m_id; - //AZ_TracePrintf("Profiler","[%llu] '%s' '%s'(%d) %d Ms (Child calls: %d time: %d Ms) Parent: '%s'!\n",threadId, - // reg.m_name,reg.m_function,reg.m_line,reg.m_time.count(),reg.m_childrenCalls,reg.m_childrenTime.count(),reg.m_lastParent ? reg.m_lastParent->m_name : "No"); - ++m_numRegistersReceived; - return true; - } - - int ChildFunction(int input) - { - AZ_PROFILE_TIMER("UnitTest"); - - auto start = AZStd::chrono::system_clock::now(); - - int result = 5; - for (int i = 0; i < 30000; ++i) - { - result += i % (input + 3); - } - - auto end = AZStd::chrono::system_clock::now(); - AZ_TEST_ASSERT(end >= start); - while (end <= start) - { - end = AZStd::chrono::system_clock::now(); - } - return result; - } - - int ChildFunction1(int input) - { - AZ_PROFILE_TIMER("UnitTest", "Child1"); - - auto start = AZStd::chrono::system_clock::now(); - - int result = 5; - for (int i = 0; i < 30000; ++i) - { - result += i % (input + 1); - } - - - auto end = AZStd::chrono::system_clock::now(); - AZ_TEST_ASSERT(end >= start); - while (end <= start) - { - end = AZStd::chrono::system_clock::now(); - } - - return result; - } - - int Profile1(int numIterations) - { - AZ_PROFILE_TIMER("UnitTest", "Custom name"); - int result = 0; - for (int i = 0; i < numIterations; ++i) - { - result += ChildFunction(i); - } - - result += ChildFunction1(numIterations / 3); - return result; - } - - void UserValuesSet() - { - AZ_PROFILE_VALUE_SET("UnitTest", "UserValues1", 1); - AZ_PROFILE_VALUE_SET("UnitTest", "UserValues2", 1, 2); - AZ_PROFILE_VALUE_SET("UnitTest", "UserValues3", 1, 2, 3); - AZ::s64 v1 = 1, v2 = 2, v3 = 3, v4 = 4, v5 = 5; - AZ_PROFILE_VALUE_SET("UnitTest", "UserValues4", v1, v2, v3, v4); - AZ_PROFILE_VALUE_SET("UnitTest", "UserValues5", v1, v2, v3, v4, v5); - - // test named register - AZ_PROFILE_VALUE_SET_NAMED("UnitTest", "UserValues5", userValues5, v1, v2, v3, v4, v5); -#if defined(AZ_PROFILER_MACRO_DISABLE) - (void)v1; - (void)v2; - (void)v3; - (void)v4; - (void)v5; -#else - AZ_TEST_ASSERT(userValues5 != nullptr); -#endif // !defined(AZ_PROFILER_MACRO_DISABLE) - } - - void UserValuesAdd(int numAdditions) - { - for (int i = 0; i < numAdditions; ++i) - { - AZ_PROFILE_VALUE_ADD("UnitTest", "UserValues1", 1); - AZ_PROFILE_VALUE_ADD("UnitTest", "UserValues2", 1, 2); - AZ_PROFILE_VALUE_ADD("UnitTest", "UserValues3", 1, 2, 3); - AZ::s64 v1 = 1, v2 = 2, v3 = 3, v4 = 4, v5 = 5; - AZ_PROFILE_VALUE_ADD("UnitTest", "UserValues4", v1, v2, v3, v4); - AZ_PROFILE_VALUE_ADD("UnitTest", "UserValues5", v1, v2, v3, v4, v5); - - // test named register - AZ_PROFILE_VALUE_ADD_NAMED("UnitTest", "UserValues5", userValues5, v1, v2, v3, v4, v5); -#if defined(AZ_PROFILER_MACRO_DISABLE) - (void)v1; - (void)v2; - (void)v3; - (void)v4; - (void)v5; -#else - AZ_TEST_ASSERT(userValues5 != nullptr); -#endif // !defined(AZ_PROFILER_MACRO_DISABLE) - } - } - - void run() - { - AZ_TEST_ASSERT(!Profiler::IsReady()); - Profiler::Create(); - AZ_TEST_ASSERT(Profiler::IsReady()); - Profiler::Destroy(); - AZ_TEST_ASSERT(!Profiler::IsReady()); - -#if !defined(AZ_PROFILER_MACRO_DISABLE) - Profiler::Create(); - - //Profile1(); - - //Profiler::Instance().ReadRegisterValues(AZStd::bind(&ProfilerTest::ReadRegisterCallback,this,AZStd::placeholders::_1,AZStd::placeholders::_2)); - - //Profiler::Instance().ResetRegisters(); - - AZStd::thread_id removeThreadId; - AZStd::chrono::microseconds elapsed[2]; - int numIterations = 10000; - for (int i = 0; i < 2; ++i) - { - // for the second run we should not record any data - if (i == 1) - { - Profiler::Instance().DeactivateSystem("UnitTest"); - } - - AZStd::chrono::system_clock::time_point start = AZStd::chrono::system_clock::now(); - AZStd::thread t1(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t2(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t3(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t4(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t5(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t6(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t7(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - AZStd::thread t8(AZStd::bind(&ProfilerTest::Profile1, this, numIterations)); - - removeThreadId = t4.get_id(); - - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - t6.join(); - t7.join(); - t8.join(); - elapsed[i] = AZStd::chrono::system_clock::now() - start; - //AZ_Printf("Profiler","Elapsed time %d\n",elapsed[i].count()); - - if (i == 0) - { - // just as test remove all associated data and registers. - Profiler::Instance().RemoveThreadData(removeThreadId); - } - - m_numRegistersReceived = 0; - Profiler::Instance().ReadRegisterValues(AZStd::bind(&ProfilerTest::ReadRegisterCallback, this, AZStd::placeholders::_1, AZStd::placeholders::_2)); - if (i == 0) - { - AZ_TEST_ASSERT(m_numRegistersReceived == 7 * 3); // 3 registers for each thread (8 threads - 1 we removed the data for 't4') - } - else - { - AZ_TEST_ASSERT(m_numRegistersReceived == 0); - } - } - Profiler::Destroy(); - - // Test user value registers - Profiler::Create(); - - for (int i = 0; i < 2; ++i) - { - // for the second run we should not record any data - if (i == 1) - { - Profiler::Instance().DeactivateSystem("UnitTest"); - } - - AZStd::thread t1(AZStd::bind(&ProfilerTest::UserValuesSet, this)); - AZStd::thread t2(AZStd::bind(&ProfilerTest::UserValuesSet, this)); - AZStd::thread t3(AZStd::bind(&ProfilerTest::UserValuesSet, this)); - AZStd::thread t4(AZStd::bind(&ProfilerTest::UserValuesSet, this)); - AZStd::thread t5(AZStd::bind(&ProfilerTest::UserValuesAdd, this, 2)); - AZStd::thread t6(AZStd::bind(&ProfilerTest::UserValuesAdd, this, 2)); - AZStd::thread t7(AZStd::bind(&ProfilerTest::UserValuesAdd, this, 2)); - AZStd::thread t8(AZStd::bind(&ProfilerTest::UserValuesAdd, this, 2)); - - removeThreadId = t4.get_id(); - - t1.join(); - t2.join(); - t3.join(); - t4.join(); - t5.join(); - t6.join(); - t7.join(); - t8.join(); - - if (i == 0) - { - // just as test remove all associated data and registers. - Profiler::Instance().RemoveThreadData(removeThreadId); - } - - m_numRegistersReceived = 0; - Profiler::Instance().ReadRegisterValues(AZStd::bind(&ProfilerTest::ReadRegisterCallback, this, AZStd::placeholders::_1, AZStd::placeholders::_2)); - if (i == 0) - { - AZ_TEST_ASSERT(m_numRegistersReceived == 7 * 6); // 6 registers for each thread (8 threads - 1 we removed the data for 't4' ) - } - else - { - AZ_TEST_ASSERT(m_numRegistersReceived == 0); - } - } - Profiler::Destroy(); -#endif - } - }; -#if AZ_TRAIT_DISABLE_FAILED_PROFILER_TEST - TEST_F(ProfilerTest, DISABLED_Test) -#else - TEST_F(ProfilerTest, Test) -#endif // AZ_TRAIT_DISABLE_FAILED_PROFILER_TEST - - { - run(); - } - TEST(Time, Test) { AZStd::sys_time_t ticksPerSecond = AZStd::GetTimeTicksPerSecond(); diff --git a/Code/Framework/AzCore/Tests/StatisticalProfiler.cpp b/Code/Framework/AzCore/Tests/StatisticalProfiler.cpp index 04e70d92a5..6d6023b872 100644 --- a/Code/Framework/AzCore/Tests/StatisticalProfiler.cpp +++ b/Code/Framework/AzCore/Tests/StatisticalProfiler.cpp @@ -317,7 +317,7 @@ namespace UnitTest AZ::Statistics::StatisticalProfilerProxy::TimedScope::ClearCachedProxy(); AZ::Statistics::StatisticalProfilerProxy profilerProxy; AZ::Statistics::StatisticalProfilerProxy* proxy = AZ::Interface::Get(); - AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(AZ::Debug::ProfileCategory::Terrain); + AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(Terrain); const AZ::Statistics::StatisticalProfilerProxy::StatIdType statIdPerformance = "PerformanceResult"; const AZStd::string statNamePerformance("PerformanceResult"); @@ -328,15 +328,15 @@ namespace UnitTest ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdPerformance, statNamePerformance, "us") != nullptr); ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdBlock, statNameBlock, "us") != nullptr); - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, true); + proxy->ActivateProfiler(Terrain, true); const int iter_count = 10; { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, statIdPerformance) + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, statIdPerformance) int counter = 0; for (int i = 0; i < iter_count; i++) { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, statIdBlock) + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, statIdBlock) counter++; } } @@ -348,7 +348,7 @@ namespace UnitTest EXPECT_EQ(profiler.GetStatistic(statIdBlock)->GetNumSamples(), iter_count); //Clean Up - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, false); + proxy->ActivateProfiler(Terrain, false); #undef CODE_PROFILER_PROXY_PUSH_TIME @@ -362,12 +362,12 @@ namespace UnitTest const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread1("simple_thread1"); const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread1_loop("simple_thread1_loop"); - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread1); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread1); static int counter = 0; for (int i = 0; i < loop_cnt; i++) { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread1_loop); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread1_loop); counter++; } } @@ -377,12 +377,12 @@ namespace UnitTest const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread2("simple_thread2"); const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread2_loop("simple_thread2_loop"); - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread2); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread2); static int counter = 0; for (int i = 0; i < loop_cnt; i++) { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread2_loop); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread2_loop); counter++; } } @@ -392,12 +392,12 @@ namespace UnitTest const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread3("simple_thread3"); const AZ::Statistics::StatisticalProfilerProxy::StatIdType simple_thread3_loop("simple_thread3_loop"); - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread3); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread3); static int counter = 0; for (int i = 0; i < loop_cnt; i++) { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, simple_thread3_loop); + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, simple_thread3_loop); } } @@ -408,7 +408,7 @@ namespace UnitTest AZ::Statistics::StatisticalProfilerProxy::TimedScope::ClearCachedProxy(); AZ::Statistics::StatisticalProfilerProxy profilerProxy; AZ::Statistics::StatisticalProfilerProxy* proxy = AZ::Interface::Get(); - AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(AZ::Debug::ProfileCategory::Terrain); + AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(Terrain); const AZ::Statistics::StatisticalProfilerProxy::StatIdType statIdThread1 = "simple_thread1"; const AZStd::string statNameThread1("simple_thread1"); @@ -432,7 +432,7 @@ namespace UnitTest ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdThread3, statNameThread3, "us")); ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdThread3Loop, statNameThread3Loop, "us")); - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, true); + proxy->ActivateProfiler(Terrain, true); //Let's kickoff the threads to see how much contention affects the profiler's performance. const int iter_count = 10; @@ -459,7 +459,7 @@ namespace UnitTest EXPECT_EQ(profiler.GetStatistic(statIdThread3Loop)->GetNumSamples(), iter_count); //Clean Up - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, false); + proxy->ActivateProfiler(Terrain, false); } /** Trace message handler to track messages during tests @@ -745,7 +745,7 @@ namespace UnitTest AZ::Statistics::StatisticalProfilerProxy::TimedScope::ClearCachedProxy(); AZ::Statistics::StatisticalProfilerProxy profilerProxy; AZ::Statistics::StatisticalProfilerProxy* proxy = AZ::Interface::Get(); - AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(AZ::Debug::ProfileCategory::Terrain); + AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(Terrain); const AZ::Statistics::StatisticalProfilerProxy::StatIdType statIdPerformance = "PerformanceResult"; const AZStd::string statNamePerformance("PerformanceResult"); @@ -756,15 +756,15 @@ namespace UnitTest ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdPerformance, statNamePerformance, "us") != nullptr); ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdBlock, statNameBlock, "us") != nullptr); - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, true); + proxy->ActivateProfiler(Terrain, true); const int iter_count = 1000000; { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, statIdPerformance) + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, statIdPerformance) int counter = 0; for (int i = 0; i < iter_count; i++) { - CODE_PROFILER_PROXY_PUSH_TIME(AZ::Debug::ProfileCategory::Terrain, statIdBlock) + CODE_PROFILER_PROXY_PUSH_TIME(Terrain, statIdBlock) counter++; } } @@ -778,7 +778,7 @@ namespace UnitTest profiler.LogAndResetStats("StatisticalProfilerProxy"); //Clean Up - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, false); + proxy->ActivateProfiler(Terrain, false); } #undef CODE_PROFILER_PROXY_PUSH_TIME @@ -788,7 +788,7 @@ namespace UnitTest AZ::Statistics::StatisticalProfilerProxy::TimedScope::ClearCachedProxy(); AZ::Statistics::StatisticalProfilerProxy profilerProxy; AZ::Statistics::StatisticalProfilerProxy* proxy = AZ::Interface::Get(); - AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(AZ::Debug::ProfileCategory::Terrain); + AZ::Statistics::StatisticalProfilerProxy::StatisticalProfilerType& profiler = proxy->GetProfiler(Terrain); const AZ::Statistics::StatisticalProfilerProxy::StatIdType statIdThread1 = "simple_thread1"; const AZStd::string statNameThread1("simple_thread1"); @@ -812,7 +812,7 @@ namespace UnitTest ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdThread3, statNameThread3, "us")); ASSERT_TRUE(profiler.GetStatsManager().AddStatistic(statIdThread3Loop, statNameThread3Loop, "us")); - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, true); + proxy->ActivateProfiler(Terrain, true); //Let's kickoff the threads to see how much contention affects the profiler's performance. const int iter_count = 1000000; @@ -841,7 +841,7 @@ namespace UnitTest profiler.LogAndResetStats("3_Threads_StatisticalProfilerProxy"); //Clean Up - proxy->ActivateProfiler(AZ::Debug::ProfileCategory::Terrain, false); + proxy->ActivateProfiler(Terrain, false); } }//namespace UnitTest diff --git a/Code/Framework/AzCore/Tests/TimeDataStatistics.cpp b/Code/Framework/AzCore/Tests/TimeDataStatistics.cpp index 50856b1df8..192d9dc7f6 100644 --- a/Code/Framework/AzCore/Tests/TimeDataStatistics.cpp +++ b/Code/Framework/AzCore/Tests/TimeDataStatistics.cpp @@ -83,7 +83,7 @@ namespace UnitTest int ChildFunction0(int numIterations, int sleepTimeMilliseconds) { - AZ_PROFILE_TIMER("UnitTest", CHILD_TIMER_STAT0); + AZ_PROFILE_SCOPE(AzCore, CHILD_TIMER_STAT0); AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(sleepTimeMilliseconds)); int result = 5; for (int i = 0; i < numIterations; ++i) @@ -95,7 +95,7 @@ namespace UnitTest int ChildFunction1(int numIterations, int sleepTimeMilliseconds) { - AZ_PROFILE_TIMER("UnitTest", CHILD_TIMER_STAT1); + AZ_PROFILE_SCOPE(AzCore, CHILD_TIMER_STAT1); AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(sleepTimeMilliseconds)); int result = 5; for (int i = 0; i < numIterations; ++i) @@ -107,7 +107,7 @@ namespace UnitTest int ParentFunction(int numIterations, int sleepTimeMilliseconds) { - AZ_PROFILE_TIMER("UnitTest", PARENT_TIMER_STAT); + AZ_PROFILE_SCOPE(AzCore, PARENT_TIMER_STAT); AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(sleepTimeMilliseconds)); int result = 0; result += ChildFunction0(numIterations, sleepTimeMilliseconds); diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index ca0e2862fc..911eaa7b10 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -60,7 +60,6 @@ set(FILES SerializeContextFixture.h Slice.cpp State.cpp - StatisticalProfiler.cpp Statistics.cpp StreamerTests.cpp StringFunc.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index 7b4c328af9..abd97aee0d 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -540,7 +541,7 @@ namespace AzFramework const AZStd::function& workForNewThread, const char* newThreadName) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZStd::thread_desc newThreadDesc; newThreadDesc.m_cpuId = AFFINITY_MASK_USERTHREADS; @@ -548,7 +549,7 @@ namespace AzFramework AZStd::binary_semaphore binarySemaphore; AZStd::thread newThread([&workForNewThread, &binarySemaphore, &newThreadName] { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzFramework, + AZ_PROFILE_SCOPE(AzFramework, "Application::PumpSystemEventLoopWhileDoingWorkInNewThread:ThreadWorker %s", newThreadName); workForNewThread(); @@ -559,7 +560,7 @@ namespace AzFramework PumpSystemEventLoopUntilEmpty(); } { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(AZ::Debug::ProfileCategory::AzFramework, + AZ_PROFILE_SCOPE(AzFramework, "Application::PumpSystemEventLoopWhileDoingWorkInNewThread:WaitOnThread %s", newThreadName); newThread.join(); } @@ -571,10 +572,14 @@ namespace AzFramework //////////////////////////////////////////////////////////////////////////// void Application::RunMainLoop() { + uint32_t frameCounter = 0; while (!m_exitMainLoopRequested) { PumpSystemEventLoopUntilEmpty(); + + AZ_PROFILE_SCOPE(AzCore, "Frame %i", frameCounter); Tick(); + ++frameCounter; } } diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index a3d2103650..d263ad3d0b 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -206,7 +207,7 @@ namespace AZ::IO::ArchiveInternal ////////////////////////////////////////////////////////////////////////// size_t ArchiveInternal::CZipPseudoFile::FRead(void* pDest, size_t nSize, size_t nCount, [[maybe_unused]] AZ::IO::HandleType fileHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!GetFile()) { @@ -271,7 +272,7 @@ namespace AZ::IO::ArchiveInternal ////////////////////////////////////////////////////////////////////////// void* ArchiveInternal::CZipPseudoFile::GetFileData(size_t& nFileSize, [[maybe_unused]] AZ::IO::HandleType fileHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); if (!GetFile()) { @@ -685,7 +686,7 @@ namespace AZ::IO ////////////////////////////////////////////////////////////////////////// AZ::IO::HandleType Archive::FOpen(AZStd::string_view pName, const char* szMode, uint32_t nInputFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); const size_t pathLen = pName.size(); if (pathLen == 0 || pathLen >= MaxPath) @@ -693,7 +694,7 @@ namespace AZ::IO return AZ::IO::InvalidHandle; } - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Game, "File: %.*s Archive: %p", + AZ_PROFILE_SCOPE(Game, "File: %.*s Archive: %p", aznumeric_cast(pName.size()), pName.data(), this); SAutoCollectFileAccessTime accessTime(this); @@ -716,7 +717,7 @@ namespace AZ::IO } const bool fileWritable = (nOSFlags & (AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeAppend | AZ::IO::OpenMode::ModeUpdate)) != AZ::IO::OpenMode::Invalid; - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Game, "File: %s Archive: %p", szFullPath->c_str(), this); + AZ_PROFILE_SCOPE(Game, "File: %s Archive: %p", szFullPath->c_str(), this); if (fileWritable) { // we need to open the file for writing, but we failed to do so. @@ -1094,8 +1095,8 @@ namespace AZ::IO ////////////////////////////////////////////////////////////////////////// size_t Archive::FReadRaw(void* pData, size_t nSize, size_t nCount, AZ::IO::HandleType fileHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Game, "Size: %d Archive: %p", nSize, this); + AZ_PROFILE_FUNCTION(AzCore); + AZ_PROFILE_SCOPE(Game, "Size: %d Archive: %p", nSize, this); SAutoCollectFileAccessTime accessTime(this); ArchiveInternal::CZipPseudoFile* pseudoFile = GetPseudoFile(fileHandle); @@ -1112,7 +1113,7 @@ namespace AZ::IO ////////////////////////////////////////////////////////////////////////// size_t Archive::FReadRawAll(void* pData, size_t nFileSize, AZ::IO::HandleType fileHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); SAutoCollectFileAccessTime accessTime(this); ArchiveInternal::CZipPseudoFile* pseudoFile = GetPseudoFile(fileHandle); @@ -1130,7 +1131,7 @@ namespace AZ::IO ////////////////////////////////////////////////////////////////////////// void* Archive::FGetCachedFileData(AZ::IO::HandleType fileHandle, size_t& nFileSize) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); SAutoCollectFileAccessTime accessTime(this); ArchiveInternal::CZipPseudoFile* pseudoFile = GetPseudoFile(fileHandle); diff --git a/Code/Framework/AzFramework/AzFramework/Entity/EntityContext.cpp b/Code/Framework/AzFramework/AzFramework/Entity/EntityContext.cpp index a323033001..c1283c9379 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/EntityContext.cpp +++ b/Code/Framework/AzFramework/AzFramework/Entity/EntityContext.cpp @@ -167,7 +167,7 @@ namespace AzFramework //========================================================================= void EntityContext::HandleEntitiesAdded(const EntityList& entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); for (AZ::Entity* entity : entities) { @@ -184,7 +184,7 @@ namespace AzFramework //========================================================================= void EntityContext::HandleEntitiesRemoved(const EntityIdList& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); for (AZ::EntityId id : entityIds) { diff --git a/Code/Framework/AzFramework/AzFramework/Entity/SliceEntityOwnershipService.cpp b/Code/Framework/AzFramework/AzFramework/Entity/SliceEntityOwnershipService.cpp index 8ed89ee121..9a077cd611 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/SliceEntityOwnershipService.cpp +++ b/Code/Framework/AzFramework/AzFramework/Entity/SliceEntityOwnershipService.cpp @@ -155,7 +155,7 @@ namespace AzFramework void SliceEntityOwnershipService::CreateRootSlice() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZ_Assert(m_rootAsset && m_rootAsset.Get(), "Root slice asset has not been created yet."); @@ -164,7 +164,7 @@ namespace AzFramework void SliceEntityOwnershipService::CreateRootSlice(AZ::SliceAsset* rootSliceAsset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZ_Assert(m_rootAsset && m_rootAsset.Get(), "Root slice asset has not been created yet."); AZ::Entity* rootEntity = new AZ::Entity(); @@ -240,7 +240,7 @@ namespace AzFramework bool SliceEntityOwnershipService::LoadFromStream(AZ::IO::GenericStream& stream, bool remapIds, EntityIdToEntityIdMap* idRemapTable, const AZ::ObjectStream::FilterDescriptor& filterDesc) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZ_Assert(m_rootAsset, "The entity ownership service has not been initialized."); @@ -259,7 +259,7 @@ namespace AzFramework bool SliceEntityOwnershipService::HandleRootEntityReloadedFromStream(AZ::Entity* rootEntity, bool remapIds, AZ::SliceComponent::EntityIdToEntityIdMap* idRemapTable) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); if (!rootEntity) { @@ -385,7 +385,7 @@ namespace AzFramework void SliceEntityOwnershipService::OnAssetReady(AZ::Data::Asset readyAsset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZ_ASSET_ATTACH_TO_SCOPE(readyAsset.Get()); AZ_Assert(readyAsset.GetAs(), "Asset is not a slice!"); @@ -472,7 +472,7 @@ namespace AzFramework void SliceEntityOwnershipService::OnAssetReloaded(AZ::Data::Asset asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); if (asset == m_rootAsset && asset.Get() != m_rootAsset.Get()) { Reset(); @@ -548,7 +548,7 @@ namespace AzFramework AZ::SliceComponent::SliceInstanceAddress SliceEntityOwnershipService::CloneSliceInstance( AZ::SliceComponent::SliceInstanceAddress sourceInstance, AZ::SliceComponent::EntityIdToEntityIdMap& sourceToCloneEntityIdMap) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); AZ_Assert(sourceInstance.IsValid(), "Source slice instance is invalid."); diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp index 5b38a5e966..8db0c27475 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp @@ -80,7 +80,7 @@ namespace AzFramework { using namespace AZ::IO; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); if (AZStd::holds_alternative(request->GetCommand())) @@ -278,7 +278,7 @@ namespace AzFramework { using namespace AZ::IO; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "Request doing reading in the RemoteStorageDrive didn't contain read data.") @@ -424,7 +424,7 @@ namespace AzFramework { using namespace AZ::IO; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore); + AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileMetaDataTimeAverage); AZ::u64 fileSize = 0; diff --git a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp index 6b25c49b88..aaf2de3e58 100644 --- a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp @@ -619,7 +619,7 @@ namespace AzFramework //========================================================================= void ScriptComponent::LoadScript() { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Script, "Load: %s", m_script.GetHint().c_str()); + AZ_PROFILE_SCOPE(Script, "Load: %s", m_script.GetHint().c_str()); // Load the script, find the base table, create the entity table // find the Activate/Deactivate functions in the script and call them @@ -634,7 +634,7 @@ namespace AzFramework //========================================================================= void ScriptComponent::UnloadScript() { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Script, "Unload: %s", m_script.GetHint().c_str()); + AZ_PROFILE_SCOPE(Script, "Unload: %s", m_script.GetHint().c_str()); DestroyEntityTable(); } @@ -822,7 +822,7 @@ namespace AzFramework lua_rawget(lua, baseStackIndex); // ScriptTable[OnActivate] if (lua_isfunction(lua, -1)) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Script, "OnActivate"); + AZ_PROFILE_SCOPE(Script, "OnActivate"); lua_rawgeti(lua, LUA_REGISTRYINDEX, m_table); // push the entity table as the only argument AZ::Internal::LuaSafeCall(lua, 1, 0); // Call OnActivate } @@ -856,7 +856,7 @@ namespace AzFramework lua_rawget(lua, -2); // ScriptTable[OnDeactivte] if (lua_isfunction(lua, -1)) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Script, "OnDeactivate"); + AZ_PROFILE_SCOPE(Script, "OnDeactivate"); lua_pushvalue(lua, -3); // push the entity table as the only argument AZ::Internal::LuaSafeCall(lua, 1, 0); // Call OnDeactivate diff --git a/Code/Framework/AzFramework/AzFramework/TargetManagement/TargetManagementComponent.cpp b/Code/Framework/AzFramework/AzFramework/TargetManagement/TargetManagementComponent.cpp index eec384a695..c1ce31613c 100644 --- a/Code/Framework/AzFramework/AzFramework/TargetManagement/TargetManagementComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/TargetManagement/TargetManagementComponent.cpp @@ -625,7 +625,7 @@ namespace AzFramework return; } - AZ_PROFILE_TIMER("TargetManager"); + AZ_PROFILE_SCOPE(AzFramework, "TargetManager::SendTmMessage"); AZStd::vector msgBuffer; AZ::IO::ByteContainerStream > outMsg(&msgBuffer); @@ -651,7 +651,7 @@ namespace AzFramework void TargetManagementComponent::DispatchMessages(MsgSlotId id) { - AZ_PROFILE_TIMER("TargetManager"); + AZ_PROFILE_SCOPE(AzFramework, "TargetManager::DispatchMessages"); AZStd::lock_guard lock(m_inboxMutex); size_t maxMsgsToProcess = m_inbox.size(); TmMsgQueue::iterator itMsg = m_inbox.begin(); @@ -684,7 +684,7 @@ namespace AzFramework { if (m_networkImpl->m_gridMate) { - AZ_PROFILE_TIMER("TargetManager"); + AZ_PROFILE_SCOPE(AzFramework, "TargetManager::Tick"); if (!m_networkImpl->m_session && !m_networkImpl->m_gridSearch) { if (AZStd::chrono::system_clock::now() > m_reconnectionTime) @@ -694,7 +694,7 @@ namespace AzFramework } { - AZ_PROFILE_TIMER("TargetManager", "Tick Gridmate"); + AZ_PROFILE_SCOPE(AzFramework, "TargetManager::Tick Gridmate"); m_networkImpl->m_gridMate->Update(); if (m_networkImpl->m_session && m_networkImpl->m_session->GetReplicaMgr()) { @@ -707,7 +707,7 @@ namespace AzFramework if (m_networkImpl->m_session) { - AZ_PROFILE_TIMER("TargetManager", "Send/Receive TmMsgs"); + AZ_PROFILE_SCOPE(AzFramework, "TargetManager::Tick Send/Receive TmMsgs"); // Receive for (unsigned int i = 0; i < m_networkImpl->m_session->GetNumberOfMembers(); ++i) diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp index c5253a8c89..bfa9dfcf9e 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp @@ -8,6 +8,7 @@ #include "EntityVisibilityBoundsUnionSystem.h" +#include #include #include @@ -42,7 +43,7 @@ namespace AzFramework void EntityVisibilityBoundsUnionSystem::OnEntityActivated(AZ::Entity* entity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); // ignore any entity that might activate which does not have a TransformComponent if (entity->GetTransform() == nullptr) @@ -68,7 +69,7 @@ namespace AzFramework void EntityVisibilityBoundsUnionSystem::OnEntityDeactivated(AZ::Entity* entity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); // ignore any entity that might deactivate which does not have a TransformComponent if (entity->GetTransform() == nullptr) @@ -89,7 +90,7 @@ namespace AzFramework void EntityVisibilityBoundsUnionSystem::UpdateVisibilitySystem(AZ::Entity* entity, EntityVisibilityBoundsUnionInstance& instance) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); if (const auto& localEntityBoundsUnions = instance.m_localEntityBoundsUnion; localEntityBoundsUnions.IsValid()) { @@ -136,7 +137,7 @@ namespace AzFramework void EntityVisibilityBoundsUnionSystem::ProcessEntityBoundsUnionRequests() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); // iterate over all entities whose bounds changed and recalculate them for (const auto& entity : m_entityBoundsDirty) @@ -155,7 +156,7 @@ namespace AzFramework void EntityVisibilityBoundsUnionSystem::OnTransformUpdated(AZ::Entity* entity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); // update the world transform of the visibility bounds union if (auto instance_it = m_entityVisibilityBoundsUnionInstanceMapping.find(entity); diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp index 2023cb969d..96d371fa12 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp @@ -34,7 +34,7 @@ namespace AzFramework { void EntityVisibilityQuery::UpdateVisibility(const AzFramework::CameraState& cameraState) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzFramework); + AZ_PROFILE_FUNCTION(AzFramework); auto* visSystem = AZ::Interface::Get(); if (!visSystem) diff --git a/Code/Framework/AzTest/AzTest/Platform/Android/AzTest_Traits_Android.h b/Code/Framework/AzTest/AzTest/Platform/Android/AzTest_Traits_Android.h index b210fb9b62..cfd04d2a8b 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Android/AzTest_Traits_Android.h +++ b/Code/Framework/AzTest/AzTest/Platform/Android/AzTest_Traits_Android.h @@ -30,7 +30,6 @@ #define AZ_TRAIT_DISABLE_FAILED_MULTIPLAYER_GRIDMATE_TESTS true #define AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS true #define AZ_TRAIT_DISABLE_FAILED_PHYSICS_TESTS true -#define AZ_TRAIT_DISABLE_FAILED_PROFILER_TEST true #define AZ_TRAIT_DISABLE_FAILED_SAVE_DATA_TESTS true #define AZ_TRAIT_DISABLE_FAILED_SERIALIZE_BASIC_TEST true #define AZ_TRAIT_DISABLE_FAILED_STREAMER_TESTS true diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index 56ef749247..3e895465e5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp @@ -95,7 +95,7 @@ namespace AzToolsFramework template void DeleteEntities(const IdContainerType& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityIds.empty()) { @@ -141,7 +141,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities"); for (const auto& entityId : entityIds) { AZ::Entity* entity = NULL; @@ -160,7 +160,7 @@ namespace AzToolsFramework selCommand->SetParent(currentUndoBatch); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:RunRedo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:RunRedo"); selCommand->RunRedo(); } } @@ -458,7 +458,7 @@ namespace AzToolsFramework bool ToolsApplication::RemoveEntity(AZ::Entity* entity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto undoCacheInterface = AZ::Interface::Get(); if (undoCacheInterface) @@ -472,7 +472,7 @@ namespace AzToolsFramework EBUS_EVENT(ToolsApplicationEvents::Bus, EntityDeregistered, entity->GetId()); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::RemoveEntity:CallApplicationRemoveEntity"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::RemoveEntity:CallApplicationRemoveEntity"); if (AzFramework::Application::RemoveEntity(entity)) { return true; @@ -545,7 +545,7 @@ namespace AzToolsFramework void ToolsApplication::MarkEntitySelected(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(entityId.IsValid(), "Invalid entity Id being marked as selected."); EntityIdList::iterator foundIter = AZStd::find(m_selectedEntities.begin(), m_selectedEntities.end(), entityId); @@ -563,7 +563,7 @@ namespace AzToolsFramework void ToolsApplication::MarkEntitiesSelected(const EntityIdList& entitiesToSelect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EntityIdList entitiesSelected; entitiesSelected.reserve(entitiesToSelect.size()); @@ -587,11 +587,11 @@ namespace AzToolsFramework void ToolsApplication::MarkEntityDeselected(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto foundIter = AZStd::find(m_selectedEntities.begin(), m_selectedEntities.end(), entityId); if (foundIter != m_selectedEntities.end()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::MarkEntityDeselected:Deselect"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::MarkEntityDeselected:Deselect"); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntitySelectionChanged); m_selectedEntities.erase(foundIter); @@ -603,7 +603,7 @@ namespace AzToolsFramework void ToolsApplication::MarkEntitiesDeselected(const EntityIdList& entitiesToDeselect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntitySelectionChanged); @@ -633,14 +633,14 @@ namespace AzToolsFramework void ToolsApplication::SetEntityHighlighted(AZ::EntityId entityId, bool highlighted) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto foundIter = AZStd::find(m_highlightedEntities.begin(), m_highlightedEntities.end(), entityId); if (foundIter != m_highlightedEntities.end()) { if (!highlighted) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::SetEntityHighlighted:RemoveHighlight"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::SetEntityHighlighted:RemoveHighlight"); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntityHighlightingChanged); m_highlightedEntities.erase(foundIter); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::AfterEntityHighlightingChanged); @@ -648,7 +648,7 @@ namespace AzToolsFramework } else if (highlighted) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::SetEntityHighlighted:AddHighlight"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::SetEntityHighlighted:AddHighlight"); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntityHighlightingChanged); m_highlightedEntities.push_back(entityId); ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::AfterEntityHighlightingChanged); @@ -657,7 +657,7 @@ namespace AzToolsFramework void ToolsApplication::SetSelectedEntities(const EntityIdList& selectedEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // We're setting the selection set as a batch from an external caller. // * Filter out any unselectable entities @@ -1535,7 +1535,7 @@ namespace AzToolsFramework void ToolsApplication::CreateUndosForDirtyEntities() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(!m_isDuringUndoRedo, "Cannot add dirty entities during undo/redo."); if (m_dirtyEntities.empty()) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityStateCommand.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityStateCommand.cpp index 9f251bee7a..b73e1ea5ac 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityStateCommand.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/EntityStateCommand.cpp @@ -54,7 +54,7 @@ namespace AzToolsFramework void EntityStateCommand::Capture(AZ::Entity* pSourceEntity, bool captureUndo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_entityID = pSourceEntity->GetId(); EBUS_EVENT_ID_RESULT(m_entityContextId, m_entityID, AzFramework::EntityIdContextQueryBus, GetOwningContextId); @@ -114,7 +114,7 @@ namespace AzToolsFramework void EntityStateCommand::RestoreEntity(const AZ::u8* buffer, AZStd::size_t bufferSizeBytes, const AZ::SliceComponent::EntityRestoreInfo& sliceRestoreInfo) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(buffer, "No data to undo!"); AZ_Assert(bufferSizeBytes, "Undo data is empty."); @@ -259,7 +259,7 @@ namespace AzToolsFramework void EntityDeleteCommand::Redo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EBUS_EVENT(AZ::ComponentApplicationBus, DeleteEntity, m_entityID); PreemptiveUndoCache::Get()->PurgeCache(m_entityID); } @@ -277,7 +277,7 @@ namespace AzToolsFramework void EntityCreateCommand::Undo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EBUS_EVENT(AZ::ComponentApplicationBus, DeleteEntity, m_entityID); PreemptiveUndoCache::Get()->PurgeCache(m_entityID); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/PreemptiveUndoCache.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/PreemptiveUndoCache.cpp index 4d84089a74..d4c4fa1e65 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/PreemptiveUndoCache.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Commands/PreemptiveUndoCache.cpp @@ -86,7 +86,7 @@ namespace AzToolsFramework void PreemptiveUndoCache::UpdateCache(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // capture it diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp index b45ffdd31d..90657132ca 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp @@ -312,7 +312,7 @@ namespace AzToolsFramework EntityList& resultEntities, EntityIdToEntityIdMap& sourceToCloneEntityIdMap) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); resultEntities.clear(); @@ -365,7 +365,7 @@ namespace AzToolsFramework const EntityList& entitiesInLayers, AZ::SliceComponent::SliceReferenceToInstancePtrs& instancesInLayers) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_isLegacySliceService) { @@ -390,7 +390,7 @@ namespace AzToolsFramework //========================================================================= bool EditorEntityContextComponent::SaveToStreamForGame(AZ::IO::GenericStream& stream, AZ::DataStream::StreamType streamType) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_isLegacySliceService) { SliceEditorEntityOwnershipService* editorEntityOwnershipService = @@ -409,7 +409,7 @@ namespace AzToolsFramework //========================================================================= bool EditorEntityContextComponent::LoadFromStream(AZ::IO::GenericStream& stream) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(stream.IsOpen(), "Invalid source stream."); AZ_Assert(m_entityOwnershipService->IsInitialized(), "The context has not been initialized."); @@ -427,7 +427,7 @@ namespace AzToolsFramework bool EditorEntityContextComponent::LoadFromStreamWithLayers(AZ::IO::GenericStream& stream, QString levelPakFile) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(stream.IsOpen(), "Invalid source stream."); AZ_Assert(m_entityOwnershipService->IsInitialized(), "The context has not been initialized."); @@ -477,7 +477,7 @@ namespace AzToolsFramework //========================================================================= void EditorEntityContextComponent::StartPlayInEditor() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnStartPlayInEditorBegin); @@ -513,7 +513,7 @@ namespace AzToolsFramework //========================================================================= void EditorEntityContextComponent::StopPlayInEditor() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_isRunningGame = false; @@ -696,13 +696,13 @@ namespace AzToolsFramework //========================================================================= void EditorEntityContextComponent::SetupEditorEntities(const EntityList& entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Data::AssetManager::Instance().SuspendAssetRelease(); // All editor entities are automatically activated. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ScrubEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ScrubEntities"); // Scrub entities before initialization. // Anything could go wrong with entities loaded from disk. @@ -712,7 +712,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:InitEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:InitEntities"); for (AZ::Entity* entity : entities) { if (entity->GetState() == AZ::Entity::State::Constructed) @@ -723,7 +723,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:CreateEditorRepresentations"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:CreateEditorRepresentations"); for (AZ::Entity* entity : entities) { EditorRequests::Bus::Broadcast(&EditorRequests::CreateEditorRepresentation, entity); @@ -731,7 +731,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ActivateEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ActivateEntities"); for (AZ::Entity* entity : entities) { if (entity->GetState() == AZ::Entity::State::Init) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp index 17ea732103..0b0358d613 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp @@ -323,7 +323,7 @@ namespace AzToolsFramework void AddEntityIdToSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, bool forceAddToBack) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId); bool success = false; @@ -336,7 +336,7 @@ namespace AzToolsFramework void AddEntityIdToSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, const AZ::EntityId beforeEntity) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId); bool success = false; @@ -349,7 +349,7 @@ namespace AzToolsFramework bool RecoverEntitySortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, AZ::u64 sortIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EntityOrderArray entityOrderArray; EditorEntitySortRequestBus::EventResult(entityOrderArray, GetEntityIdForSortInfo(parentId), &EditorEntitySortRequestBus::Events::GetChildEntityOrderArray); @@ -372,7 +372,7 @@ namespace AzToolsFramework void RemoveEntityIdFromSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId); bool success = false; @@ -385,7 +385,7 @@ namespace AzToolsFramework bool SetEntityChildOrder(const AZ::EntityId parentId, const EntityIdList& children) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto sortEntityId = GetEntityIdForSortInfo(parentId); bool success = false; @@ -399,7 +399,7 @@ namespace AzToolsFramework EntityIdList GetEntityChildOrder(const AZ::EntityId parentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EntityIdList children; EditorEntityInfoRequestBus::EventResult(children, parentId, &EditorEntityInfoRequestBus::Events::GetChildren); @@ -441,7 +441,7 @@ namespace AzToolsFramework //sort vector of entities by how they're arranged void SortEntitiesByLocationInHierarchy(EntityIdList& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //cache locations for faster sort AZStd::unordered_map> locations; for (auto entityId : entityIds) @@ -575,7 +575,7 @@ namespace AzToolsFramework bool IsSelected(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); bool selected = false; EditorEntityInfoRequestBus::EventResult( @@ -585,7 +585,7 @@ namespace AzToolsFramework bool IsSelectableInViewport(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); bool visible = false; EditorEntityInfoRequestBus::EventResult( @@ -602,7 +602,7 @@ namespace AzToolsFramework const AZ::EntityId entityId, const bool locked, const AZ::EntityId toggledEntityId, const bool toggledEntityWasLayer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!entityId.IsValid()) { @@ -661,7 +661,7 @@ namespace AzToolsFramework // note: must be called on layer entity static void UnlockLayer(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EditorLockComponentRequestBus::Event( entityId, &EditorLockComponentRequestBus::Events::SetLocked, false); @@ -698,7 +698,7 @@ namespace AzToolsFramework void SetEntityLockState(const AZ::EntityId entityId, const bool locked) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // when an entity is unlocked, if it was in a locked layer(s), unlock those layers if (!locked) @@ -736,7 +736,7 @@ namespace AzToolsFramework void ToggleEntityLockState(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityId.IsValid()) { @@ -772,7 +772,7 @@ namespace AzToolsFramework static void SetEntityVisibilityInternal(const AZ::EntityId entityId, const bool visibility) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); bool layerEntity = false; Layers::EditorLayerComponentRequestBus::EventResult( @@ -795,7 +795,7 @@ namespace AzToolsFramework // note: must be called on layer entity static void ShowLayer(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SetEntityVisibilityInternal(entityId, true); @@ -830,7 +830,7 @@ namespace AzToolsFramework const AZ::EntityId entityId, const bool visible, const AZ::EntityId toggledEntityId, const bool toggledEntityWasLayer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!entityId.IsValid()) { @@ -879,7 +879,7 @@ namespace AzToolsFramework void SetEntityVisibility(const AZ::EntityId entityId, const bool visible) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // when an entity is set to visible, if it was in an invisible layer(s), make that layer visible if (visible) @@ -917,7 +917,7 @@ namespace AzToolsFramework void ToggleEntityVisibility(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityId.IsValid()) { @@ -969,7 +969,7 @@ namespace AzToolsFramework bool IsEntitySetToBeVisible(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Visibility state is tracked in 5 places, see OutlinerListModel::dataForLock for info on 3 of these ways. // Visibility's fourth state over lock is the EditorVisibilityRequestBus has two sets of @@ -1007,7 +1007,7 @@ namespace AzToolsFramework AZ::Vector3 GetWorldTranslation(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Vector3 worldTranslation = AZ::Vector3::CreateZero(); AZ::TransformBus::EventResult( @@ -1018,7 +1018,7 @@ namespace AzToolsFramework AZ::Vector3 GetLocalTranslation(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Vector3 localTranslation = AZ::Vector3::CreateZero(); AZ::TransformBus::EventResult( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp index 860c12b11a..8d96cc42fe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp @@ -38,7 +38,7 @@ namespace bool HasDifferences(T* sourceElem, T* compareElem, bool isRoot, AZ::SerializeContext* serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!sourceElem || !compareElem) { @@ -146,7 +146,7 @@ namespace AzToolsFramework void EditorEntityModel::Reset() { m_preparingForContextReset = false; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //disconnect all entity ids EditorEntitySortNotificationBus::MultiHandler::BusDisconnect(); @@ -209,7 +209,7 @@ namespace AzToolsFramework sortedEntitiesToAdd.reserve(unsortedEntitiesToAdd.size()); { // Sort pending entities - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::AddEntityBatch:Sort"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::AddEntityBatch:Sort"); // Gather basic sorting data for each pending entity and // create map from parent ID to child entries. @@ -307,7 +307,7 @@ namespace AzToolsFramework } { // Add sorted entities - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::AddEntityBatch:Add"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::AddEntityBatch:Add"); for (AZ::EntityId entityId : sortedEntitiesToAdd) { AddEntity(entityId); @@ -325,7 +325,7 @@ namespace AzToolsFramework void EditorEntityModel::AddEntity(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto& entityInfo = GetInfo(entityId); //initialize and connect this entry to the entity id @@ -374,7 +374,7 @@ namespace AzToolsFramework // Skip doing slow, unecessary work for this bulk operations. return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto& entityInfo = GetInfo(entityId); if (!entityInfo.IsConnected()) { @@ -404,7 +404,7 @@ namespace AzToolsFramework void EditorEntityModel::AddChildToParent(AZ::EntityId parentId, AZ::EntityId childId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(childId != parentId, "AddChildToParent called with same child and parent"); if (childId == parentId || !childId.IsValid()) { @@ -479,7 +479,7 @@ namespace AzToolsFramework void EditorEntityModel::RemoveChildFromParent(AZ::EntityId parentId, AZ::EntityId childId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(childId != parentId, "RemoveChildFromparent called with same child and parent"); AZ_Assert(childId.IsValid(), "RemoveChildFromparent called with an invalid child entity id"); if (childId == parentId || !childId.IsValid()) @@ -544,7 +544,7 @@ namespace AzToolsFramework void EditorEntityModel::ReparentChild(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(oldParentId != entityId, "ReparentChild gave us an oldParentId that is the same as the entityId. An entity cannot be a parent of itself, ignoring old parent"); AZ_Assert(newParentId != entityId, "ReparentChild gave us an newParentId that is the same as the entityId. An entity cannot be a parent of itself, ignoring old parent"); if (oldParentId != entityId && newParentId != entityId) @@ -573,7 +573,7 @@ namespace AzToolsFramework void EditorEntityModel::EntityRegistered(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //when an editor entity is created and registered, add it to a pending list. //once all entities in the pending list are activated, add them to model. bool isEditorEntity = false; @@ -591,7 +591,7 @@ namespace AzToolsFramework void EditorEntityModel::EntityDeregistered(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //when an editor entity is de-registered, stop tracking it if (m_entityInfoTable.find(entityId) != m_entityInfoTable.end()) { @@ -628,7 +628,7 @@ namespace AzToolsFramework void EditorEntityModel::EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (GetInfo(entityId).IsConnected()) { ReparentChild(entityId, newParentId, oldParentId); @@ -647,7 +647,7 @@ namespace AzToolsFramework void EditorEntityModel::ChildEntityOrderArrayUpdated() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //when notified that a parent has reordered its children, they must be updated if (m_enableChildReorderHandler) { @@ -671,14 +671,14 @@ namespace AzToolsFramework void EditorEntityModel::OnEditorEntitiesPromotedToSlicedEntities(const AzToolsFramework::EntityIdList& promotedEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); OnEditorEntitiesSliceOwnershipChanged(promotedEntities); } void EditorEntityModel::OnEditorEntitiesSliceOwnershipChanged(const AzToolsFramework::EntityIdList& entityIdList) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Need to update slice info from top of hierarchy down // as parent entity slice status will be querried and needs to be correct @@ -712,7 +712,7 @@ namespace AzToolsFramework void EditorEntityModel::OnEntityStreamLoadSuccess() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //block internal reorder event handling to avoid recursion since we're manually updating everything m_enableChildReorderHandler = false; @@ -722,7 +722,7 @@ namespace AzToolsFramework //refresh all order info while blocking related events (keeps UI observers from updating until refresh is complete) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateChildOrderInfo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateChildOrderInfo"); for (auto& entityInfoPair : m_entityInfoTable) { if (entityInfoPair.second.IsConnected()) @@ -733,7 +733,7 @@ namespace AzToolsFramework } } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateOrderInfo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateOrderInfo"); for (auto& entityInfoPair : m_entityInfoTable) { if (entityInfoPair.second.IsConnected()) @@ -778,7 +778,7 @@ namespace AzToolsFramework void EditorEntityModel::OnEntityTransformChanged(const AzToolsFramework::EntityIdList& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (const AZ::EntityId& entityId : entityIds) { @@ -846,7 +846,7 @@ namespace AzToolsFramework void EditorEntityModel::UpdateSliceInfoHierarchy(AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto& entityInfo = GetInfo(entityId); entityInfo.UpdateOrderInfo(false); entityInfo.UpdateSliceInfo(); @@ -896,7 +896,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::Connect() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); Disconnect(); EntityInfoRequestConnect(); @@ -946,7 +946,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::UpdateSliceInfo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //reset slice info m_sliceFlags = (m_sliceFlags & SliceFlag_OverridesMask); // only hold on to the override flags @@ -1037,7 +1037,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::UpdateOrderInfo(bool notify) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::u64 oldIndex = m_indexForSorting; AZ::u64 newIndex = 0; @@ -1061,7 +1061,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::UpdateChildOrderInfo(bool forceAddToBack) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //add order info if missing for (auto childId : m_children) { @@ -1475,7 +1475,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::OnEntityLockFlagChanged(bool locked) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_locked != locked) { @@ -1493,7 +1493,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::OnEntityVisibilityFlagChanged(bool visibility) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_visible != visibility) { @@ -1511,7 +1511,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::OnSelected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_selected) { m_selected = true; @@ -1522,7 +1522,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::OnDeselected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_selected) { m_selected = false; @@ -1533,7 +1533,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::OnEntityNameChanged(const AZStd::string& name) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_name != name) { m_name = name; @@ -1554,7 +1554,7 @@ namespace AzToolsFramework { if (CanProcessOverrides()) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); using TransformComponent = AzToolsFramework::Components::TransformComponent; @@ -1569,7 +1569,7 @@ namespace AzToolsFramework { if (CanProcessOverrides()) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); using EditorInspectorComponent = AzToolsFramework::Components::EditorInspectorComponent; @@ -1584,7 +1584,7 @@ namespace AzToolsFramework { if (CanProcessOverrides()) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Component* liveComponent = m_entity->FindComponent(componentId); AZ::Component* sourceComponent = m_sourceClone->FindComponent(componentId); @@ -1804,7 +1804,7 @@ namespace AzToolsFramework return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::u8 lastFlags = m_sliceFlags; @@ -1884,7 +1884,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::ModifyParentsOverriddenChildren(AZ::EntityId childEntityId, AZ::u8 lastFlags, bool childHasOverrides) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (((lastFlags & SliceFlag_EntityHasOverrides) == 0) != ((m_sliceFlags & SliceFlag_EntityHasOverrides) == 0)) { @@ -1916,7 +1916,7 @@ namespace AzToolsFramework void EditorEntityModel::EditorEntityModelEntry::UpdateCyclicDependencyInfo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Only check cyclic dependency if the current entity is a slice root if (!IsSliceRoot()) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntitySortComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntitySortComponent.cpp index 0e53c180d4..b747469f4d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntitySortComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntitySortComponent.cpp @@ -130,7 +130,7 @@ namespace AzToolsFramework bool EditorEntitySortComponent::SetChildEntityOrderArray(const EntityOrderArray& entityOrderArray) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_childEntityOrderArray != entityOrderArray) { m_childEntityOrderArray = entityOrderArray; @@ -143,7 +143,7 @@ namespace AzToolsFramework bool EditorEntitySortComponent::AddChildEntityInternal(const AZ::EntityId& entityId, bool addToBack, EntityOrderArray::iterator insertPosition) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto entityItr = m_childEntityOrderCache.find(entityId); if (entityItr == m_childEntityOrderCache.end()) { @@ -197,7 +197,7 @@ namespace AzToolsFramework bool EditorEntitySortComponent::RemoveChildEntity(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto entityItr = m_childEntityOrderCache.find(entityId); if (entityItr != m_childEntityOrderCache.end()) { @@ -222,7 +222,7 @@ namespace AzToolsFramework void EditorEntitySortComponent::OnEntityStreamLoadSuccess() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_childEntityOrderCache.clear(); if (!m_childEntityOrderArray.empty()) @@ -320,7 +320,7 @@ namespace AzToolsFramework void EditorEntitySortComponent::RebuildEntityOrderCache() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_childEntityOrderCache.clear(); for (auto entityId : m_childEntityOrderArray) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp index e22800498c..7ac3b7be8f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp @@ -77,7 +77,7 @@ namespace AzToolsFramework AzFramework::SliceInstantiationTicket SliceEditorEntityOwnershipService::InstantiateEditorSlice( const AZ::Data::Asset& sliceAsset, const AZ::Transform& worldTransform) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (sliceAsset.GetId().IsValid()) { @@ -97,7 +97,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::OnSlicePreInstantiate(const AZ::Data::AssetId& sliceAssetId, const AZ::SliceComponent::SliceInstanceAddress& sliceAddress) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId(); // Start an undo that will wrap the entire slice instantiation event (unable to do this at a higher level since this is queued up by AzFramework and there's no undo concept at that level) @@ -134,7 +134,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::OnSliceInstantiated(const AZ::Data::AssetId& sliceAssetId, const AZ::SliceComponent::SliceInstanceAddress& sliceAddress) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId(); @@ -149,7 +149,7 @@ namespace AzToolsFramework // Close out the next ticket corresponding to this asset. for (auto instantiatingIter = m_instantiatingSlices.begin(); instantiatingIter != m_instantiatingSlices.end(); ++instantiatingIter) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket"); if (instantiatingIter->first.GetId() == sliceAssetId) { const AZ::SliceComponent::EntityList& entities = sliceAddressCopy.GetInstance()->GetInstantiated()->m_entities; @@ -165,7 +165,7 @@ namespace AzToolsFramework // Create a slice instantiation undo command. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket:CreateInstantiateUndo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket:CreateInstantiateUndo"); ScopedUndoBatch undoBatch("Instantiate Slice"); for (AZ::Entity* entity : entities) { @@ -192,7 +192,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId(); @@ -214,7 +214,7 @@ namespace AzToolsFramework AZ::SliceComponent::SliceInstanceAddress SliceEditorEntityOwnershipService::CloneEditorSliceInstance( AZ::SliceComponent::SliceInstanceAddress sourceInstance, AZ::SliceComponent::EntityIdToEntityIdMap& sourceToCloneEntityIdMap) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (sourceInstance.IsValid()) { @@ -330,7 +330,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::DetachSliceInstances(const AZ::SliceComponent::SliceInstanceAddressSet& instances) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const char* undoMsg = instances.size() == 1 ? "Detach Instance from Slice" : "Detach Instances from Slice"; @@ -359,7 +359,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::DetachSubsliceInstances(const AZ::SliceComponent::SliceInstanceEntityIdRemapList& subsliceRootList) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (subsliceRootList.empty()) { @@ -379,7 +379,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::DetachFromSlice(const AzToolsFramework::EntityIdList& entities, const char* undoMessage) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entities.empty()) { @@ -424,7 +424,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::OnAssetReady(AZ::Data::Asset asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Data::AssetBus::MultiHandler::BusDisconnect(asset.GetId()); @@ -511,7 +511,7 @@ namespace AzToolsFramework //========================================================================= void SliceEditorEntityOwnershipService::OnAssetReloaded(AZ::Data::Asset asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EntityIdList selectedEntities; ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities); @@ -524,7 +524,7 @@ namespace AzToolsFramework void SliceEditorEntityOwnershipService::ResetEntitiesToSliceDefaults(EntityIdList entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch("Resetting entities to slice defaults."); PreemptiveUndoCache* preemptiveUndoCache = nullptr; @@ -646,7 +646,7 @@ namespace AzToolsFramework bool SliceEditorEntityOwnershipService::SaveToStreamForEditor(AZ::IO::GenericStream& stream, const EntityList& entitiesInLayers, AZ::SliceComponent::SliceReferenceToInstancePtrs& instancesInLayers) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(stream.IsOpen(), "Invalid target stream."); AzFramework::RootSliceAsset rootSliceAsset = GetRootAsset(); @@ -685,7 +685,7 @@ namespace AzToolsFramework bool SliceEditorEntityOwnershipService::SaveToStreamForGame(AZ::IO::GenericStream& stream, AZ::DataStream::StreamType streamType) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::SliceComponent::EntityList sourceEntities; GetRootSlice()->GetEntities(sourceEntities); @@ -929,7 +929,7 @@ namespace AzToolsFramework bool SliceEditorEntityOwnershipService::LoadFromStreamWithLayers(AZ::IO::GenericStream& stream, QString levelPakFile) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::ObjectStream::FilterDescriptor filterDesc = AZ::ObjectStream::FilterDescriptor(&AZ::Data::AssetFilterSourceSlicesOnly); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/BaseManipulator.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/BaseManipulator.cpp index 1a7e7260c5..b514c3957f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/BaseManipulator.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/BaseManipulator.cpp @@ -33,7 +33,7 @@ namespace AzToolsFramework bool BaseManipulator::OnLeftMouseDown(const ViewportInteraction::MouseInteraction& interaction, const float rayIntersectionDistance) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_onLeftMouseDownImpl) { @@ -59,7 +59,7 @@ namespace AzToolsFramework bool BaseManipulator::OnRightMouseDown(const ViewportInteraction::MouseInteraction& interaction, const float rayIntersectionDistance) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_onRightMouseDownImpl) { @@ -87,7 +87,7 @@ namespace AzToolsFramework // attached as no active manipulator will have been set in ManipulatorManager. void BaseManipulator::OnLeftMouseUp(const ViewportInteraction::MouseInteraction& interaction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SetBoundsDirty(); @@ -98,7 +98,7 @@ namespace AzToolsFramework void BaseManipulator::OnRightMouseUp(const ViewportInteraction::MouseInteraction& interaction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SetBoundsDirty(); @@ -109,7 +109,7 @@ namespace AzToolsFramework bool BaseManipulator::OnMouseOver(const ManipulatorId manipulatorId, const ViewportInteraction::MouseInteraction& interaction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); UpdateMouseOver(manipulatorId); OnMouseOverImpl(manipulatorId, interaction); @@ -125,7 +125,7 @@ namespace AzToolsFramework void BaseManipulator::OnMouseMove(const ViewportInteraction::MouseInteraction& interaction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_performingAction) { @@ -142,7 +142,7 @@ namespace AzToolsFramework void BaseManipulator::SetBoundsDirty() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SetBoundsDirtyImpl(); } @@ -190,7 +190,7 @@ namespace AzToolsFramework void BaseManipulator::EndAction() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_performingAction) { @@ -235,7 +235,7 @@ namespace AzToolsFramework void BaseManipulator::NotifyEntityComponentPropertyChanged() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (const AZ::EntityComponentIdPair& entityComponentIdPair : m_entityComponentIdPairs) { @@ -268,7 +268,7 @@ namespace AzToolsFramework AZStd::unordered_set::iterator BaseManipulator::RemoveEntityId(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto afterErased = m_entityComponentIdPairs.end(); @@ -297,7 +297,7 @@ namespace AzToolsFramework AZStd::unordered_set::iterator BaseManipulator::RemoveEntityComponentIdPair( const AZ::EntityComponentIdPair& entityComponentIdPair) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto entityIdIt = m_entityComponentIdPairs.find(entityComponentIdPair); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/EditorVertexSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/EditorVertexSelection.cpp index fa4fb9ad31..f49df5d029 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/EditorVertexSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/EditorVertexSelection.cpp @@ -147,7 +147,7 @@ namespace AzToolsFramework const AZ::Vector3& localManipulatorStartPosition, const AZ::Vector3& localManipulatorOffset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // bind FixedVerticesRequestBus for improved performance typename AZ::FixedVerticesRequestBus::BusPtr fixedVertices; @@ -180,7 +180,7 @@ namespace AzToolsFramework template void InitializeVertexLookup(IndexedTranslationManipulator& translationManipulator, const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // bind FixedVerticesRequestBus for improved performance typename AZ::FixedVerticesRequestBus::BusPtr fixedVertices; @@ -210,7 +210,7 @@ namespace AzToolsFramework const Vertex& vertex, size_t vertexIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // if we have a vertex (translation) manipulator active, ensure // it gets removed when clicking on another selection manipulator @@ -342,7 +342,7 @@ namespace AzToolsFramework const EditorBoxSelect& editorBoxSelect, const AZStd::vector>& selectionManipulators) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // refresh selection manipulators and box select data when modifiers change // (switching from additive to subtractive) @@ -481,7 +481,7 @@ namespace AzToolsFramework const TranslationManipulators::Dimensions dimensions, const TranslationManipulatorConfiguratorFn translationManipulatorConfigurator) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_dimensions = dimensions; m_manipulatorManagerId = managerId; @@ -705,7 +705,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::ClearSelected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // if translation manipulator is active, remove it when receiving this event and enable // the hover manipulator bounds again so points can be inserted again @@ -736,7 +736,7 @@ namespace AzToolsFramework void EditorVertexSelectionBase::DisplayEntityViewport( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_editorBoxSelect.DisplayScene(viewportInfo, debugDisplay); @@ -747,7 +747,7 @@ namespace AzToolsFramework void EditorVertexSelectionBase::DisplayViewport2d( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_editorBoxSelect.Display2d(viewportInfo, debugDisplay); } @@ -756,7 +756,7 @@ namespace AzToolsFramework template::value>::type*> void EditorVertexSelectionBase::UpdateManipulatorSpace(const AzFramework::ViewportInfo& viewportInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // check if 'shift' is being held to move to parent space bool worldSpace = false; @@ -803,7 +803,7 @@ namespace AzToolsFramework template void EditorVertexSelectionVariable::DestroySelected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = EditorVertexSelectionBase::GetEntityId(); @@ -855,7 +855,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::SetSelectedPosition(const AZ::Vector3& localPosition) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_translationManipulator) { @@ -884,7 +884,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::RefreshTranslationManipulator() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // bind FixedVerticesRequestBus for improved performance typename AZ::FixedVerticesRequestBus::BusPtr fixedVertices; @@ -915,7 +915,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::RefreshLocal() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // we do not want to refresh our local state while a batch movement is in progress, // even if we have been signalled to do so by a callback @@ -955,7 +955,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::RefreshSpace(const AZ::Transform& worldFromLocal, const AZ::Vector3& nonUniformScale) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto& manipulator : m_selectionManipulators) { @@ -982,7 +982,7 @@ namespace AzToolsFramework template void EditorVertexSelectionBase::SetBoundsDirty() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto& manipulator : m_selectionManipulators) { @@ -1008,7 +1008,7 @@ namespace AzToolsFramework const AZ::EntityComponentIdPair& entityComponentIdPair, const ManipulatorManagerId managerId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); Vertex vertex; bool found = false; @@ -1078,7 +1078,7 @@ namespace AzToolsFramework const ManipulatorManagerId managerId, const size_t vertexIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // setup selection manipulator const AZStd::shared_ptr selectionView = AzToolsFramework::CreateManipulatorViewSphere( @@ -1115,7 +1115,7 @@ namespace AzToolsFramework const ManipulatorManagerId managerId, const size_t vertexIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // setup selection manipulator const AZStd::shared_ptr manipulatorView = AzToolsFramework::CreateManipulatorViewSphere( @@ -1223,7 +1223,7 @@ namespace AzToolsFramework Vertex EditorVertexSelectionVariable::InsertSelectedInPlace( AZStd::vector::VertexLookup>& manipulators) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // utility to calculate the center point of the selected vertices after duplication MidpointCalculator midpointCalculator; @@ -1267,7 +1267,7 @@ namespace AzToolsFramework template void EditorVertexSelectionVariable::DuplicateSelected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch duplicateUndo("Duplicate Vertices"); ScopedUndoBatch::MarkEntityDirty(EditorVertexSelectionBase::GetEntityId()); @@ -1346,7 +1346,7 @@ namespace AzToolsFramework template void InsertVertexAfter(const AZ::EntityComponentIdPair& entityComponentIdPair, const size_t vertexIndex, const Vertex& localPosition) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); size_t size = 0; AZ::VariableVerticesRequestBus::EventResult( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.cpp index e994e8e2cd..b07ac08d87 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.cpp @@ -74,7 +74,7 @@ namespace AzToolsFramework Picking::RegisteredBoundId ManipulatorManager::UpdateBound( const ManipulatorId manipulatorId, const Picking::RegisteredBoundId boundId, const Picking::BoundRequestShapeBase& boundShapeData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (manipulatorId == InvalidManipulatorId) { @@ -124,7 +124,7 @@ namespace AzToolsFramework void ManipulatorManager::RefreshMouseOverState(const ViewportInteraction::MousePick& mousePick) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!Interacting()) { @@ -142,7 +142,7 @@ namespace AzToolsFramework const AzFramework::CameraState& cameraState, const ViewportInteraction::MouseInteraction& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (const auto& pair : m_manipulatorIdToPtrMap) { @@ -155,7 +155,7 @@ namespace AzToolsFramework AZStd::shared_ptr ManipulatorManager::PerformRaycast( const AZ::Vector3& rayOrigin, const AZ::Vector3& rayDirection, float& rayIntersectionDistance) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); Picking::RaySelectInfo raySelection; raySelection.m_origin = rayOrigin; @@ -255,7 +255,7 @@ namespace AzToolsFramework ManipulatorManager::ConsumeMouseMoveResult ManipulatorManager::ConsumeViewportMouseMove( const ViewportInteraction::MouseInteraction& interaction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_activeManipulator) { @@ -279,7 +279,7 @@ namespace AzToolsFramework void ManipulatorManager::OnEntityInfoUpdatedVisibility(const AZ::EntityId entityId, const bool visible) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto& pair : m_manipulatorIdToPtrMap) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index e618a11344..cdb1e9a2ad 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -996,12 +996,12 @@ namespace AzToolsFramework // the full nested hierarchy with what is returned from RetrieveAndSortPrefabEntitiesAndInstances AzToolsFramework::EntityIdSet duplicationSet = AzToolsFramework::GetCulledEntityHierarchy(entityIdsNoLevelInstance); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch("Duplicate Entities"); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "DuplicateEntitiesInInstance::UndoCaptureAndDuplicateEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "DuplicateEntitiesInInstance::UndoCaptureAndDuplicateEntities"); AZStd::vector entities; AZStd::vector instances; @@ -1123,7 +1123,7 @@ namespace AzToolsFramework // Retrieve entityList from entityIds EntityList inputEntityList = EntityIdListToEntityList(entityIdsNoLevelInstance); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch("Delete Selected"); @@ -1145,7 +1145,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities"); Prefab::PrefabDom instanceDomBefore; m_instanceToTemplateInterface->GenerateDomForInstance(instanceDomBefore, commonOwningInstance->get()); @@ -1205,7 +1205,7 @@ namespace AzToolsFramework selCommand->SetParent(undoBatch.GetUndoBatch()); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:RunRedo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:RunRedo"); selCommand->RunRedo(); } @@ -1230,10 +1230,10 @@ namespace AzToolsFramework return AZ::Failure(AZStd::string("Input entity should be its owning Instance's container entity.")); } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DetachPrefab:UndoCapture"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DetachPrefab:UndoCapture"); ScopedUndoBatch undoBatch("Detach Prefab"); @@ -1294,7 +1294,7 @@ namespace AzToolsFramework command->Capture(instanceDomBefore, instanceDomAfter, parentTemplateId); command->SetParent(undoBatch.GetUndoBatch()); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DetachPrefab:RunRedo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DetachPrefab:RunRedo"); command->RunRedo(); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabUndoCache.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabUndoCache.cpp index 3d22a35858..c83e0857a3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabUndoCache.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabUndoCache.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -111,7 +112,7 @@ namespace AzToolsFramework void PrefabUndoCache::UpdateCache(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Entity* entity = nullptr; AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, entityId); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceCompilation.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceCompilation.cpp index 3c7bab3e77..e9825f6f14 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceCompilation.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceCompilation.cpp @@ -274,7 +274,7 @@ namespace AzToolsFramework */ SliceCompilationResult CompileEditorSlice(const AZ::Data::Asset& sourceSliceAsset, const AZ::PlatformTagSet& platformTags, AZ::SerializeContext& serializeContext, const EditorOnlyEntityHandlers& editorOnlyEntityHandlers) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!sourceSliceAsset) { return AZ::Failure(AZStd::string("Source slice is invalid.")); @@ -657,7 +657,7 @@ namespace AzToolsFramework // tolerate ALL possible input errors (looping parents, invalid IDs, etc). void SortTransformParentsBeforeChildren(AZStd::vector& entities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // IDs of those present in 'entities'. Does not include parent ID if parent not found in 'entities' AZStd::unordered_set existingEntityIds; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp index 15b330c65b..d8b5fe0a15 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceTransaction.cpp @@ -63,7 +63,7 @@ namespace AzToolsFramework void Capture(const SliceTransaction::SliceAssetPtr& before, const SliceTransaction::SliceAssetPtr& after, const char* sliceAssetPath) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_sliceAssetPath = sliceAssetPath; m_isNewAsset = !before.GetId().IsValid(); @@ -74,7 +74,7 @@ namespace AzToolsFramework if (!m_isNewAsset) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveBefore"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveBefore"); AZ::SliceAsset* sliceBefore = before.Get(); AZ::Entity* sliceEntityBefore = sliceBefore->GetEntity(); AZ::IO::ByteContainerStream beforeStream(&m_sliceAssetBeforeBuffer); @@ -82,7 +82,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveAfter"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveAfter"); AZ::SliceAsset* sliceAfter = after.Get(); AZ::Entity* sliceEntityAfter = sliceAfter->GetEntity(); AZ::IO::ByteContainerStream afterStream(&m_sliceAssetAfterBuffer); @@ -105,13 +105,13 @@ namespace AzToolsFramework void Redo() override { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_redoResult = Internal::SaveSliceToDisk(m_sliceAssetPath.c_str(), m_sliceAssetAfterBuffer); } void Undo() override { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_isNewAsset) { // New asset means we didn't have an existing asset, so we should instead remove the newly created asset as our undo @@ -149,7 +149,7 @@ namespace AzToolsFramework AZ::SerializeContext* serializeContext, AZ::u32 sliceCreationFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!serializeContext) { @@ -179,7 +179,7 @@ namespace AzToolsFramework SliceTransaction::TransactionPtr SliceTransaction::BeginSliceOverwrite(const SliceAssetPtr& asset, const AZ::SliceComponent& overwriteComponent, AZ::SerializeContext* serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!serializeContext) { @@ -212,7 +212,7 @@ namespace AzToolsFramework AZ::SerializeContext* serializeContext, AZ::u32 /*slicePushFlags*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!serializeContext) { @@ -515,7 +515,7 @@ namespace AzToolsFramework SliceTransaction::PostSaveCallback postSaveCallback, AZ::u32 sliceCommitFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Clone asset for final modifications and save. // This also releases borrowed entities and slice instances. @@ -702,7 +702,7 @@ namespace AzToolsFramework SliceTransaction::PostSaveCallback postSaveCallback, AZ::u32 sliceCommitFlags) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::string sliceAssetPath; AZ::Data::AssetCatalogRequestBus::BroadcastResult(sliceAssetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, targetAssetId); @@ -762,7 +762,7 @@ namespace AzToolsFramework //========================================================================= SliceTransaction::SliceAssetPtr SliceTransaction::CloneAssetForSave() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Move included slice instances to the target asset temporarily so that they are included in the clone for (auto& addedSliceInstanceIt : m_addedSliceInstances) @@ -868,7 +868,7 @@ namespace AzToolsFramework //========================================================================= SliceTransaction::Result SliceTransaction::PreSave(const char* fullPath, SliceAssetPtr& asset, PreSaveCallback preSaveCallback, AZ::u32 /*sliceCommitFlags*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Remap live Ids back to those of the asset. AZ::EntityUtils::SerializableEntityContainer assetEntities; @@ -904,7 +904,7 @@ namespace AzToolsFramework //========================================================================= AZ::EntityId SliceTransaction::FindTargetAncestorAndUpdateInstanceIdMap(AZ::EntityId entityId, AZ::SliceComponent::EntityIdToEntityIdMap& liveToAssetIdMap, const AZ::SliceComponent::SliceInstanceAddress* ignoreSliceInstance) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::SliceComponent* slice = m_targetAsset.Get()->GetComponent(); @@ -1036,7 +1036,7 @@ namespace AzToolsFramework //========================================================================= SliceTransaction::Result SaveSliceToDisk(const char* targetPath, AZStd::vector& sliceAssetEntityMemoryBuffer, AZ::SerializeContext* serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); AZ_Assert(fileIO, "File IO is not initialized."); @@ -1058,7 +1058,7 @@ namespace AzToolsFramework // Write the in-memory copy to file bool savedToFile; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:SaveToFileStream"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:SaveToFileStream"); memoryStream.Seek(0, AZ::IO::GenericStream::ST_SEEK_BEGIN); savedToFile = fileStream.Write(memoryStream.GetLength(), memoryStream.GetData()->data()) != 0; } @@ -1066,14 +1066,14 @@ namespace AzToolsFramework if (savedToFile) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement"); // Copy scratch file to target location. const bool targetFileExists = fileIO->Exists(targetPath); bool removedTargetFile; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RemoveTarget"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RemoveTarget"); removedTargetFile = fileIO->Remove(targetPath); } @@ -1083,7 +1083,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RenameTempFile"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RenameTempFile"); AZ::IO::Result renameResult = fileIO->Rename(tempFilePath.c_str(), targetPath); if (!renameResult) { @@ -1093,7 +1093,7 @@ namespace AzToolsFramework // Bump the slice asset up in the asset processor's queue. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:GetAssetStatus"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:GetAssetStatus"); EBUS_EVENT(AzFramework::AssetSystemRequestBus, EscalateAssetBySearchTerm, targetPath); } return AZ::Success(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp index 6ef0c83991..02fc2c2c40 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp @@ -405,7 +405,7 @@ namespace AzToolsFramework bool QueryAndPruneMissingExternalReferences(AzToolsFramework::EntityIdSet& entities, AzToolsFramework::EntityIdSet& selectedAndReferencedEntities, bool& useReferencedEntities, bool defaultMoveExternalRefs = false) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences"); useReferencedEntities = false; AZStd::string includedEntities; @@ -440,7 +440,7 @@ namespace AzToolsFramework { if (!defaultMoveExternalRefs) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences:UserDialog"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences:UserDialog"); const AZStd::string message = AZStd::string::format( "Entity references may not be valid if the entity IDs change or if the entities do not exist when the slice is instantiated.\r\n\r\nSelected Entities\n%s\nReferenced Entities\n%s\n", @@ -510,7 +510,7 @@ namespace AzToolsFramework while (true) { { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SaveAsDialog"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SaveAsDialog"); saveAs = QFileDialog::getSaveFileName(nullptr, QString("Save As..."), saveAsInitialSuggestedFullPath.c_str(), QString("Slices (*.slice)")); } @@ -608,7 +608,7 @@ namespace AzToolsFramework bool silenceWarningPopups, AZ::SerializeContext* serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entities.empty()) { @@ -702,7 +702,7 @@ namespace AzToolsFramework { if (inheritSlices) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:CloneExistingSliceEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:CloneExistingSliceEntities"); const AZ::EntityId dummyParentId; @@ -801,14 +801,14 @@ namespace AzToolsFramework // Setup and execute transaction for the new slice. // { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction"); // PreSaveCallback for slice creation: Before saving slice, we ensure it has a single root by optionally auto-creating one for the user SliceTransaction::PreSaveCallback preSaveCallback = [&sliceName, &sliceRootEntityPosition, &sliceRootEntityRotation, &activeWindow, &defaultGenerateSharedRoot] (SliceTransaction::TransactionPtr transaction, const char* fullPath, SliceTransaction::SliceAssetPtr& asset) -> SliceTransaction::Result { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:PreSaveCallback"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:PreSaveCallback"); AZ::SliceComponent::EntityIdToEntityIdMap assetToLiveEntityIDMap; const AZ::SliceComponent::EntityIdToEntityIdMap& liveToAssetEntityIDMap = transaction->GetLiveToAssetEntityIdMap(); @@ -855,7 +855,7 @@ namespace AzToolsFramework // Add entities { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction:AddEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction:AddEntities"); for (const AZ::EntityId& entityId : entitiesToIncludeInAsset) { SliceTransaction::Result addResult = transaction->AddEntity(entityId, !inheritSlices ? SliceTransaction::SliceAddEntityFlags::DiscardSliceAncestry : 0); @@ -914,7 +914,7 @@ namespace AzToolsFramework void GatherAllReferencedEntities(AzToolsFramework::EntityIdSet& entitiesWithReferences, AZ::SerializeContext& serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::vector floodQueue; floodQueue.reserve(entitiesWithReferences.size()); @@ -1038,7 +1038,7 @@ namespace AzToolsFramework const AZ::SliceComponent::SliceInstance& instance, AZ::SerializeContext& serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(instance.GetEntityIdMap().find(sourceEntity.GetId()) != instance.GetEntityIdMap().end(), "Provided source entity is not a member of the provided slice instance."); @@ -1494,7 +1494,7 @@ namespace AzToolsFramework //========================================================================= SliceTransaction::Result SlicePreSaveCallbackForWorldEntities(SliceTransaction::TransactionPtr transaction, const char* fullPath, SliceTransaction::SliceAssetPtr& asset) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::SlicePreSaveCallbackForWorldEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::SlicePreSaveCallbackForWorldEntities"); // Apply standard root transform rules. Zero out root entity translation, ensure single root, ensure slice root has no parent in slice. SliceTransaction::Result worldTransformRulesResult = VerifyAndApplySliceWorldTransformRules(asset); @@ -1536,7 +1536,7 @@ namespace AzToolsFramework void SlicePostSaveCallbackForNewSlice(SliceTransaction::TransactionPtr transaction, const char* fullPath, const SliceTransaction::SliceAssetPtr& transactionAsset) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::SlicePostSaveCallbackForNewSlice"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::SlicePostSaveCallbackForNewSlice"); const char* undoMessage = "Create Slice Asset"; ScopedUndoBatch undoBatch(undoMessage); @@ -1568,7 +1568,7 @@ namespace AzToolsFramework bool CheckSliceAdditionCyclicDependencySafe(const AZ::SliceComponent::SliceInstanceAddress& instanceToAdd, const AZ::SliceComponent::SliceInstanceAddress& targetInstanceToAddTo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(instanceToAdd.IsValid(), "Invalid instanceToAdd passed to CheckSliceADditionCyclicDependencySafe."); @@ -1706,7 +1706,7 @@ namespace AzToolsFramework void PopulateSliceSubMenus(QMenu& outerMenu, const AzToolsFramework::EntityIdList& inputEntities, SliceSelectedCallback sliceSelectedCallback, SliceSelectedCallback sliceRelationshipViewCallback) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // The find slice menu only works with a single entity selected. if (inputEntities.size() != 1) { @@ -2244,7 +2244,7 @@ namespace AzToolsFramework //========================================================================= bool DoEntitiesHaveOverrides(const AzToolsFramework::EntityIdList& inputEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); @@ -2287,7 +2287,7 @@ namespace AzToolsFramework //========================================================================= bool IsReparentNonTrivial(const AZ::EntityId& entityId, const AZ::EntityId& newParentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::EntityId oldParentId; AZ::TransformBus::EventResult(oldParentId, entityId, &AZ::TransformBus::Events::GetParentId); @@ -2358,7 +2358,7 @@ namespace AzToolsFramework void ReparentNonTrivialSliceInstanceHierarchy(const AZ::EntityId& entityId, const AZ::EntityId& newParentId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::SliceComponent::SliceInstanceEntityIdRemapList subslicesToDetach; AzToolsFramework::EntityIdList entitiesToDetach; @@ -2892,7 +2892,7 @@ namespace AzToolsFramework //========================================================================= void GenerateSuggestedSliceFilenameFromEntities(const AzToolsFramework::EntityIdList& entities, AZStd::string& outName) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Determine suggested save name for slice based on entity names // For example, with entities Entity0, Entity1, and Entity2, we would end up with @@ -2962,7 +2962,7 @@ namespace AzToolsFramework //========================================================================= void GenerateSuggestedSlicePath(const AZStd::string& sliceName, const AZStd::string& targetDirectory, AZStd::string& suggestedFullPath) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Generate full suggested path from sliceName - if given NewSlice as sliceName, // NewSlice_001.slice would be tried, and if that already existed we would suggest @@ -3079,7 +3079,7 @@ namespace AzToolsFramework QWidget* activeWindow, bool defaultGenerateSharedRoot) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); @@ -3105,7 +3105,7 @@ namespace AzToolsFramework { int response; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::CheckAndAddSliceRoot:SingleRootUserQuery"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::CheckAndAddSliceRoot:SingleRootUserQuery"); response = QMessageBox::warning(activeWindow, QStringLiteral("Cannot Create Slice"), QString("The slice cannot be created because no single transform root is defined. " diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp index 6b897efdf8..cca0071a4d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp @@ -345,7 +345,7 @@ namespace AzToolsFramework EntityList& entityList, AZ::SliceComponent::SliceReferenceToInstancePtrs& layerInstances) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EditorLayer layer; LayerResult layerPrepareResult = PrepareLayerForSaving(layer, entityList, layerInstances); if (!layerPrepareResult.IsSuccess()) @@ -373,7 +373,7 @@ namespace AzToolsFramework AZ::SliceComponent::SliceAssetToSliceInstancePtrs& sliceInstances, AZStd::unordered_map& uniqueEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // If this layer is being loaded, it won't have a level save dependency yet, so clear that flag. m_mustSaveLevelWhenLayerSaves = false; QString fullPathName = levelPakFile; @@ -518,7 +518,7 @@ namespace AzToolsFramework EntityList& entityList, AZ::SliceComponent::SliceReferenceToInstancePtrs& layerInstances) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Move the editable data into the data serialized to the layer, and not the layer component. layer.m_layerProperties = m_editableLayerProperties; layer.m_layerEntityId = GetEntityId(); @@ -640,7 +640,7 @@ namespace AzToolsFramework const EditorLayer& layer, AZ::IO::ByteContainerStream >& entitySaveStream) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_otherLayersToSave.clear(); m_mustSaveLevelWhenLayerSaves = false; @@ -662,7 +662,7 @@ namespace AzToolsFramework QString levelAbsoluteFolder, const AZ::IO::ByteContainerStream >& entitySaveStream) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::string layerBaseFileName(m_layerFileName); // Write to a temp file first. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.cpp index ff9eb025d7..56b0177e94 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.cpp @@ -68,7 +68,7 @@ namespace AzToolsFramework AZStd::function accentRefreshCallback = [this]() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorSelectionAccentSystemComponent::QueueAccentRefresh:AccentRefreshCallback"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EditorSelectionAccentSystemComponent::QueueAccentRefresh:AccentRefreshCallback"); InvalidateAccents(); RecalculateAndApplyAccents(); m_isAccentRefreshQueued = false; @@ -79,14 +79,14 @@ namespace AzToolsFramework void EditorSelectionAccentSystemComponent::ForceSelectionAccentRefresh() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); InvalidateAccents(); RecalculateAndApplyAccents(); } void EditorSelectionAccentSystemComponent::InvalidateAccents() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (const AZ::EntityId& accentedEntity : m_currentlyAccentedEntities) { AzToolsFramework::ComponentEntityEditorRequestBus::Event(accentedEntity, &AzToolsFramework::ComponentEntityEditorRequests::SetSandboxObjectAccent, ComponentEntityAccentType::None); @@ -96,7 +96,7 @@ namespace AzToolsFramework void EditorSelectionAccentSystemComponent::RecalculateAndApplyAccents() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityIdList selectedEntities; AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); AzToolsFramework::EntityIdSet selectedEntitiesSet; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteUtil.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteUtil.cpp index 3ccb4065bf..6f3727bdb4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteUtil.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteUtil.cpp @@ -121,7 +121,7 @@ namespace AzToolsFramework ComponentDataTable &componentDataTable, ComponentIconTable &componentIconTable) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); serializeContext->EnumerateDerived( [&](const AZ::SerializeContext::ClassData* componentClass, const AZ::Uuid& knownType) -> bool { @@ -179,7 +179,7 @@ namespace AzToolsFramework const AZStd::vector& incompatibleServiceFilter ) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); bool containsEditable = false; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteWidget.cpp index afa7edc565..67598f9fca 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/ComponentPalette/ComponentPaletteWidget.cpp @@ -130,7 +130,7 @@ namespace AzToolsFramework void ComponentPaletteWidget::UpdateContent() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_componentModel->clear(); bool applyRegExFilter = !m_searchRegExp.isEmpty(); @@ -321,7 +321,7 @@ namespace AzToolsFramework void ComponentPaletteWidget::UpdateSearch() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_searchRegExp = QRegExp(m_searchText->text(), Qt::CaseInsensitive, QRegExp::RegExp); m_searchText->setFocus(); UpdateContent(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index 4115fe409e..806170df6f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -936,7 +936,7 @@ namespace AzToolsFramework bool EntityOutlinerListModel::CanReparentEntities(const AZ::EntityId& newParentId, const EntityIdList &selectedEntityIds) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (selectedEntityIds.empty()) { return false; @@ -1025,7 +1025,7 @@ namespace AzToolsFramework bool EntityOutlinerListModel::ReparentEntities(const AZ::EntityId& newParentId, const EntityIdList &selectedEntityIds, const AZ::EntityId& beforeEntityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!CanReparentEntities(newParentId, selectedEntityIds)) { return false; @@ -1105,7 +1105,7 @@ namespace AzToolsFramework QMimeData* EntityOutlinerListModel::mimeData(const QModelIndexList& indexes) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::TypeId uuid1 = AZ::AzTypeInfo::Uuid(); AZ::TypeId uuid2 = AZ::AzTypeInfo::Uuid(); @@ -1195,7 +1195,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::ProcessEntityUpdates() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); m_entityChangeQueued = false; if (m_layoutResetQueued) { @@ -1203,7 +1203,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ExpandQueue"); + AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ExpandQueue"); for (auto entityId : m_entityExpandQueue) { emit ExpandEntity(entityId, IsExpanded(entityId)); @@ -1212,7 +1212,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:SelectQueue"); + AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:SelectQueue"); for (auto entityId : m_entitySelectQueue) { emit SelectEntity(entityId, IsSelected(entityId)); @@ -1222,7 +1222,7 @@ namespace AzToolsFramework if (!m_entityChangeQueue.empty()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ChangeQueue"); + AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ChangeQueue"); // its faster to just do a bulk data change than to carefully pick out indices // so we'll just merge all ranges into a single range rather than try to make gaps @@ -1255,7 +1255,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:LayoutChanged"); + AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:LayoutChanged"); if (m_entityLayoutQueued) { emit layoutAboutToBeChanged(); @@ -1265,7 +1265,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:InvalidateFilter"); + AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:InvalidateFilter"); if (m_isFilterDirty) { InvalidateFilter(); @@ -1288,7 +1288,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::ProcessEntityInfoResetEnd() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_layoutResetQueued = false; m_entityChangeQueued = false; m_entityChangeQueue.clear(); @@ -1309,7 +1309,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId parentId, AZ::EntityId childId) { (void)parentId; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); endInsertRows(); //expand ancestors if a new descendant is already selected @@ -1347,7 +1347,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::OnEntityInfoUpdatedRemoveChildEnd(AZ::EntityId parentId, AZ::EntityId childId) { (void)childId; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); endResetModel(); @@ -1366,7 +1366,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::OnEntityInfoUpdatedOrderEnd(AZ::EntityId parentId, AZ::EntityId childId, AZ::u64 index) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); (void)index; m_entityLayoutQueued = true; QueueEntityUpdate(parentId); @@ -1425,7 +1425,7 @@ namespace AzToolsFramework QModelIndex EntityOutlinerListModel::GetIndexFromEntity(const AZ::EntityId& entityId, int column) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityId.IsValid()) { @@ -1587,7 +1587,7 @@ namespace AzToolsFramework void EntityOutlinerListModel::ExpandAncestors(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //typically to reveal selected entities, expand all parent entities if (entityId.IsValid()) { @@ -1792,7 +1792,7 @@ namespace AzToolsFramework bool EntityOutlinerListModel::AreAllDescendantsSameLockState(const AZ::EntityId& entityId) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies bool isLocked = false; EditorEntityInfoRequestBus::EventResult(isLocked, entityId, &EditorEntityInfoRequestBus::Events::IsJustThisEntityLocked); @@ -1813,7 +1813,7 @@ namespace AzToolsFramework bool EntityOutlinerListModel::AreAllDescendantsSameVisibleState(const AZ::EntityId& entityId) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); //TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies bool isVisible = IsEntitySetToBeVisible(entityId); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index c6d3c2f28f..4db235d073 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -98,7 +98,7 @@ namespace void SortEntityChildren(AZ::EntityId entityId, const EntityIdCompareFunc& comparer, AzToolsFramework::EntityOrderArray* newEntityOrder = nullptr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityOrderArray entityOrderArray = AzToolsFramework::GetEntityChildOrder(entityId); AZStd::sort(entityOrderArray.begin(), entityOrderArray.end(), comparer); @@ -112,7 +112,7 @@ namespace void SortEntityChildrenRecursively(AZ::EntityId entityId, const EntityIdCompareFunc& comparer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EntityOrderArray entityOrderArray; SortEntityChildren(entityId, comparer, &entityOrderArray); @@ -325,7 +325,7 @@ namespace AzToolsFramework return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EntityIdList newlySelected; ExtractEntityIdsFromSelection(selected, newlySelected); @@ -472,7 +472,7 @@ namespace AzToolsFramework { if (m_selectionChangeQueued) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_selectionChangeInProgress = true; @@ -480,7 +480,7 @@ namespace AzToolsFramework { // Calling Deselect for a large number of items is very slow, // use a single ClearAndSelect call instead. - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect"); EntityIdList selectedEntities; ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::Bus::Events::GetSelectedEntities); @@ -491,12 +491,12 @@ namespace AzToolsFramework else { { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Deselect"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Deselect"); m_gui->m_objectTree->selectionModel()->select( BuildSelectionFromEntities(m_entitiesToDeselect), QItemSelectionModel::Deselect); } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Select"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Select"); m_gui->m_objectTree->selectionModel()->select( BuildSelectionFromEntities(m_entitiesToSelect), QItemSelectionModel::Select); } @@ -519,7 +519,7 @@ namespace AzToolsFramework template QItemSelection EntityOutlinerWidget::BuildSelectionFromEntities(const EntityIdCollection& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); QItemSelection selection; for (const auto& entityId : entityIds) @@ -539,7 +539,7 @@ namespace AzToolsFramework void EntityOutlinerWidget::OnOpenTreeContextMenu(const QPoint& pos) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); bool isDocumentOpen = false; EBUS_EVENT_RESULT(isDocumentOpen, EditorRequests::Bus, IsLevelDocumentOpen); @@ -1057,7 +1057,7 @@ namespace AzToolsFramework void EntityOutlinerWidget::OnSearchTextChanged(const QString& activeTextFilter) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::string filterString = activeTextFilter.toUtf8().data(); m_listModel->SearchStringChanged(filterString); @@ -1168,7 +1168,7 @@ namespace AzToolsFramework void EntityOutlinerWidget::SortContent() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_sortContentQueued = false; @@ -1204,7 +1204,7 @@ namespace AzToolsFramework if (sortMode != EntityOutliner::DisplaySortMode::Manually) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto comparer = AZStd::bind(&CompareEntitiesForSorting, AZStd::placeholders::_1, AZStd::placeholders::_2, sortMode); SortEntityChildrenRecursively(AZ::EntityId(), comparer); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index 9f75abb32a..c17b96411e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -434,7 +434,7 @@ namespace AzToolsFramework void PrefabIntegrationManager::GenerateSuggestedFilenameFromEntities(const EntityIdList& entityIds, AZStd::string& outName) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::string suggestedName; @@ -515,7 +515,7 @@ namespace AzToolsFramework while (true) { { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); saveAs = QFileDialog::getSaveFileName(nullptr, QString("Save As..."), saveAsInitialSuggestedFullPath.c_str(), QString("Prefabs (*.prefab)")); } @@ -851,7 +851,7 @@ namespace AzToolsFramework void PrefabIntegrationManager::GatherAllReferencedEntities(EntityIdSet& entitiesWithReferences, AZ::SerializeContext& serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::vector floodQueue; floodQueue.reserve(entitiesWithReferences.size()); @@ -943,7 +943,7 @@ namespace AzToolsFramework bool PrefabIntegrationManager::QueryAndPruneMissingExternalReferences(EntityIdSet& entities, EntityIdSet& selectedAndReferencedEntities, bool& useReferencedEntities, bool defaultMoveExternalRefs) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); useReferencedEntities = false; AZStd::string includedEntities; @@ -978,7 +978,7 @@ namespace AzToolsFramework { if (!defaultMoveExternalRefs) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZStd::string message = AZStd::string::format( "Entity references may not be valid if the entity IDs change or if the entities do not exist when the prefab is instantiated.\r\n\r\nSelected Entities\n%s\nReferenced Entities\n%s\n", diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ComponentEditor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ComponentEditor.cpp index 5fa8e9adbe..fbbf55d0ad 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ComponentEditor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ComponentEditor.cpp @@ -527,7 +527,7 @@ namespace AzToolsFramework void ComponentEditor::SetComponentOverridden(const bool overridden) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto entityId = m_components[0]->GetEntityId(); AZ::SliceComponent::SliceInstanceAddress sliceInstanceAddress; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp index 2c46bb2d26..ec09275703 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp @@ -699,7 +699,7 @@ namespace AzToolsFramework void EntityPropertyEditor::BeforeEntitySelectionChanged() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (IsLockedToSpecificEntities()) { return; @@ -723,7 +723,7 @@ namespace AzToolsFramework const AzToolsFramework::EntityIdList& newlySelectedEntities, const AzToolsFramework::EntityIdList& newlyDeselectedEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (IsLockedToSpecificEntities()) { // ensure we refresh all entity property editors when @@ -951,7 +951,7 @@ namespace AzToolsFramework EntityPropertyEditor::SelectionEntityTypeInfo EntityPropertyEditor::GetSelectionEntityTypeInfo(const EntityIdList& selection) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SelectionEntityTypeInfo result = SelectionEntityTypeInfo::None; InspectorLayout layout = GetCurrentInspectorLayout(); @@ -1069,7 +1069,7 @@ namespace AzToolsFramework void EntityPropertyEditor::UpdateContents() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); setUpdatesEnabled(false); m_isBuildingProperties = true; @@ -1921,7 +1921,7 @@ namespace AzToolsFramework void EntityPropertyEditor::QueuePropertyRefresh() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_isAlreadyQueuedRefresh) { m_isAlreadyQueuedRefresh = true; @@ -3234,7 +3234,7 @@ namespace AzToolsFramework void EntityPropertyEditor::UpdateActions() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_disabled) { @@ -3282,7 +3282,7 @@ namespace AzToolsFramework // Even though this causes two loops on the selected entity list, calling GetSelectionEntityTypeInfo avoids duplicating code. SelectionEntityTypeInfo selectionTypeInfo; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityPropertyEditor::UpdateActions GetSelectionEntityTypeInfo"); + AZ_PROFILE_SCOPE(AzToolsFramework, "EntityPropertyEditor::UpdateActions GetSelectionEntityTypeInfo"); selectionTypeInfo = GetSelectionEntityTypeInfo(m_selectedEntityIds); } m_actionToAddComponents->setEnabled(CanAddComponentsToSelection(selectionTypeInfo)); @@ -3907,7 +3907,7 @@ namespace AzToolsFramework void EntityPropertyEditor::ClearComponentEditorDragging() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto componentEditor : m_componentEditors) { componentEditor->SetDragged(false); @@ -3918,7 +3918,7 @@ namespace AzToolsFramework void EntityPropertyEditor::ClearComponentEditorSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto componentEditor : m_componentEditors) { componentEditor->SetSelected(false); @@ -4043,7 +4043,7 @@ namespace AzToolsFramework void EntityPropertyEditor::UpdateSelectionCache() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_selectedComponentEditors.clear(); m_selectedComponentEditors.reserve(m_componentEditors.size()); for (auto componentEditor : m_componentEditors) @@ -4070,7 +4070,7 @@ namespace AzToolsFramework void EntityPropertyEditor::SaveComponentEditorState() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // SaveComponentEditorState can be called when adding or removing a // component, the components list stored by the component editor @@ -5584,14 +5584,14 @@ namespace AzToolsFramework void EntityPropertyEditor::ConnectToEntityBuses(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EditorInspectorComponentNotificationBus::MultiHandler::BusConnect(entityId); AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler::BusConnect(entityId); } void EntityPropertyEditor::DisconnectFromEntityBuses(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::EditorInspectorComponentNotificationBus::MultiHandler::BusDisconnect(entityId); AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler::BusDisconnect(entityId); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.cpp index 2e697a7398..fccabbf205 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.cpp @@ -603,7 +603,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- void InstanceDataHierarchy::Build(AZ::SerializeContext* sc, unsigned int accessFlags, DynamicEditDataProvider dynamicEditDataProvider, ComponentEditor* editorParent) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(sc, "sc can't be NULL!"); AZ_Assert(m_rootInstances.size() > 0, "No root instances have been added to this hierarchy!"); @@ -761,7 +761,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- void InstanceDataHierarchy::FixupEditData(InstanceDataNode* node, int siblingIdx) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); bool mergeElementEditData = node->m_classElement && node->m_classElement->m_editData && node->GetElementEditMetadata() != node->m_classElement->m_editData; bool mergeContainerEditData = node->m_parent && node->m_parent->m_classData->m_container && node->m_parent->GetElementEditMetadata() && (node->m_classElement->m_flags & AZ::SerializeContext::ClassElement::FLG_POINTER) == 0; @@ -915,7 +915,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- bool InstanceDataHierarchy::BeginNode(void* ptr, const AZ::SerializeContext::ClassData* classData, const AZ::SerializeContext::ClassElement* classElement, DynamicEditDataProvider dynamicEditDataProvider) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::Edit::ElementData* elementEditData = nullptr; @@ -1140,7 +1140,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- bool InstanceDataHierarchy::EndNode() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ_Assert(m_curParentNode, "EndEnum called without a matching BeginNode call!"); @@ -1177,7 +1177,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- bool InstanceDataHierarchy::RefreshComparisonData(unsigned int accessFlags, DynamicEditDataProvider dynamicEditDataProvider) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_root || m_comparisonInstances.empty()) { @@ -1438,7 +1438,7 @@ namespace AzToolsFramework RemovedNodeCB removedNodeCallback, ChangedNodeCB changedNodeCallback) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); targetNode->m_comparisonNode = sourceNode; @@ -1582,7 +1582,7 @@ namespace AzToolsFramework ContainerChildNodeBeingCreatedCB containerChildNodeBeingCreatedCB, const InstanceDataNode::Address& filterElementAddress) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!context) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h index 3c72e8bc9c..415a87f984 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h @@ -161,7 +161,7 @@ namespace AzToolsFramework virtual void ReadValuesIntoGUI_Internal(QWidget* widget, InstanceDataNode* node) override { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (size_t i = 0; i < node->GetNumInstances(); ++i) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h index 15506c1a50..8b53121776 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI_Internals.h @@ -15,6 +15,7 @@ // A user is expected to derive from PropertyHandler // and implement that interface, then register it with the property manager. +#include #include #include #include @@ -257,7 +258,7 @@ namespace AzToolsFramework virtual void ReadValuesIntoGUI_Internal(QWidget* widget, InstanceDataNode* node) override { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WidgetType* wid = static_cast(widget); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorApi.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorApi.cpp index 8693ca2d48..096fb6c7c1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorApi.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyEditorApi.cpp @@ -98,7 +98,7 @@ namespace AzToolsFramework //----------------------------------------------------------------------------- NodeDisplayVisibility CalculateNodeDisplayVisibility(const InstanceDataNode& node, bool isSlicePushUI) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); NodeDisplayVisibility visibility = NodeDisplayVisibility::NotVisible; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp index 604c6141d7..44e71daf71 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp @@ -458,7 +458,7 @@ namespace AzToolsFramework void PropertyRowWidget::OnValuesUpdated() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_sourceNode) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.cpp index 5d5b00e83d..87df1eff1b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.cpp @@ -1038,12 +1038,12 @@ namespace AzToolsFramework void ReflectedPropertyEditor::InvalidateValues() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_releasePrompt = true; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:InstancesRefreshDataCompare"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:InstancesRefreshDataCompare"); for (InstanceDataHierarchy& instance : m_impl->m_instances) { const bool dataIdentical = instance.RefreshComparisonData( @@ -1057,7 +1057,7 @@ namespace AzToolsFramework } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:RowWidgetGuiUpdate"); + AZ_PROFILE_SCOPE(AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:RowWidgetGuiUpdate"); for (auto it = m_impl->m_userWidgetsToData.begin(); it != m_impl->m_userWidgetsToData.end(); ++it) { auto rowWidget = m_impl->m_widgets.find(it->second); @@ -2294,7 +2294,7 @@ namespace AzToolsFramework void ReflectedPropertyEditor::DoRefresh() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_impl->m_preventRefresh || (m_impl->m_queuedRefreshLevel == Refresh_None)) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/EditorContextMenu.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/EditorContextMenu.cpp index b2c378181e..ff13bce531 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/EditorContextMenu.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/EditorContextMenu.cpp @@ -23,7 +23,7 @@ namespace AzToolsFramework { void EditorContextMenuUpdate(EditorContextMenu& contextMenu, const ViewportInteraction::MouseInteractionEvent& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // could potentially show the context menu if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Right() && diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp index d4d53c5907..c39b2c0ebc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp @@ -22,7 +22,7 @@ namespace AzToolsFramework void EditorBoxSelect::HandleMouseInteraction( const ViewportInteraction::MouseInteractionEvent& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_cursorState.SetCurrentPosition(mouseInteraction.m_mouseInteraction.m_mousePick.m_screenCoordinates); @@ -74,7 +74,7 @@ namespace AzToolsFramework void EditorBoxSelect::Display2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_cursorState.Update(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp index 304a4df31f..7abff230e3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp @@ -64,7 +64,7 @@ namespace AzToolsFramework // note: this is mostly likely distance from the camera static float GetIconScale(const float distSq) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return s_iconMinScale + (s_iconMaxScale - s_iconMinScale) * @@ -74,7 +74,7 @@ namespace AzToolsFramework static void DisplayComponents( const AZ::EntityId entityId, const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::Entity* entity = AZ::Interface::Get()->FindEntity(entityId); AzFramework::EntityDebugDisplayEventBus::Event( @@ -114,7 +114,7 @@ namespace AzToolsFramework AZ::EntityId EditorHelpers::HandleMouseInteraction( const AzFramework::CameraState& cameraState, const ViewportInteraction::MouseInteractionEvent& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const int viewportId = mouseInteraction.m_mouseInteraction.m_interactionId.m_viewportId; @@ -185,7 +185,7 @@ namespace AzToolsFramework AzFramework::DebugDisplayRequests& debugDisplay, const AZStd::function& showIconCheck) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (HelpersVisible()) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp index 696cf6b184..7002436d13 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorInteractionSystemComponent.cpp @@ -85,7 +85,7 @@ namespace AzToolsFramework void EditorInteractionSystemComponent::DisplayViewport( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // calculate which entities are in the view and can be interacted with // and cache that data to make iterating/looking it up much faster diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp index 7cd0170989..ea1bc73056 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorPickEntitySelection.cpp @@ -37,7 +37,7 @@ namespace AzToolsFramework static void HandleAccents( const AZ::EntityId entityIdUnderCursor, AZ::EntityId& hoveredEntityId, const ViewportInteraction::MouseButtons mouseButtons) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const bool invalidMouseButtonHeld = mouseButtons.Middle() || mouseButtons.Right(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorSelectionUtil.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorSelectionUtil.cpp index 8e08dc9d97..7cb0e718a8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorSelectionUtil.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorSelectionUtil.cpp @@ -50,7 +50,7 @@ namespace AzToolsFramework AzFramework::ScreenPoint GetScreenPosition(const int viewportId, const AZ::Vector3& worldTranslation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto screenPosition = AzFramework::ScreenPoint(0, 0); ViewportInteraction::ViewportInteractionRequestBus::EventResult( @@ -62,7 +62,7 @@ namespace AzToolsFramework bool AabbIntersectMouseRay(const ViewportInteraction::MouseInteraction& mouseInteraction, const AZ::Aabb& aabb) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::Vector3 rayScaledDir = mouseInteraction.m_mousePick.m_rayDirection * s_pickRayLength; @@ -78,7 +78,7 @@ namespace AzToolsFramework float& closestDistance, const int viewportId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool entityPicked = false; EditorComponentSelectionRequestsBus::EnumerateHandlersId( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index b05dfd0676..d315243697 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -276,7 +276,7 @@ namespace AzToolsFramework static void DestroyManipulators(EntityIdManipulators& manipulators) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (manipulators.m_manipulators) { @@ -306,7 +306,7 @@ namespace AzToolsFramework { static_assert(AZStd::is_same::value, "Container type is not an EntityId"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return AZStd::vector(entityIdContainer.begin(), entityIdContainer.end()); } @@ -316,7 +316,7 @@ namespace AzToolsFramework { static_assert(AZStd::is_same::value, "Container key type is not an EntityId"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::vector entityIds; entityIds.reserve(entityIdMap.size()); @@ -348,7 +348,7 @@ namespace AzToolsFramework EntitySelectFuncType selectFunc2, Compare outgoingCheck) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (boxSelect->contains(ViewportInteraction::QPointFromScreenPoint(screenPosition))) { @@ -385,7 +385,7 @@ namespace AzToolsFramework const ViewportInteraction::KeyboardModifiers currentKeyboardModifiers, const ViewportInteraction::KeyboardModifiers& previousKeyboardModifiers) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (boxSelect) { @@ -449,7 +449,7 @@ namespace AzToolsFramework static void InitializeTranslationLookup(EntityIdManipulators& entityIdManipulators) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto& entityIdLookup : entityIdManipulators.m_lookups) { @@ -498,7 +498,7 @@ namespace AzToolsFramework // return either center or entity pivot static AZ::Vector3 CalculatePivotTranslation(const AZ::EntityId entityId, const EditorTransformComponentSelectionRequests::Pivot pivot) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Transform worldFromLocal = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult(worldFromLocal, entityId, &AZ::TransformBus::Events::GetWorldTM); @@ -539,7 +539,7 @@ namespace AzToolsFramework { PivotOrientationResult CalculatePivotOrientation(const AZ::EntityId entityId, const ReferenceFrame referenceFrame) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // initialize to world space, no parent PivotOrientationResult result{ AZ::Quaternion::CreateIdentity(), AZ::EntityId() }; @@ -577,7 +577,7 @@ namespace AzToolsFramework template static ETCS::PivotOrientationResult CalculateParentSpace(EntityIdMapIterator begin, EntityIdMapIterator end) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // initialize to world with no parent ETCS::PivotOrientationResult result{ AZ::Quaternion::CreateIdentity(), AZ::EntityId() }; @@ -629,7 +629,7 @@ namespace AzToolsFramework { static_assert(AZStd::is_same::value, "Container key type is not an EntityId"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!entityIdMap.empty()) { @@ -656,7 +656,7 @@ namespace AzToolsFramework { static_assert(AZStd::is_same::value, "Container key type is not an EntityId"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // simple case with one entity if (entityIdMap.size() == 1) @@ -689,7 +689,7 @@ namespace AzToolsFramework AZStd::is_same::value, "Container value type is not an EntityIdManipulators::Lookup"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // start - calculate orientation without considering current overrides/modifications PivotOrientationResult pivot = CalculatePivotOrientationForEntityIds(entityIdMap, referenceFrame); @@ -747,7 +747,7 @@ namespace AzToolsFramework const OptionalFrame& pivotOverrideFrame, const EditorTransformComponentSelectionRequests::Pivot pivot) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return pivotOverrideFrame.m_translationOverride.value_or(CalculatePivotTranslationForEntityIds(entityIdMap, pivot)); } @@ -756,7 +756,7 @@ namespace AzToolsFramework static AZ::Quaternion RecalculateAverageManipulatorOrientation( const EntityIdMap& entityIdMap, const OptionalFrame& pivotOverrideFrame, const ReferenceFrame referenceFrame) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return ETCS::CalculateSelectionPivotOrientation(entityIdMap, pivotOverrideFrame, referenceFrame).m_worldOrientation; } @@ -768,7 +768,7 @@ namespace AzToolsFramework const EditorTransformComponentSelectionRequests::Pivot pivot, const ReferenceFrame referenceFrame) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // return final transform, if we have an override for translation use that, otherwise // use centered translation of selection @@ -825,7 +825,7 @@ namespace AzToolsFramework bool& transformChangedInternally, const AZStd::optional spaceLock) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); entityIdManipulators.m_manipulators->SetLocalPosition(action.LocalPosition()); @@ -914,7 +914,7 @@ namespace AzToolsFramework const ViewportInteraction::MouseButtons mouseButtons, const bool usingBoxSelect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const bool invalidMouseButtonHeld = mouseButtons.Middle() || mouseButtons.Right(); @@ -942,7 +942,7 @@ namespace AzToolsFramework static AZ::Vector3 PickTerrainPosition(const ViewportInteraction::MouseInteraction& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const int viewportId = mouseInteraction.m_interactionId.m_viewportId; // get unsnapped terrain position (world space) @@ -964,14 +964,14 @@ namespace AzToolsFramework template static bool IsEntitySelectedInternal(AZ::EntityId entityId, const EntityIdContainer& selectedEntityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto entityIdIt = selectedEntityIds.find(entityId); return entityIdIt != selectedEntityIds.end(); } static EntityIdTransformMap RecordTransformsBefore(const EntityIdList& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // save initial transforms - this is necessary in cases where entities exist // in a hierarchy. We want to make sure a parent transform does not affect @@ -1202,7 +1202,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::BeginRecordManipulatorCommand() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // we must have an existing parent undo batch active when beginning to record // a manipulator command @@ -1219,7 +1219,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::EndRecordManipulatorCommand() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_manipulatorMoveCommand) { @@ -1245,7 +1245,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CreateTranslationManipulators() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::unique_ptr translationManipulators = AZStd::make_unique( TranslationManipulators::Dimensions::Three, AZ::Transform::CreateIdentity(), AZ::Vector3::CreateOne()); @@ -1372,7 +1372,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CreateRotationManipulators() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::unique_ptr rotationManipulators = AZStd::make_unique(AZ::Transform::CreateIdentity()); @@ -1542,7 +1542,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CreateScaleManipulators() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::unique_ptr scaleManipulators = AZStd::make_unique(AZ::Transform::CreateIdentity()); @@ -1680,7 +1680,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::DeselectEntities() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!UndoRedoOperationInProgress()) { @@ -1708,7 +1708,7 @@ namespace AzToolsFramework bool EditorTransformComponentSelection::SelectDeselect(const AZ::EntityId entityIdUnderCursor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entityIdUnderCursor.IsValid()) { @@ -1760,7 +1760,7 @@ namespace AzToolsFramework bool EditorTransformComponentSelection::HandleMouseInteraction(const ViewportInteraction::MouseInteractionEvent& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); CheckDirtyEntityIds(); @@ -2024,7 +2024,7 @@ namespace AzToolsFramework const QString& statusTip, const T& callback) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); actions.emplace_back(AZStd::make_unique(nullptr)); @@ -2080,11 +2080,11 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RegisterActions() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto lockUnlock = [this](const bool lock) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_lockSelectionUndoRedoDesc); @@ -2122,7 +2122,7 @@ namespace AzToolsFramework const auto showHide = [this](const bool show) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_hideSelectionUndoRedoDesc); @@ -2163,7 +2163,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_L) }, UnlockAll, s_unlockAllTitle, s_unlockAllDesc, []() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_unlockAllUndoRedoDesc); @@ -2180,7 +2180,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H) }, ShowAll, s_showAllTitle, s_showAllDesc, []() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_showAllEntitiesUndoRedoDesc); @@ -2197,7 +2197,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::CTRL + Qt::Key_A) }, SelectAll, s_selectAllTitle, s_selectAllDesc, [this]() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_selectAllEntitiesUndoRedoDesc); @@ -2237,7 +2237,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I) }, InvertSelect, s_invertSelectionTitle, s_invertSelectionDesc, [this]() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_invertSelectionUndoRedoDesc); @@ -2284,7 +2284,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::CTRL + Qt::Key_D) }, DuplicateSelect, s_duplicateTitle, s_duplicateDesc, []() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // Clear Widget selection - Prevents issues caused by cloning entities while a property in the Reflected Property Editor // is being edited. @@ -2309,7 +2309,7 @@ namespace AzToolsFramework m_actions, { QKeySequence(Qt::Key_Delete) }, DeleteSelect, s_deleteTitle, s_deleteDesc, [this]() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_deleteUndoRedoDesc); @@ -2419,7 +2419,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::UnregisterManipulator() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators && m_entityIdManipulators.m_manipulators->Registered()) { @@ -2429,7 +2429,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RegisterManipulator() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators && !m_entityIdManipulators.m_manipulators->Registered()) { @@ -2439,7 +2439,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CreateEntityIdManipulators() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_selectedEntityIds.empty()) { @@ -2469,7 +2469,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RegenerateManipulators() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // note: create/destroy pattern to be addressed DestroyManipulators(m_entityIdManipulators); @@ -2636,7 +2636,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::SnapSelectedEntitiesToWorldGrid(const float gridSize) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZStd::array snapAxes = { AZ::Vector3::CreateAxisX(), AZ::Vector3::CreateAxisY(), AZ::Vector3::CreateAxisZ() }; @@ -2658,7 +2658,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::SetTransformMode(const Mode mode) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (mode == m_mode) { @@ -2725,7 +2725,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::AddEntityToSelection(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_selectedEntityIds.insert(entityId); AZ::TransformNotificationBus::MultiHandler::BusConnect(entityId); @@ -2733,7 +2733,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RemoveEntityFromSelection(const AZ::EntityId entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_selectedEntityIds.erase(entityId); AZ::TransformNotificationBus::MultiHandler::BusDisconnect(entityId); @@ -2746,7 +2746,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::SetSelectedEntities(const EntityIdList& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // we are responsible for updating the current selection m_didSetSelectedEntities = true; @@ -2755,7 +2755,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RefreshManipulators(const RefreshType refreshType) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -2793,7 +2793,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::OverrideManipulatorOrientation(const AZ::Quaternion& orientation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_pivotOverrideFrame.m_orientationOverride = orientation; @@ -2808,7 +2808,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::OverrideManipulatorTranslation(const AZ::Vector3& translation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_pivotOverrideFrame.m_translationOverride = translation; @@ -2821,7 +2821,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::ClearManipulatorTranslationOverride() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -2847,7 +2847,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::ClearManipulatorOrientationOverride() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -2875,7 +2875,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::ToggleCenterPivotSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_pivotMode = TogglePivotMode(m_pivotMode); RefreshManipulators(RefreshType::Translation); } @@ -2883,7 +2883,7 @@ namespace AzToolsFramework template static bool ShouldUpdateEntityTransform(const AZ::EntityId entityId, const EntityIdMap& entityIdMap) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); static_assert(AZStd::is_same::value, "Container key type is not an EntityId"); @@ -2907,7 +2907,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyTranslationToSelectedEntitiesGroup(const AZ::Vector3& translation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_mode != Mode::Translation) { @@ -2963,7 +2963,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyTranslationToSelectedEntitiesIndividual(const AZ::Vector3& translation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_mode != Mode::Translation) { @@ -3008,7 +3008,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualWorld(float scale) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_dittoScaleIndividualWorldUndoRedoDesc); @@ -3042,7 +3042,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualLocal(float scale) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_dittoScaleIndividualLocalUndoRedoDesc); @@ -3061,7 +3061,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyOrientationToSelectedEntitiesIndividual(const AZ::Quaternion& orientation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -3099,7 +3099,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::CopyOrientationToSelectedEntitiesGroup(const AZ::Quaternion& orientation) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -3147,7 +3147,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::ResetOrientationForSelectedEntitiesLocal() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); ScopedUndoBatch undoBatch(s_resetOrientationToParentUndoRedoDesc); for (const auto& entityIdLookup : m_entityIdManipulators.m_lookups) @@ -3166,7 +3166,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::ResetTranslationForSelectedEntitiesLocal() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (m_entityIdManipulators.m_manipulators) { @@ -3236,7 +3236,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::AfterEntitySelectionChanged( [[maybe_unused]] const EntityIdList& newlySelectedEntities, [[maybe_unused]] const EntityIdList& newlyDeselectedEntities) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // EditorTransformComponentSelection was not responsible for the change in selection if (!m_didSetSelectedEntities) @@ -3265,7 +3265,7 @@ namespace AzToolsFramework const float axisLength, const AzFramework::CameraState& cameraState) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const int prevState = display.GetState(); @@ -3318,7 +3318,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::DisplayViewportSelection( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); CheckDirtyEntityIds(); @@ -3536,7 +3536,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::DisplayViewportSelection2d( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); DrawAxisGizmo(viewportInfo, debugDisplay); @@ -3545,7 +3545,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RefreshSelectedEntityIds() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // check what the 'authoritative' selected entity ids are after an undo/redo EntityIdList selectedEntityIds; @@ -3556,7 +3556,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::RefreshSelectedEntityIds(const EntityIdList& selectedEntityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::TransformNotificationBus::MultiHandler::BusDisconnect(); for (const AZ::EntityId& entityId : selectedEntityIds) @@ -3573,7 +3573,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::OnTransformChanged( [[maybe_unused]] const AZ::Transform& localTM, [[maybe_unused]] const AZ::Transform& worldTM) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_transformChangedInternally) { @@ -3583,7 +3583,7 @@ namespace AzToolsFramework void EditorTransformComponentSelection::OnViewportViewEntityChanged(const AZ::EntityId& newViewId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // if a viewport view entity has been set (e.g. we have set EditorCameraComponent to // match the editor camera translation/orientation), record the entity id if we have diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.cpp index f371805997..c65f494b72 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorVisibleEntityDataCache.cpp @@ -157,7 +157,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::CalculateVisibleEntityDatas(const AzFramework::ViewportInfo& viewportInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // request list of visible entities from authoritative system EntityIdList nextVisibleEntityIds; @@ -288,7 +288,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnEntityVisibilityChanged(const bool visibility) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EditorEntityVisibilityNotificationBus::GetCurrentBusId(); @@ -300,7 +300,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnEntityLockChanged(const bool locked) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EditorEntityLockComponentNotificationBus::GetCurrentBusId(); @@ -312,7 +312,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *AZ::TransformNotificationBus::GetCurrentBusId(); @@ -324,7 +324,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnAccentTypeChanged(const EntityAccentType accent) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EditorComponentSelectionNotificationsBus::GetCurrentBusId(); @@ -336,7 +336,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnSelected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EntitySelectionEvents::Bus::GetCurrentBusId(); @@ -348,7 +348,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnDeselected() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EntitySelectionEvents::Bus::GetCurrentBusId(); @@ -360,7 +360,7 @@ namespace AzToolsFramework void EditorVisibleEntityDataCache::OnEntityIconChanged(const AZ::Data::AssetId& /*entityIconAssetId*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::EntityId entityId = *EditorEntityIconComponentNotificationBus::GetCurrentBusId(); diff --git a/Code/Framework/GridMate/GridMate/Replica/Replica.cpp b/Code/Framework/GridMate/GridMate/Replica/Replica.cpp index 5d0949bbe8..c1de3b71f2 100644 --- a/Code/Framework/GridMate/GridMate/Replica/Replica.cpp +++ b/Code/Framework/GridMate/GridMate/Replica/Replica.cpp @@ -40,7 +40,7 @@ namespace GridMate , m_priority(0) , m_revision(1) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); m_upstreamHop = nullptr; m_dirtyHook.m_next = m_dirtyHook.m_prev = nullptr; @@ -86,7 +86,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::PreDestruct() { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); for (auto chunk : m_chunks) { @@ -137,7 +137,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool Replica::AttachReplicaChunk(const ReplicaChunkPtr& chunk) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); // Check for duplicate attach if (!chunk->GetReplica()) @@ -174,7 +174,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool Replica::DetachReplicaChunk(const ReplicaChunkPtr& chunk) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); if (!IsActive()) { @@ -213,7 +213,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::UpdateReplica(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); for (auto chunk : m_chunks) { @@ -226,7 +226,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::UpdateFromReplica(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); for (auto chunk : m_chunks) { @@ -239,7 +239,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool Replica::AcceptChangeOwnership(PeerId requestor, const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); for (auto chunk : m_chunks) { @@ -274,7 +274,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::OnDeactivate(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); EBUS_EVENT_ID(rc.m_rm->GetGridMate(), ReplicaMgrCallbackBus, OnDeactivateReplica, GetRepId(), rc.m_rm); EBUS_EVENT(Debug::ReplicaDrillerBus, OnDeactivateReplica, this); @@ -294,7 +294,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::OnChangeOwnership(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); for (auto chunk : m_chunks) { @@ -319,7 +319,7 @@ namespace GridMate { (void) rpcContext; - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); if (IsActive()) { @@ -382,7 +382,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::Activate(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); // Resolve whether we're migratable or not from the chunks // present when we're attached to the network. @@ -410,7 +410,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::Deactivate(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); if (IsActive()) { @@ -440,7 +440,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool Replica::ProcessRPCs(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); bool isProcessed = true; for (auto chunk : m_chunks) @@ -508,7 +508,7 @@ namespace GridMate //----------------------------------------------------------------------------- PrepareDataResult Replica::PrepareData(EndianType endianType, AZ::u32 marshalFlags) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); PrepareDataResult pdr(false, false, false, false); bool dataSetChange = false; @@ -536,7 +536,7 @@ namespace GridMate //----------------------------------------------------------------------------- void Replica::Marshal(MarshalContext& mc) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); // We are going to replace the outBuffer with a temporary chunk buffer for each chunk, // hold on to the original so we can restore it later and write the chunk buffers into @@ -639,7 +639,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool Replica::Unmarshal(UnmarshalContext& mc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); UnmarshalContext chunkContext(mc); ReadBuffer& buffer = *mc.m_iBuf; @@ -715,7 +715,7 @@ namespace GridMate //----------------------------------------------------------------------------- ReplicaChunkPtr Replica::CreateReplicaChunkFromStream(ReplicaChunkClassId classId, UnmarshalContext& mc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); ReplicaChunkPtr chunk = nullptr; ReplicaChunkDescriptor* pDesc = ReplicaChunkDescriptorTable::Get().FindReplicaChunkDescriptor(classId); diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp b/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp index 07b056d3bb..ee42ff2ad0 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaChunk.cpp @@ -152,7 +152,7 @@ namespace GridMate //----------------------------------------------------------------------------- PrepareDataResult ReplicaChunkBase::PrepareData(EndianType endianType, AZ::u32 marshalFlags) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); PrepareDataResult pdr(false, false, false, false); bool forceDatasetsReliable = !!(marshalFlags & ReplicaMarshalFlags::ForceReliable); @@ -250,7 +250,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool ReplicaChunkBase::ShouldSendToPeer(ReplicaPeer* peer) const { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); // Only send chunks to the same zone as the peer return !!(peer->GetZoneMask() & GetDescriptor()->GetZoneMask()); @@ -258,7 +258,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::Marshal(MarshalContext& mc, AZ::u32 chunkIndex) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); SafeGuardWrite(mc.m_outBuffer, [this, &mc, &chunkIndex]() { @@ -269,7 +269,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::Unmarshal(UnmarshalContext& mc, AZ::u32 chunkIndex) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); SafeGuardRead(mc.m_iBuf, [this, &mc, &chunkIndex]() { @@ -334,7 +334,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::MarshalDataSets(MarshalContext& mc, AZ::u32 chunkIndex) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); AZ::u32 dirtyDataSetMask = CalculateDirtyDataSetMask(mc); AZStd::bitset changebits(dirtyDataSetMask); ReplicaChunkDescriptor* descriptor = GetDescriptor(); @@ -382,7 +382,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::UnmarshalDataSets(UnmarshalContext& mc, AZ::u32 chunkIndex) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); AZStd::bitset changebits; if (!mc.m_iBuf->Read(*changebits.data(), VlqU32Marshaler())) @@ -438,7 +438,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::MarshalRpcs(MarshalContext& mc, AZ::u32 chunkIndex) { - //AZ_PROFILE_TIMER("GridMate"); + //AZ_PROFILE_SCOPE("GridMate"); bool isAuthoritative = (mc.m_marshalFlags & ReplicaMarshalFlags::Authoritative) == ReplicaMarshalFlags::Authoritative; bool isReliable = (mc.m_marshalFlags & ReplicaMarshalFlags::Reliable) == ReplicaMarshalFlags::Reliable; @@ -496,7 +496,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::UnmarshalRpcs(UnmarshalContext& mc, AZ::u32 chunkIndex) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); // Unmarshal RPCs AZ::u32 rpcCount; @@ -629,7 +629,7 @@ namespace GridMate //----------------------------------------------------------------------------- bool ReplicaChunkBase::ProcessRPCs(const ReplicaContext& rc) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); // Process incoming RPCs for (RPCQueue::iterator iRPC = m_rpcQueue.begin(); iRPC != m_rpcQueue.end(); ) @@ -733,7 +733,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::AttachedToReplica(Replica* replica) { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); AZ_Assert(!m_replica, "Should not be attached to a replica"); @@ -748,7 +748,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaChunkBase::DetachedFromReplica() { - AZ_PROFILE_TIMER("GridMate"); + AZ_PROFILE_FUNCTION(GridMate); AZ_Assert(m_replica, "Should be attached to a replica"); EBUS_EVENT(Debug::ReplicaDrillerBus, OnDetachReplicaChunk, this); diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.cpp b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.cpp index b8eea00871..f1b91fa1ad 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.cpp +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.cpp @@ -700,7 +700,7 @@ namespace GridMate { if (IsUsingFixedTimeStep()) { - return static_cast(m_fixedTimeStep.GetCurrentTime()); + return static_cast(m_fixedTimeStep.CurrentTime()); } else { @@ -867,7 +867,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaManager::UpdateFromReplicas() { - AZ_PROFILE_TIMER("GridMate", __FUNCTION__); + AZ_PROFILE_FUNCTION(GridMate); if (!IsInitialized()) { @@ -888,7 +888,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaManager::UpdateReplicas() { - AZ_PROFILE_TIMER("GridMate", __FUNCTION__); + AZ_PROFILE_FUNCTION(GridMate); if (!IsInitialized()) { @@ -940,7 +940,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaManager::Marshal() { - AZ_PROFILE_TIMER("GridMate", __FUNCTION__); + AZ_PROFILE_FUNCTION(GridMate); if (!IsReady()) { @@ -1287,7 +1287,7 @@ namespace GridMate //----------------------------------------------------------------------------- void ReplicaManager::Unmarshal() { - AZ_PROFILE_TIMER("GridMate", __FUNCTION__); + AZ_PROFILE_FUNCTION(GridMate); if (!IsInitialized()) { diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h index bd9f1a1ee9..bedff54939 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaMgr.h @@ -302,7 +302,7 @@ namespace GridMate // this could allow for changing on the fly but it would need to ensure that if it were in the middle of a second, that the new rate would result in landing on the } - AZ::u64 GetCurrentTime() const + AZ::u64 CurrentTime() const { return m_currentTime; } diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaUtils.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaUtils.h index 6833aa9234..8de2abab6e 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaUtils.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaUtils.h @@ -81,7 +81,7 @@ namespace GridMate #define GM_ENABLE_PROFILE_USER_CALLBACKS 1 #if (GM_ENABLE_PROFILE_USER_CALLBACKS) -#define GM_PROFILE_USER_CALLBACK(callback) AZ_PROFILE_TIMER("GridMate User Code", callback); +#define GM_PROFILE_USER_CALLBACK(callback) AZ_PROFILE_SCOPE(GridMate, "GridMate User Code: %s", callback); #else #define GM_PROFILE_USER_CALLBACK(callback) #endif diff --git a/Code/Legacy/CryCommon/FrameProfiler.h b/Code/Legacy/CryCommon/FrameProfiler.h index 12eb6a34a1..ac6d3a52a1 100644 --- a/Code/Legacy/CryCommon/FrameProfiler.h +++ b/Code/Legacy/CryCommon/FrameProfiler.h @@ -43,32 +43,25 @@ enum EProfiledSubsystem }; #undef X -static_assert(static_cast(PROFILE_LAST_SUBSYSTEM) == AZ::Debug::ProfileCategory::LegacyLast, "Mismatched AZ and Legacy profile categories"); #include #define FUNCTION_PROFILER_LEGACYONLY(pISystem, subsystem) -#define FUNCTION_PROFILER(pISystem, subsystem) \ - AZ_PROFILE_FUNCTION(static_cast(subsystem)); +#define FUNCTION_PROFILER(pISystem, subsystem) -#define FUNCTION_PROFILER_FAST(pISystem, subsystem, bProfileEnabled) \ - AZ_PROFILE_FUNCTION(static_cast(subsystem)); +#define FUNCTION_PROFILER_FAST(pISystem, subsystem, bProfileEnabled) -#define FUNCTION_PROFILER_ALWAYS(pISystem, subsystem) \ - AZ_PROFILE_FUNCTION(static_cast(subsystem)); +#define FUNCTION_PROFILER_ALWAYS(pISystem, subsystem) #define FRAME_PROFILER_LEGACYONLY(szProfilerName, pISystem, subsystem) -#define FRAME_PROFILER(szProfilerName, pISystem, subsystem) \ - AZ_PROFILE_SCOPE(static_cast(subsystem), szProfilerName); +#define FRAME_PROFILER(szProfilerName, pISystem, subsystem) -#define FRAME_PROFILER_FAST(szProfilerName, pISystem, subsystem, bProfileEnabled) \ - AZ_PROFILE_SCOPE(static_cast(subsystem), szProfilerName); +#define FRAME_PROFILER_FAST(szProfilerName, pISystem, subsystem, bProfileEnabled) -#define FUNCTION_PROFILER_SYS(subsystem) \ - FUNCTION_PROFILER(gEnv->pSystem, PROFILE_##subsystem) +#define FUNCTION_PROFILER_SYS(subsystem) #define STALL_PROFILER(cause) diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index ff72c2e60f..d8aba337d5 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -1151,10 +1151,10 @@ struct DiskOperationInfo #if defined(ENABLE_LOADING_PROFILER) && AZ_PROFILE_TELEMETRY -#define LOADING_TIME_PROFILE_SECTION AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore) -#define LOADING_TIME_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, __VA_ARGS__) -#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, sectionName) -#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, sectionName, __VA_ARGS__) +#define LOADING_TIME_PROFILE_SECTION AZ_PROFILE_FUNCTION(AzCore) +#define LOADING_TIME_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE(AzCore, __VA_ARGS__) +#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) AZ_PROFILE_SCOPE(AzCore, sectionName) +#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) AZ_PROFILE_SCOPE(AzCore, sectionName, __VA_ARGS__) #else diff --git a/Code/Legacy/CryCommon/LegacyAllocator.h b/Code/Legacy/CryCommon/LegacyAllocator.h index 074c183de4..18af1400d5 100644 --- a/Code/Legacy/CryCommon/LegacyAllocator.h +++ b/Code/Legacy/CryCommon/LegacyAllocator.h @@ -69,7 +69,7 @@ namespace AZ } pointer_type ptr = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord); - AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName()); + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName()); AZ_MEMORY_PROFILE(ProfileAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord)); AZ_Assert(ptr || byteSize == 0, "OOM - Failed to allocate %zu bytes from LegacyAllocator", byteSize); return ptr; @@ -78,7 +78,7 @@ namespace AZ // DeAllocate with file/line, to track when allocs were freed from Cry void DeAllocate(pointer_type ptr, [[maybe_unused]] const char* file, [[maybe_unused]] const int line, size_type byteSize = 0, size_type alignment = 0) { - AZ_PROFILE_MEMORY_FREE_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, ptr); + AZ_PROFILE_MEMORY_FREE_EX(MemoryReserved, file, line, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); m_schema->DeAllocate(ptr, byteSize, alignment); } @@ -94,9 +94,9 @@ namespace AZ } AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); - AZ_PROFILE_MEMORY_FREE_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, ptr); + AZ_PROFILE_MEMORY_FREE_EX(MemoryReserved, file, line, ptr); pointer_type newPtr = m_schema->ReAllocate(ptr, newSize, newAlignment); - AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, newPtr, newSize, "LegacyAllocator Realloc"); + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, file, line, newPtr, newSize, "LegacyAllocator Realloc"); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment)); AZ_Assert(newPtr || newSize == 0, "OOM - Failed to reallocate %zu bytes from LegacyAllocator", newSize); return newPtr; diff --git a/Code/Legacy/CryCommon/platform_impl.cpp b/Code/Legacy/CryCommon/platform_impl.cpp index 4263d813b7..dc8a555286 100644 --- a/Code/Legacy/CryCommon/platform_impl.cpp +++ b/Code/Legacy/CryCommon/platform_impl.cpp @@ -203,7 +203,7 @@ void __stl_debug_message(const char* format_str, ...) ////////////////////////////////////////////////////////////////////////// void CrySleep(unsigned int dwMilliseconds) { - AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); Sleep(dwMilliseconds); } diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 3673088695..d848160b3e 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -701,7 +701,7 @@ void CSystem::SleepIfNeeded() int sleepMS = (int)(1000.0f * sleepTime + 0.5f); if (sleepMS > 0) { - AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); Sleep(sleepMS); } diff --git a/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidget.cpp b/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidget.cpp index 6cec14a9c5..eba43d2e36 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidget.cpp +++ b/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidget.cpp @@ -40,7 +40,7 @@ namespace AZ void ManifestWidget::BuildFromScene(const AZStd::shared_ptr& scene) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); ui->m_tabs->clear(); m_pages.clear(); @@ -80,7 +80,7 @@ namespace AZ bool ManifestWidget::AddObject(const AZStd::shared_ptr& object) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); for (ManifestWidgetPage* page : m_pages) { if (page->SupportsType(object)) diff --git a/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidgetPage.cpp b/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidgetPage.cpp index 118db8217e..cd80b68509 100644 --- a/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidgetPage.cpp +++ b/Code/Tools/SceneAPI/SceneUI/SceneWidgets/ManifestWidgetPage.cpp @@ -76,7 +76,7 @@ namespace AZ bool ManifestWidgetPage::AddObject(const AZStd::shared_ptr& object) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); if (!SupportsType(object)) { return false; @@ -218,7 +218,7 @@ namespace AZ void ManifestWidgetPage::RefreshPage() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor); + AZ_PROFILE_FUNCTION(Editor); m_propertyEditor->InvalidateAll(); m_propertyEditor->ExpandAll(); } diff --git a/Code/Tools/Standalone/Source/Driller/AreaChart.cpp b/Code/Tools/Standalone/Source/Driller/AreaChart.cpp index c672e4414a..fef31aaaf3 100644 --- a/Code/Tools/Standalone/Source/Driller/AreaChart.cpp +++ b/Code/Tools/Standalone/Source/Driller/AreaChart.cpp @@ -231,14 +231,14 @@ namespace AreaChart void AreaChart::AddPoint(size_t seriesId, int position, unsigned int value) { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); LinePoint linePoint(position,value); AddPoint(seriesId,linePoint); } void AreaChart::AddPoint(size_t seriesId, const LinePoint& linePoint) { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!IsValidSeriesId(seriesId)) { AZ_Error("AreaChart", false, "Invalid SeriesId given."); @@ -419,7 +419,7 @@ namespace AreaChart void AreaChart::paintEvent(QPaintEvent* event) { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); (void)event; if (m_sizingDirty) @@ -435,7 +435,7 @@ namespace AreaChart if (m_regenGraph) { - AZ_PROFILE_TIMER("Standalone Tools", "Generating Graph Data"); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_regenGraph = false; if (m_verticalAxis) diff --git a/Code/Tools/Standalone/Source/Driller/Replica/BaseDetailView.h b/Code/Tools/Standalone/Source/Driller/Replica/BaseDetailView.h index 8b7e3f36af..2db8966a2e 100644 --- a/Code/Tools/Standalone/Source/Driller/Replica/BaseDetailView.h +++ b/Code/Tools/Standalone/Source/Driller/Replica/BaseDetailView.h @@ -203,7 +203,7 @@ namespace Driller void RedrawGraph() { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); switch (m_displayMode) { case DisplayMode::Active: @@ -518,7 +518,7 @@ namespace Driller void RefreshView(FrameNumberType frameId) { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::unordered_set< Key > discoveredSet; m_tableViewOrdering.clear(); diff --git a/Code/Tools/Standalone/Source/Driller/Replica/ReplicaDataView.cpp b/Code/Tools/Standalone/Source/Driller/Replica/ReplicaDataView.cpp index e538b47429..be4c7d14ff 100644 --- a/Code/Tools/Standalone/Source/Driller/Replica/ReplicaDataView.cpp +++ b/Code/Tools/Standalone/Source/Driller/Replica/ReplicaDataView.cpp @@ -1628,7 +1628,7 @@ namespace Driller void ReplicaDataView::ParseFrameData(FrameNumberType frameId) { - AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (frameId < 0 || frameId >= m_aggregator->GetFrameCount() || m_parsedFrames.find(frameId) != m_parsedFrames.end()) { return; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h index cb6c742722..fc89abfc9a 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h @@ -73,3 +73,4 @@ namespace ImageProcessingAtom using ImageBuilderRequestBus = AZ::EBus; } // namespace ImageProcessingAtom + diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h index 0d6ac5d959..0df628e9cd 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h @@ -94,3 +94,4 @@ namespace ImageProcessingAtom AZStd::vector> m_assetHandlers; }; }// namespace ImageProcessingAtom + diff --git a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/AuxGeomDrawQueue.cpp b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/AuxGeomDrawQueue.cpp index 7f9bae7e49..214643505a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/AuxGeomDrawQueue.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/AuxGeomDrawQueue.cpp @@ -649,7 +649,7 @@ namespace AZ AZ::u8 width, int32_t viewProjOverrideIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); // grab a mutex lock for the rest of this function so that a commit cannot happen during it and // other threads can't add geometry during it @@ -720,7 +720,7 @@ namespace AZ AZ::u8 width, int32_t viewProjOverrideIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("AuxGeom", "AuxGeomDrawQueue: DrawPrimitiveWithSharedVerticesCommon"); AZ_Assert(indexCount >= verticesPerPrimitiveType && (indexCount % verticesPerPrimitiveType == 0), diff --git a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp index f2b3a93a53..698b7e1e37 100644 --- a/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/AuxGeom/FixedShapeProcessor.cpp @@ -127,7 +127,7 @@ namespace AZ void FixedShapeProcessor::ProcessObjects(const AuxGeomBufferData* bufferData, const RPI::FeatureProcessor::RenderPacket& fpPacket) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("AuxGeom", "FixedShapeProcessor: ProcessObjects"); RHI::DrawPacketBuilder drawPacketBuilder; diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp index bda7e2463b..90fd926b99 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp @@ -145,7 +145,7 @@ namespace AZ void DecalTextureArrayFeatureProcessor::Simulate(const RPI::FeatureProcessor::SimulatePacket& packet) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender) + AZ_PROFILE_FUNCTION(AzRender); AZ_UNUSED(packet); if (m_deviceBufferNeedsUpdate) @@ -159,7 +159,7 @@ namespace AZ void DecalTextureArrayFeatureProcessor::Render(const RPI::FeatureProcessor::RenderPacket& packet) { // Note that decals are rendered as part of the forward shading pipeline. We only need to bind the decal buffers/textures in here. - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender) + AZ_PROFILE_FUNCTION(AzRender); for (const RPI::ViewPtr& view : packet.m_views) { @@ -295,7 +295,7 @@ namespace AZ void DecalTextureArrayFeatureProcessor::SetDecalMaterial(const DecalHandle handle, const AZ::Data::AssetId material) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Renderer); + AZ_PROFILE_FUNCTION(Renderer); if (handle.IsNull()) { AZ_Warning("DecalTextureArrayFeatureProcessor", false, "Invalid handle passed to DecalTextureArrayFeatureProcessor::SetDecalMaterial()."); @@ -365,7 +365,7 @@ namespace AZ void DecalTextureArrayFeatureProcessor::OnAssetReady(const Data::Asset asset) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Renderer); + AZ_PROFILE_FUNCTION(Renderer); const Data::AssetId& assetId = asset->GetId(); const RPI::MaterialAsset* materialAsset = asset.GetAs(); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp index 378e1923f7..543851da0f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp @@ -111,7 +111,7 @@ namespace AZ void DiffuseProbeGridFeatureProcessor::Simulate([[maybe_unused]] const FeatureProcessor::SimulatePacket& packet) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); // update pipeline states if (m_needUpdatePipelineStates) @@ -149,7 +149,7 @@ namespace AZ // if the volumes changed we need to re-sort the probe list if (m_probeGridSortRequired) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "Sort diffuse probe grids"); + AZ_PROFILE_SCOPE(AzRender, "Sort diffuse probe grids"); // sort the probes by descending inner volume size, so the smallest volumes are rendered last auto sortFn = [](AZStd::shared_ptr const& probe1, AZStd::shared_ptr const& probe2) -> bool diff --git a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp index cd781390a3..f87a9b30e9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp @@ -582,7 +582,7 @@ namespace AZ void ImGuiPass::BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("Pass", "ImGuiPass: Execute"); context.GetCommandList()->SetViewport(m_viewportState); @@ -612,7 +612,7 @@ namespace AZ uint32_t ImGuiPass::UpdateImGuiResources() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("Pass", "ImGuiPass: UpdateImGuiResources"); auto imguiContextScope = ImguiContextScope(m_imguiContext); diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 8e2c6f2e9b..58541da92a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -75,7 +75,7 @@ namespace AZ void MeshFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RPI", "MeshFeatureProcessor: Simulate"); AZ_UNUSED(packet); @@ -87,7 +87,7 @@ namespace AZ { const auto jobLambda = [&]() -> void { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "MeshFP::Simulate() Lambda"); + AZ_PROFILE_SCOPE(AzRender, "MeshFP::Simulate() Lambda"); for (auto meshDataIter = iteratorRange.first; meshDataIter != iteratorRange.second; ++meshDataIter) { if (!meshDataIter->m_model) @@ -149,7 +149,7 @@ namespace AZ const MeshHandleDescriptor& descriptor, const MaterialAssignmentMap& materials) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); // 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(); @@ -478,7 +478,7 @@ namespace AZ : m_modelAsset(modelAsset) , m_parent(parent) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!m_modelAsset.GetId().IsValid()) { @@ -507,7 +507,7 @@ namespace AZ //! AssetBus::Handler overrides... void MeshDataInstance::MeshLoader::OnAssetReady(Data::Asset asset) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); Data::Asset modelAsset = asset; // Assign the fully loaded asset back to the mesh handle to not only hold asset id, but the actual data as well. @@ -579,7 +579,7 @@ namespace AZ void MeshDataInstance::Init(Data::Instance model) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); m_model = model; const size_t modelLodCount = m_model->GetLodCount(); @@ -611,7 +611,7 @@ namespace AZ void MeshDataInstance::BuildDrawPacketList(size_t modelLodIndex) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); RPI::ModelLod& modelLod = *m_model->GetLods()[modelLodIndex]; const size_t meshCount = modelLod.GetMeshes().size(); @@ -985,7 +985,7 @@ namespace AZ void MeshDataInstance::UpdateDrawPackets(bool forceUpdate /*= false*/) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); for (auto& drawPacketList : m_drawPacketListsByLod) { for (auto& drawPacket : drawPacketList) @@ -1000,7 +1000,7 @@ namespace AZ void MeshDataInstance::BuildCullable() { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); 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"); @@ -1079,7 +1079,7 @@ namespace AZ void MeshDataInstance::UpdateCullBounds(const TransformServiceFeatureProcessor* transformService) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); 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"); diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp index c0e25e3da9..341d1a0274 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbeFeatureProcessor.cpp @@ -154,7 +154,7 @@ namespace AZ void ReflectionProbeFeatureProcessor::Simulate([[maybe_unused]] const FeatureProcessor::SimulatePacket& packet) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("ReflectionProbe", "ReflectionProbeFeatureProcessor: Simulate"); // update pipeline states @@ -193,7 +193,7 @@ namespace AZ // if the volumes changed we need to re-sort the probe list if (m_probeSortRequired) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "Sort reflection probes"); + AZ_PROFILE_SCOPE(AzRender, "Sort reflection probes"); AZ_ATOM_PROFILE_FUNCTION("ReflectionProbe", "ReflectionProbeFeatureProcessor: Sort reflection probes"); // sort the probes by descending inner volume size, so the smallest volumes are rendered last diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp index ebe52cdafe..0aa72bf2ca 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp @@ -69,13 +69,13 @@ namespace AZ void SkinnedMeshFeatureProcessor::Render(const FeatureProcessor::RenderPacket& packet) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("SkinnedMesh", "SkinnedMeshFeatureProcessor: Render"); #if 0 //[GFX_TODO][ATOM-13564] Temporarily disable skinning culling until we figure out how to hook up visibility & lod selection with skinning: //Setup the culling workgroup (it will be re-used for each view) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "set up skinned culling workgroup"); + AZ_PROFILE_SCOPE(AzRender, "set up skinned culling workgroup"); azsnprintf(m_workgroup.m_name, AZ_ARRAY_SIZE(m_workgroup.m_name), "SkinnedMeshFP workgroup"); m_workgroup.m_drawListMask.reset(); m_workgroup.m_cullPackets.clear(); @@ -118,11 +118,11 @@ namespace AZ Job* processWorkgroupJob = AZ::CreateJobFunction( [this, cullingSystem, viewPtr](AZ::Job& thisJob) { - AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "skinningMeshFP processWorkgroupJob - View: %s", viewPtr->GetName().GetCStr()); + AZ_PROFILE_SCOPE(AzRender, "skinningMeshFP processWorkgroupJob - View: %s", viewPtr->GetName().GetCStr()); auto dispatchSkinningComputeProgramsCallback = [this](AZStd::shared_ptr results) -> void { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "dispatchSkinningComputePrograms"); + AZ_PROFILE_SCOPE(AzRender, "dispatchSkinningComputePrograms"); //the [1][1] element of a projection matrix stores cot(FovY/2) (equal to 2*nearPlaneDistance/nearPlaneHeight), //which is used to determine the (vertical) projected size in screen space diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index af427eb554..58c8b3a4a3 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -532,7 +532,7 @@ namespace AZ // lod0 Positions[^ ^] lod0Normals[^ ^] lod1Positions[^ ^] lod1Normals[^ ^] // lod0 subMesh0+1 Positions[^ ^^ ^] lod0 subMesh0+1 Normals[^ ^^ ^] lod1 sm0+1 pos[^ ^^ ^] lod1 sm0+1 norm[^ ^^ ^] - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZStd::intrusive_ptr instance = aznew SkinnedMeshInstance; // Each model gets a unique, random ID, so if the same source model is used for multiple instances, multiple target models will be created. diff --git a/Gems/Atom/RHI/Code/Source/RHI/AsyncWorkQueue.cpp b/Gems/Atom/RHI/Code/Source/RHI/AsyncWorkQueue.cpp index d74ce558cd..a32301276e 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/AsyncWorkQueue.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/AsyncWorkQueue.cpp @@ -7,6 +7,8 @@ */ #include +#include + namespace AZ { namespace RHI @@ -124,7 +126,7 @@ namespace AZ return; } - AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZStd::unique_lock lock(m_waitWorkItemMutex); m_waitWorkItemCondition.wait(lock, [&]() {return HasFinishedWork(workHandle); }); diff --git a/Gems/Atom/RHI/Code/Source/RHI/CommandQueue.cpp b/Gems/Atom/RHI/Code/Source/RHI/CommandQueue.cpp index ae6a645440..2474967dab 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/CommandQueue.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/CommandQueue.cpp @@ -22,7 +22,7 @@ namespace AZ ResultCode CommandQueue::Init(Device& device, const CommandQueueDescriptor& descriptor) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); #if defined (AZ_RHI_ENABLE_VALIDATION) if (IsInitialized()) @@ -116,7 +116,7 @@ namespace AZ //run a command { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "RHI::CommandQueue - Execute Command"); + AZ_PROFILE_SCOPE(AzRender, "RHI::CommandQueue - Execute Command"); command(GetNativeQueue()); } } diff --git a/Gems/Atom/RHI/Code/Source/RHI/Fence.cpp b/Gems/Atom/RHI/Code/Source/RHI/Fence.cpp index 838beb0863..868d2e3317 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/Fence.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/Fence.cpp @@ -81,7 +81,7 @@ namespace AZ return ResultCode::InvalidOperation; } - AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); WaitOnCpuInternal(); return ResultCode::Success; } diff --git a/Gems/Atom/RHI/Code/Source/RHI/FrameScheduler.cpp b/Gems/Atom/RHI/Code/Source/RHI/FrameScheduler.cpp index 795ab591eb..0793c1ffd0 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/FrameScheduler.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/FrameScheduler.cpp @@ -137,7 +137,7 @@ namespace AZ ResultCode FrameScheduler::ImportScopeProducer(ScopeProducer& scopeProducer) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!ValidateIsProcessing()) { @@ -216,7 +216,7 @@ namespace AZ void FrameScheduler::PrepareProducers() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: PrepareProducers"); for (ScopeProducer* scopeProducer : m_scopeProducers) @@ -237,7 +237,7 @@ namespace AZ void FrameScheduler::CompileProducers() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: CompileProducers"); for (ScopeProducer* scopeProducer : m_scopeProducers) @@ -249,12 +249,12 @@ namespace AZ void FrameScheduler::CompileShaderResourceGroups() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: CompileShaderResourceGroups"); // Execute all queued resource invalidations, which will mark SRG's for compilation. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Invalidate Resources"); + AZ_PROFILE_SCOPE(AzRender, "Invalidate Resources"); ResourceInvalidateBus::ExecuteQueuedEvents(); } @@ -322,7 +322,7 @@ namespace AZ void FrameScheduler::BuildRayTracingShaderTables() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: BuildRayTracingShaderTables"); for (auto rayTracingShaderTable : m_rayTracingShaderTablesToBuild) @@ -341,7 +341,7 @@ namespace AZ ResultCode FrameScheduler::BeginFrame() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: BeginFrame"); if (!ValidateIsInitialized()) @@ -376,7 +376,7 @@ namespace AZ ResultCode FrameScheduler::EndFrame() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: EndFrame"); if (Validation::IsEnabled()) @@ -417,13 +417,13 @@ namespace AZ void FrameScheduler::ExecuteContextInternal(FrameGraphExecuteGroup& group, uint32_t index) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); FrameGraphExecuteContext* executeContext = group.BeginContext(index); { ScopeProducer* scopeProducer = FindScopeProducer(executeContext->GetScopeId()); - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzRender, "ScopeProducer: %s", scopeProducer->GetScopeId().GetCStr()); + AZ_PROFILE_SCOPE(AzRender, "ScopeProducer: %s", scopeProducer->GetScopeId().GetCStr()); scopeProducer->BuildCommandList(*executeContext); } @@ -432,7 +432,7 @@ namespace AZ void FrameScheduler::ExecuteGroupInternal(AZ::Job* parentJob, uint32_t groupIndex) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: ExecuteGroupInternal"); FrameGraphExecuteGroup* executeGroup = m_frameGraphExecuter->BeginGroup(groupIndex); @@ -475,7 +475,7 @@ namespace AZ void FrameScheduler::Execute(JobPolicy overrideJobPolicy) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "FrameScheduler: Execute"); const uint32_t groupCount = m_frameGraphExecuter->GetGroupCount(); diff --git a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp index 0210d941dc..69eee86108 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/PipelineStateCache.cpp @@ -272,7 +272,7 @@ namespace AZ const PipelineState* PipelineStateCache::AcquirePipelineState(PipelineLibraryHandle handle, const PipelineStateDescriptor& descriptor) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (handle.IsNull()) { diff --git a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp index 49244f776f..5e08696ec2 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp @@ -209,11 +209,11 @@ namespace AZ void RHISystem::FrameUpdate(FrameGraphCallback frameGraphCallback) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RHI", "RHISystem: FrameUpdate"); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "main per-frame work"); + AZ_PROFILE_SCOPE(AzRender, "main per-frame work"); m_frameScheduler.BeginFrame(); frameGraphCallback(m_frameScheduler); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.cpp index 70c6aa0b7c..81e52d6d3f 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/AsyncUploadQueue.cpp @@ -152,21 +152,21 @@ namespace AZ m_copyQueue->QueueCommand([=](void* commandQueue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Buffer"); + AZ_PROFILE_SCOPE(AzRender, "Upload Buffer"); size_t pendingByteOffset = 0; size_t pendingByteCount = byteCount; ID3D12CommandQueue* dx12CommandQueue = static_cast(commandQueue); while (pendingByteCount > 0) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Buffer Chunk"); + AZ_PROFILE_SCOPE(AzRender, "Upload Buffer Chunk"); FramePacket* framePacket = BeginFramePacket(); const size_t bytesToCopy = AZStd::min(pendingByteCount, m_descriptor.m_stagingSizeInBytes); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Copy CPU buffer"); + AZ_PROFILE_SCOPE(AzRender, "Copy CPU buffer"); memcpy(framePacket->m_stagingResourceData, sourceData + pendingByteOffset, bytesToCopy); } @@ -196,7 +196,7 @@ namespace AZ AsyncUploadQueue::FramePacket* AsyncUploadQueue::BeginFramePacket() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_Assert(!m_recordingFrame, "The previous frame packet isn't ended"); FramePacket* framePacket = &m_framePackets[m_frameIndex]; @@ -212,7 +212,7 @@ namespace AZ void AsyncUploadQueue::EndFramePacket(ID3D12CommandQueue* commandQueue) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_Assert(m_recordingFrame, "The frame packet wasn't started. You need to call StartFramePacket first."); AssertSuccess(m_commandList->Close()); @@ -229,7 +229,7 @@ namespace AZ // [GFX TODO][ATOM-4205] Stage/Upload 3D streaming images more efficiently. uint64_t AsyncUploadQueue::QueueUpload(const RHI::StreamingImageExpandRequest& request, uint32_t residentMip) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); uint64_t fenceValue = m_uploadFence.Increment(); @@ -243,7 +243,7 @@ namespace AZ m_copyQueue->QueueCommand([=](void* commandQueue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Image"); + AZ_PROFILE_SCOPE(AzRender, "Upload Image"); ID3D12CommandQueue* dx12CommandQueue = static_cast(commandQueue); FramePacket* framePacket = BeginFramePacket(); @@ -314,7 +314,7 @@ namespace AZ // Copy subresource data to staging memory. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Copy CPU image"); + AZ_PROFILE_SCOPE(AzRender, "Copy CPU image"); uint8_t* stagingDataStart = framePacket->m_stagingResourceData + framePacket->m_dataOffset; const uint8_t* subresourceSliceDataStart = static_cast(subresource.m_data) + (depth * subresourceSlicePitch); @@ -385,7 +385,7 @@ namespace AZ // Copy subresource data to staging memory { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Copy CPU image"); + AZ_PROFILE_SCOPE(AzRender, "Copy CPU image"); for (uint32_t row = startRow; row < endRow; row++) { uint8_t* stagingDataStart = framePacket->m_stagingResourceData + framePacket->m_dataOffset; @@ -476,7 +476,7 @@ namespace AZ void AsyncUploadQueue::WaitForUpload(uint64_t fenceValue) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!IsUploadFinished(fenceValue)) { @@ -490,7 +490,7 @@ namespace AZ void AsyncUploadQueue::ProcessCallbacks(uint64_t fenceValue) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZStd::lock_guard lock(m_callbackMutex); while (m_callbacks.size() > 0 && m_callbacks.front().second <= fenceValue) { @@ -504,7 +504,7 @@ namespace AZ { m_copyQueue->QueueCommand([=](void* commandQueue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "QueueTileMapping"); + AZ_PROFILE_SCOPE(AzRender, "QueueTileMapping"); ID3D12CommandQueue* dx12CommandQueue = static_cast(commandQueue); const uint32_t tileCount = request.m_sourceRegionSize.NumTiles; diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp index 7aa9f5391a..a8ae753294 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp @@ -33,7 +33,7 @@ namespace AZ void CommandListBase::Reset(ID3D12CommandAllocator* commandAllocator) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_Assert(m_queuedBarriers.empty(), "Unflushed barriers in command list."); m_commandList->Reset(commandAllocator, nullptr); @@ -95,7 +95,7 @@ namespace AZ { if (m_queuedBarriers.size()) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRenderDetailed); + AZ_PROFILE_FUNCTION(AzRenderDetailed); m_commandList->ResourceBarrier((UINT)m_queuedBarriers.size(), m_queuedBarriers.data()); m_queuedBarriers.clear(); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h index 5337228614..5f3e4dce1e 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h @@ -7,11 +7,15 @@ */ #pragma once +// NOTE: We are careful to include platform headers *before* we include AzCore/Debug/Profiler.h to ensure that d3d12 symbols +// are defined prior to the inclusion of the pix3 runtime. +#include + #include #include +#include #include #include -#include namespace AZ { diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueue.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueue.cpp index 9de706cbe1..b73228e717 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueue.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueue.cpp @@ -110,7 +110,7 @@ namespace AZ { QueueCommand([this, &fence](void* commandQueue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "SignalFence"); + AZ_PROFILE_SCOPE(AzRender, "SignalFence"); ID3D12CommandQueue* dx12CommandQueue = static_cast(commandQueue); dx12CommandQueue->Signal(fence.Get(), fence.GetPendingValue()); }); @@ -138,7 +138,7 @@ namespace AZ QueueCommand([=](void* commandQueue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "ExecuteWork"); + AZ_PROFILE_SCOPE(AzRender, "ExecuteWork"); AZ_PROFILE_RHI_VARIABLE(m_lastExecuteDuration); static const uint32_t CommandListCountMax = 128; @@ -195,7 +195,7 @@ namespace AZ void CommandQueue::UpdateTileMappings(CommandList& commandList) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); for (const CommandList::TileMapRequest& request : commandList.GetTileMapRequests()) { const uint32_t tileCount = request.m_sourceRegionSize.NumTiles; @@ -229,7 +229,7 @@ namespace AZ void CommandQueue::WaitForIdle() { - AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); Fence fence; fence.Init(m_device.get(), RHI::FenceState::Reset); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueueContext.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueueContext.cpp index 1c5fd6fa05..f35f66f3e8 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueueContext.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandQueueContext.cpp @@ -101,7 +101,7 @@ namespace AZ void CommandQueueContext::WaitForIdle() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); for (uint32_t hardwareQueueIdx = 0; hardwareQueueIdx < RHI::HardwareQueueClassCount; ++hardwareQueueIdx) { if (m_commandQueues[hardwareQueueIdx]) @@ -113,10 +113,10 @@ namespace AZ void CommandQueueContext::Begin() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Clearing Command Queue Timers"); + AZ_PROFILE_SCOPE(AzRender, "Clearing Command Queue Timers"); for (const RHI::Ptr& commandQueue : m_commandQueues) { commandQueue->ClearTimers(); @@ -131,7 +131,7 @@ namespace AZ void CommandQueueContext::End() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("DX12", "CommandQueueContext: End"); QueueGpuSignals(m_frameFences[m_currentFrameIndex]); @@ -145,7 +145,7 @@ namespace AZ m_currentFrameIndex = (m_currentFrameIndex + 1) % aznumeric_cast(m_frameFences.size()); { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::AzRender, "Wait and Reset Fence"); + AZ_PROFILE_SCOPE(AzRender, "Wait and Reset Fence"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("DX12", "CommandQueueContext: Wait on Fences"); FenceEvent event("FrameFence"); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.cpp index f61aa3f67f..6244089d93 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.cpp @@ -60,7 +60,7 @@ namespace AZ { if (fenceValue > GetCompletedValue()) { - AZ_PROFILE_SCOPE_IDLE_DYNAMIC(AZ::Debug::ProfileCategory::AzRender, "Fence Wait: %s", fenceEvent.GetName()); + AZ_PROFILE_SCOPE(AzRender, "Fence Wait: %s", fenceEvent.GetName()); m_fence->SetEventOnCompletion(fenceValue, fenceEvent.m_EventHandle); WaitForSingleObject(fenceEvent.m_EventHandle, INFINITE); } diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.h index 064efe5722..133b8aa664 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/Fence.h @@ -7,12 +7,13 @@ */ #pragma once +#include + #include #include #include #include #include -#include namespace AZ { diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp index 6f35bb32ae..c00dcced58 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/StreamingImagePool.cpp @@ -144,7 +144,7 @@ namespace AZ #ifdef AZ_RHI_USE_TILED_RESOURCES { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "StreamImagePool::CreateHeap"); + AZ_PROFILE_SCOPE(AzRender, "StreamImagePool::CreateHeap"); CD3DX12_HEAP_DESC heapDesc(descriptor.m_budgetInBytes, D3D12_HEAP_TYPE_DEFAULT, 0, D3D12_HEAP_FLAG_DENY_BUFFERS | D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES); diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueue.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueue.cpp index 5db3cfb0d3..4bde063d63 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueue.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueue.cpp @@ -114,7 +114,7 @@ namespace AZ //Autoreleasepool is to ensure that the driver is not leaking memory related to the command buffer and encoder @autoreleasepool { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "ExecuteWork"); + AZ_PROFILE_SCOPE(AzRender, "ExecuteWork"); AZ_PROFILE_RHI_VARIABLE(m_lastExecuteDuration); if (request.m_signalFenceValue > 0) diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueueContext.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueueContext.cpp index 814610b4d5..f0ec98be89 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueueContext.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/CommandQueueContext.cpp @@ -79,7 +79,7 @@ namespace AZ void CommandQueueContext::End() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); QueueGpuSignals(m_frameFences[m_currentFrameIndex]); for (uint32_t hardwareQueueIdx = 0; hardwareQueueIdx < RHI::HardwareQueueClassCount; ++hardwareQueueIdx) @@ -91,7 +91,7 @@ namespace AZ m_currentFrameIndex = (m_currentFrameIndex + 1) % aznumeric_cast(m_frameFences.size()); { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::AzRender, "Wait and Reset Fence"); + AZ_PROFILE_SCOPE(AzRender, "Wait and Reset Fence"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("RHI", "CommandQueueContext: Wait on Fences"); //Synchronize the CPU with the GPU by waiting on the fence until signalled by the GPU. CPU can only go upto diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp index 18b5d83ed3..12e14f6134 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/AsyncUploadQueue.cpp @@ -96,7 +96,7 @@ namespace AZ uploadFence->Init(device, RHI::FenceState::Reset); CommandQueue::Command command = [=, &device](void* queue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Buffer"); + AZ_PROFILE_SCOPE(AzRender, "Upload Buffer"); size_t pendingByteOffset = 0; size_t pendingByteCount = byteCount; FramePacket* framePacket = nullptr; @@ -110,7 +110,7 @@ namespace AZ while (pendingByteCount > 0) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Buffer Chunk"); + AZ_PROFILE_SCOPE(AzRender, "Upload Buffer Chunk"); framePacket = BeginFramePacket(vulkanQueue); const size_t bytesToCopy = AZStd::min(pendingByteCount, m_descriptor.m_stagingSizeInBytes); @@ -181,7 +181,7 @@ namespace AZ CommandQueue::Command command = [=, &device](void* queue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Upload Image"); + AZ_PROFILE_SCOPE(AzRender, "Upload Image"); Queue* vulkanQueue = static_cast(queue); FramePacket* framePacket = BeginFramePacket(vulkanQueue); @@ -257,7 +257,7 @@ namespace AZ // Copy subresource data to staging memory. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Copy CPU image"); + AZ_PROFILE_SCOPE(AzRender, "Copy CPU image"); uint8_t* stagingDataStart = reinterpret_cast(framePacket->m_stagingBuffer->GetBufferMemoryView()->Map(RHI::HostMemoryAccess::Write)) + framePacket->m_dataOffset; for (uint32_t row = 0; row < subresourceLayout.m_rowCount; ++row) { @@ -332,7 +332,7 @@ namespace AZ // Copy subresource data to staging memory. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "Copy CPU image"); + AZ_PROFILE_SCOPE(AzRender, "Copy CPU image"); uint8_t* stagingDataStart = reinterpret_cast(framePacket->m_stagingBuffer->GetBufferMemoryView()->Map(RHI::HostMemoryAccess::Write)); stagingDataStart += framePacket->m_dataOffset; @@ -458,7 +458,7 @@ namespace AZ AsyncUploadQueue::FramePacket* AsyncUploadQueue::BeginFramePacket(Queue* queue) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_Assert(!m_recordingFrame, "The previous frame packet isn't ended."); auto& device = static_cast(GetDevice()); @@ -478,7 +478,7 @@ namespace AZ void AsyncUploadQueue::EndFramePacket(Queue* queue, Semaphore* semaphoreToSignal /*=nullptr*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_Assert(m_recordingFrame, "The frame packet wasn't started. You need to call StartFramePacket first."); m_commandList->EndCommandBuffer(); @@ -644,7 +644,7 @@ namespace AZ void AsyncUploadQueue::ProcessCallback(const RHI::AsyncWorkHandle& handle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZStd::unique_lock lock(m_callbackListMutex); auto findIter = m_callbackList.find(handle); if (findIter != m_callbackList.end()) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp index 84b4964235..6929b63ac4 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueue.cpp @@ -54,7 +54,7 @@ namespace AZ const ExecuteWorkRequest& request = static_cast(rhiRequest); QueueCommand([=](void* queue) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "ExecuteWork"); + AZ_PROFILE_SCOPE(AzRender, "ExecuteWork"); AZ_PROFILE_RHI_VARIABLE(m_lastExecuteDuration); Queue* vulkanQueue = static_cast(queue); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueueContext.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueueContext.cpp index 8635e8edcf..9457a765fa 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueueContext.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandQueueContext.cpp @@ -42,7 +42,7 @@ namespace AZ void CommandQueueContext::End() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); for (auto& commandQueue : m_commandQueues) { @@ -54,7 +54,7 @@ namespace AZ m_currentFrameIndex = (m_currentFrameIndex + 1) % GetFrameCount(); { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::AzRender, "Wait on Fences"); + AZ_PROFILE_SCOPE(AzRender, "Wait on Fences"); AZ_ATOM_PROFILE_FUNCTION("RHI", "CommandQueueContext: Wait on Fences"); FencesPerQueue& nextFences = m_frameFences[m_currentFrameIndex]; @@ -79,7 +79,7 @@ namespace AZ void CommandQueueContext::WaitForIdle() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); for (auto& commandQueue : m_commandQueues) { commandQueue->WaitForIdle(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index c630fe0e5d..841607404a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -299,7 +299,7 @@ namespace AZ //work function void Process() override { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); const View::UsageFlags viewFlags = m_jobData->m_view->GetUsageFlags(); const RHI::DrawListMask drawListMask = m_jobData->m_view->GetDrawListMask(); @@ -312,7 +312,7 @@ namespace AZ bool nodeIsContainedInFrustum = ShapeIntersection::Contains(m_jobData->m_frustum, nodeData.m_bounds); #ifdef AZ_CULL_PROFILE_VERBOSE - AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "process node (view: %s, skip fine cull: %d", + AZ_PROFILE_SCOPE(AzRender, "process node (view: %s, skip fine cull: %d", m_view->GetName().GetCStr(), nodeIsContainedInFrustum ? 1 : 0); #endif @@ -385,7 +385,7 @@ namespace AZ if (m_jobData->m_debugCtx->m_debugDraw && (m_jobData->m_view->GetName() == m_jobData->m_debugCtx->m_currentViewSelectionName)) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "debug draw culling"); + AZ_PROFILE_SCOPE(AzRender, "debug draw culling"); AuxGeomDrawPtr auxGeomPtr = AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(m_jobData->m_scene); if (auxGeomPtr) @@ -507,7 +507,7 @@ namespace AZ void CullingScene::ProcessCullables(const Scene& scene, View& view, AZ::Job& parentJob) { - AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "CullingScene::ProcessCullables() - %s", view.GetName().GetCStr()); + AZ_PROFILE_SCOPE(AzRender, "CullingScene::ProcessCullables() - %s", view.GetName().GetCStr()); const Matrix4x4& worldToClip = view.GetWorldToClipMatrix(); Frustum frustum = Frustum::CreateFromMatrixColumnMajor(worldToClip); @@ -598,7 +598,7 @@ namespace AZ auto nodeVisitorLambda = [this, jobData, &parentJob, &frustum, &worklist](const AzFramework::IVisibilityScene::NodeData& nodeData) -> void { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "nodeVisitorLambda()"); + AZ_PROFILE_SCOPE(AzRender, "nodeVisitorLambda()"); AZ_Assert(nodeData.m_entries.size() > 0, "should not get called with 0 entries"); AZ_Assert(worklist.size() < worklist.capacity(), "we should always have room to push a node on the queue"); @@ -645,7 +645,7 @@ namespace AZ uint32_t AddLodDataToView(const Vector3& pos, const Cullable::LodData& lodData, RPI::View& view) { #ifdef AZ_CULL_PROFILE_DETAILED - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); #endif const Matrix4x4& viewToClip = view.GetViewToClipMatrix(); @@ -663,7 +663,7 @@ namespace AZ auto addLodToDrawPacket = [&](const Cullable::LodData::Lod& lod) { #ifdef AZ_CULL_PROFILE_VERBOSE - AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "add draw packets: %zu", lod.m_drawPackets.size()); + AZ_PROFILE_SCOPE(AzRender, "add draw packets: %zu", lod.m_drawPackets.size()); #endif numVisibleDrawPackets += static_cast(lod.m_drawPackets.size()); //don't want to pay the cost of aznumeric_cast<> here so using static_cast<> instead for (const RHI::DrawPacket* drawPacket : lod.m_drawPackets) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp index 4f941463eb..1de6776d9c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp @@ -310,7 +310,7 @@ namespace AZ if (NeedsCompile() && CanCompile()) { - AZ_PROFILE_EVENT_BEGIN(Debug::ProfileCategory::AzRender, "Material::Compile() Processing Functors"); + AZ_PROFILE_BEGIN(AzRender, "Material::Compile() Processing Functors"); for (const Ptr& functor : m_materialAsset->GetMaterialFunctors()) { if (functor) @@ -339,7 +339,7 @@ namespace AZ AZ_Error(s_debugTraceName, false, "Material functor is null."); } } - AZ_PROFILE_EVENT_END(Debug::ProfileCategory::AzRender); + AZ_PROFILE_END(); m_propertyDirtyFlags.reset(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp index 5762720913..7fd7133cee 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp @@ -124,7 +124,7 @@ namespace AZ bool MeshDrawPacket::DoUpdate(const Scene& parentScene) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); const ModelLod::Mesh& mesh = m_modelLod->GetMeshes()[m_modelLodMeshIndex]; if (!m_material) @@ -155,7 +155,7 @@ namespace AZ auto appendShader = [&](const ShaderCollection::Item& shaderItem) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "appendShader()"); + AZ_PROFILE_SCOPE(AzRender, "appendShader()"); // Skip the shader item without creating the shader instance // if the mesh is not going to be rendered based on the draw tag @@ -256,7 +256,7 @@ namespace AZ Data::Instance drawSrg; if (drawSrgLayout) { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "create drawSrg"); + AZ_PROFILE_SCOPE(AzRender, "create drawSrg"); // If the DrawSrg exists we must create and bind it, otherwise the CommandList will fail validation for SRG being null drawSrg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), shader->GetSupervariantIndex(), drawSrgLayout->GetName()); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp index 32fe297c57..0cbcdbf5f4 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/Model.cpp @@ -42,7 +42,7 @@ namespace AZ Data::Instance Model::CreateInternal(const Data::Asset& modelAsset) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); Data::Instance model = aznew Model(); const RHI::ResultCode resultCode = model->Init(modelAsset); @@ -56,7 +56,7 @@ namespace AZ RHI::ResultCode Model::Init(const Data::Asset& modelAsset) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); m_lods.resize(modelAsset->GetLodAssets().size()); @@ -107,7 +107,7 @@ namespace AZ { if (m_isUploadPending) { - AZ_PROFILE_SCOPE_STALL_DYNAMIC(Debug::ProfileCategory::AzRender, "Model::WaitForUpload - %s", GetDatabaseName()); + AZ_PROFILE_SCOPE(AzRender, "Model::WaitForUpload - %s", GetDatabaseName()); for (const Data::Instance& lod : m_lods) { lod->WaitForUpload(); @@ -128,7 +128,7 @@ namespace AZ bool Model::LocalRayIntersection(const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, float& distanceNormalized, AZ::Vector3& normal) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!GetModelAsset()) { @@ -171,7 +171,7 @@ namespace AZ float& distanceNormalized, AZ::Vector3& normal) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); const AZ::Vector3 clampedScale = nonUniformScale.GetMax(AZ::Vector3(AZ::MinTransformScale)); const AZ::Transform inverseTM = modelTransform.GetInverse(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp index dc39200a65..cfe0d08270 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp @@ -264,7 +264,7 @@ namespace AZ const MaterialModelUvOverrideMap& materialModelUvMap, const MaterialUvNameMap& materialUvNameMap) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); streamBufferViewsOut.clear(); @@ -366,7 +366,7 @@ namespace AZ const MaterialModelUvOverrideMap& materialModelUvMap, const MaterialUvNameMap& materialUvNameMap) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); const Mesh& mesh = m_meshes[meshIndex]; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLodUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLodUtils.cpp index dc5c1f5c4d..0fe035dd85 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLodUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLodUtils.cpp @@ -27,7 +27,7 @@ namespace AZ ModelLodIndex SelectLod(const View* view, const Vector3& position, const Model& model, ModelLodIndex lodOverride) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); ModelLodIndex lodIndex; if (model.GetLodCount() == 1) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp index d73521763f..4cf952ee01 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp @@ -189,7 +189,7 @@ namespace AZ void PassSystem::BuildPasses() { m_state = PassSystemState::BuildingPasses; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RPI", "PassSystem: BuildPassAttachments"); m_passHierarchyChanged = m_passHierarchyChanged || !m_buildPassList.empty(); @@ -239,7 +239,7 @@ namespace AZ void PassSystem::InitializePasses() { m_state = PassSystemState::InitializingPasses; - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RPI", "PassSystem: BuildPassAttachments"); m_passHierarchyChanged = m_passHierarchyChanged || !m_initializePassList.empty(); @@ -286,7 +286,7 @@ namespace AZ return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); PassValidationResults validationResults; m_rootPass->Validate(validationResults); @@ -307,7 +307,7 @@ namespace AZ void PassSystem::FrameUpdate(RHI::FrameGraphBuilder& frameGraphBuilder) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RPI", "PassSystem: FrameUpdate"); ResetFrameStatistics(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp index ce02e1c570..d37002eb6b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp @@ -216,7 +216,7 @@ namespace AZ void RasterPass::CompileResources(const RHI::FrameGraphCompileContext& context) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (m_shaderResourceGroup == nullptr) { @@ -230,7 +230,7 @@ namespace AZ void RasterPass::BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); RHI::CommandList* commandList = context.GetCommandList(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp index d2a32784ce..efc050eb68 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp @@ -270,7 +270,7 @@ namespace AZ return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZ_ATOM_PROFILE_FUNCTION("RPI", "RPISystem: RenderTick"); // Query system update is to increment the frame count diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp index 89f7da11e3..a552ac86f2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RenderPipeline.cpp @@ -377,7 +377,7 @@ namespace AZ void RenderPipeline::OnStartFrame(const TickTimeInfo& tick) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); m_lastRenderStartTime = tick.m_currentGameTime; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp index 02a03ee853..4d3dcba36e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp @@ -399,7 +399,7 @@ namespace AZ AZ_ATOM_PROFILE_FUNCTION("RPI", "Scene: PrepareRender"); { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "WaitForSimulationCompletion"); + AZ_PROFILE_SCOPE(AzRender, "WaitForSimulationCompletion"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "WaitForSimulationCompletion"); WaitAndCleanCompletionJob(m_simulationCompletion); } @@ -407,7 +407,7 @@ namespace AZ SceneNotificationBus::Event(GetId(), &SceneNotification::OnBeginPrepareRender); { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "m_srgCallback"); + AZ_PROFILE_SCOPE(AzRender, "m_srgCallback"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "ShaderResourceGroupCallback: SrgCallback"); // Set values for scene srg if (m_srg && m_srgCallback) @@ -483,7 +483,7 @@ namespace AZ } { - AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "CollectDrawPackets"); + AZ_PROFILE_SCOPE(AzRender, "CollectDrawPackets"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "CollectDrawPackets"); AZ::JobCompletion* collectDrawPacketsCompletion = aznew AZ::JobCompletion(); @@ -533,7 +533,7 @@ namespace AZ } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzRender, "FinalizeDrawLists"); + AZ_PROFILE_BEGIN(AzRender, "FinalizeDrawLists"); AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "FinalizeDrawLists"); if (jobPolicy == RHI::JobPolicy::Serial) { @@ -556,7 +556,7 @@ namespace AZ finalizeDrawListsJob->SetDependent(finalizeDrawListsCompletion); finalizeDrawListsJob->Start(); } - AZ_PROFILE_EVENT_END(Debug::ProfileCategory::AzRender); + AZ_PROFILE_END(); WaitAndCleanCompletionJob(finalizeDrawListsCompletion); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp index d0d76e62de..c0f0e20714 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp @@ -113,7 +113,7 @@ namespace AZ return; } - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); AZStd::lock_guard lock(m_metricsMutex); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index ff277c5cad..f6dcd02804 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -297,7 +297,7 @@ namespace AZ const ShaderVariant& Shader::GetVariant(const ShaderVariantId& shaderVariantId) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); Data::Asset shaderVariantAsset = m_asset->GetVariant(shaderVariantId, m_supervariantIndex); if (!shaderVariantAsset || shaderVariantAsset->IsRootVariant()) { @@ -314,14 +314,14 @@ namespace AZ ShaderVariantSearchResult Shader::FindVariantStableId(const ShaderVariantId& shaderVariantId) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); ShaderVariantSearchResult variantSearchResult = m_asset->FindVariantStableId(shaderVariantId); return variantSearchResult; } const ShaderVariant& Shader::GetVariant(ShaderVariantStableId shaderVariantStableId) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!shaderVariantStableId.IsValid() || shaderVariantStableId == ShaderAsset::RootShaderVariantStableId) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/View.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/View.cpp index 1937afc240..f1f25e3303 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/View.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/View.cpp @@ -237,7 +237,7 @@ namespace AZ void View::FinalizeDrawLists() { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); m_drawListContext.FinalizeLists(); SortFinalizedDrawLists(); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp index 275b056514..e1da50d2fb 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/ModelAsset.cpp @@ -96,7 +96,7 @@ namespace AZ const AZ::Vector3& rayStart, const AZ::Vector3& rayDir, bool allowBruteForce, float& distanceNormalized, AZ::Vector3& normal) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); if (!m_modelTriangleCount) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp index f2d82918ea..adeb564675 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp @@ -172,7 +172,7 @@ namespace AZ Data::Asset ShaderAsset::GetVariant( const ShaderVariantId& shaderVariantId, SupervariantIndex supervariantIndex) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); auto variantFinder = AZ::Interface::Get(); AZ_Assert(variantFinder, "The IShaderVariantFinder doesn't exist"); @@ -189,7 +189,7 @@ namespace AZ ShaderVariantSearchResult ShaderAsset::FindVariantStableId(const ShaderVariantId& shaderVariantId) { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); uint32_t dynamicOptionCount = aznumeric_cast(GetShaderOptionGroupLayout()->GetShaderOptions().size()); ShaderVariantSearchResult variantSearchResult{RootShaderVariantStableId, dynamicOptionCount }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantTreeAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantTreeAsset.cpp index 46873dc62d..bd0cad9f4d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantTreeAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantTreeAsset.cpp @@ -72,7 +72,7 @@ namespace AZ ShaderVariantSearchResult ShaderVariantTreeAsset::FindVariantStableId(const ShaderOptionGroupLayout* shaderOptionGroupLayout, const ShaderVariantId& shaderVariantId) const { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + AZ_PROFILE_FUNCTION(AzRender); struct NodeToVisit { diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/StableDynamicArray.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/StableDynamicArray.h index 454a6d4086..e73f641b96 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/StableDynamicArray.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/StableDynamicArray.h @@ -130,6 +130,7 @@ namespace AZ template struct StableDynamicArray::Page { + static constexpr size_t PageSize = ElementsPerPage * sizeof(T); static constexpr size_t InvalidPage = -1; static constexpr uint64_t FullBits = 0xFFFFFFFFFFFFFFFFull; static constexpr size_t NumUint64_t = ElementsPerPage / 64; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp index 3c5d45abc2..be4d5186c8 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp @@ -147,7 +147,7 @@ namespace SurfaceData bool SurfaceDataMeshComponent::DoRayTrace(const AZ::Vector3& inPosition, AZ::Vector3& outPosition, AZ::Vector3& outNormal) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -233,7 +233,7 @@ namespace SurfaceData void SurfaceDataMeshComponent::UpdateMeshData() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool meshValidBeforeUpdate = false; bool meshValidAfterUpdate = false; diff --git a/Gems/AudioEngineWwise/Code/Source/Engine/AudioSystemImpl_wwise.cpp b/Gems/AudioEngineWwise/Code/Source/Engine/AudioSystemImpl_wwise.cpp index e4933728d4..738806a912 100644 --- a/Gems/AudioEngineWwise/Code/Source/Engine/AudioSystemImpl_wwise.cpp +++ b/Gems/AudioEngineWwise/Code/Source/Engine/AudioSystemImpl_wwise.cpp @@ -374,7 +374,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// void CAudioSystemImpl_wwise::Update([[maybe_unused]] const float updateIntervalMS) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); if (AK::SoundEngine::IsInitialized()) { @@ -731,7 +731,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// EAudioRequestStatus CAudioSystemImpl_wwise::UpdateAudioObject(IATLAudioObjectData* const audioObjectData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); EAudioRequestStatus result = eARS_FAILURE; diff --git a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp index 30084565d6..bfb1254e52 100644 --- a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp +++ b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.cpp @@ -265,7 +265,7 @@ namespace Audio auto callback = [&transferInfo](AZ::IO::FileRequestHandle request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); AZ::IO::IStreamerTypes::RequestStatus status = AZ::Interface::Get()->GetRequestStatus(request); switch (status) { diff --git a/Gems/AudioSystem/Code/Source/Engine/ATL.cpp b/Gems/AudioSystem/Code/Source/Engine/ATL.cpp index e6700ea610..ff56300b85 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATL.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATL.cpp @@ -148,7 +148,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// void CAudioTranslationLayer::Update() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); auto current = AZStd::chrono::system_clock::now(); m_elapsedTime = AZStd::chrono::duration_cast(current - m_lastUpdateTime); @@ -2016,7 +2016,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// void CAudioTranslationLayer::DrawAudioSystemDebugInfo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); // ToDo: Update to work with Atom? LYN-3677 /*if (CVars::s_debugDrawOptions.GetRawFlags() != 0) diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLComponents.cpp b/Gems/AudioSystem/Code/Source/Engine/ATLComponents.cpp index 7010012e87..91340ca9bb 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLComponents.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATLComponents.cpp @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -304,7 +305,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// void CAudioObjectManager::Update(const float fUpdateIntervalMS, const SATLWorldPosition& rListenerPosition) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); m_fTimeSinceLastVelocityUpdateMS += fUpdateIntervalMS; const bool bUpdateVelocity = m_fTimeSinceLastVelocityUpdateMS > s_fVelocityUpdateIntervalMS; @@ -317,7 +318,7 @@ namespace Audio if (pObject->HasActiveEvents()) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Audio, "Inner Per-Object CAudioObjectManager::Update"); + AZ_PROFILE_SCOPE(Audio, "Inner Per-Object CAudioObjectManager::Update"); pObject->Update(fUpdateIntervalMS, rListenerPosition); @@ -936,7 +937,7 @@ namespace Audio void CAudioEventListenerManager::NotifyListener(const SAudioRequestInfo* const pResultInfo) { // This should always be on the main thread! - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); auto found = AZStd::find_if(m_cListeners.begin(), m_cListeners.end(), [pResultInfo](const SAudioEventListener& currentListener) diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLUtils.h b/Gems/AudioSystem/Code/Source/Engine/ATLUtils.h index c1bb8251f9..97266e95c3 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLUtils.h +++ b/Gems/AudioSystem/Code/Source/Engine/ATLUtils.h @@ -16,6 +16,7 @@ #include #include #include +#include #define ATL_FLOAT_EPSILON (1.0e-6) diff --git a/Gems/AudioSystem/Code/Source/Engine/AudioSystem.cpp b/Gems/AudioSystem/Code/Source/Engine/AudioSystem.cpp index 30d815cbec..43ab47266a 100644 --- a/Gems/AudioSystem/Code/Source/Engine/AudioSystem.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/AudioSystem.cpp @@ -115,7 +115,7 @@ namespace Audio void CAudioSystem::PushRequestBlocking(const SAudioRequest& audioRequestData) { // Main Thread! - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); CAudioRequestInternal request(audioRequestData); @@ -201,7 +201,7 @@ namespace Audio void CAudioSystem::InternalUpdate() { // Audio Thread! - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); auto startUpdateTime = AZStd::chrono::system_clock::now(); // stamp the start time @@ -225,7 +225,7 @@ namespace Audio #if !defined(AUDIO_RELEASE) #if defined(PROVIDE_GETNAME_SUPPORT) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Audio, "Sync Debug Name Changes"); + AZ_PROFILE_SCOPE(Audio, "Sync Debug Name Changes"); AZStd::lock_guard lock(m_debugNameStoreMutex); m_debugNameStore.SyncChanges(m_oATL.GetDebugStore()); } @@ -238,7 +238,7 @@ namespace Audio auto elapsedUpdateTime = AZStd::chrono::duration_cast(endUpdateTime - startUpdateTime); if (elapsedUpdateTime < m_targetUpdatePeriod) { - AZ_PROFILE_SCOPE_IDLE(AZ::Debug::ProfileCategory::Audio, "Wait Remaining Time in Update Period"); + AZ_PROFILE_SCOPE(Audio, "Wait Remaining Time in Update Period"); m_processingEvent.try_acquire_for(m_targetUpdatePeriod - elapsedUpdateTime); } } @@ -596,7 +596,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////////// void CAudioSystem::ProcessRequestBlocking(CAudioRequestInternal& request) { - AZ_PROFILE_FUNCTION_STALL(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); if (m_oATL.CanProcessRequests()) { @@ -616,7 +616,7 @@ namespace Audio void CAudioSystem::ProcessRequestThreadSafe(CAudioRequestInternal request) { // Audio Thread! - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Audio, "Thread-Safe Request: %s", request.ToString().c_str()); + AZ_PROFILE_SCOPE(Audio, "Thread-Safe Request: %s", request.ToString().c_str()); if (m_oATL.CanProcessRequests()) { @@ -641,7 +641,7 @@ namespace Audio { // Todo: This should handle request priority, use request priority as bus Address and process in priority order. - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Audio, "Normal Request: %s", request.ToString().c_str()); + AZ_PROFILE_SCOPE(Audio, "Normal Request: %s", request.ToString().c_str()); AZ_Assert(g_mainThreadId != AZStd::this_thread::get_id(), "AudioSystem::ProcessRequestByPriority - called from Main thread!"); @@ -672,7 +672,7 @@ namespace Audio { if (!(request.nInternalInfoFlags & eARIF_WAITING_FOR_REMOVAL)) { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::Audio, "Blocking Request: %s", request.ToString().c_str()); + AZ_PROFILE_SCOPE(Audio, "Blocking Request: %s", request.ToString().c_str()); if (request.eStatus == eARS_NONE) { diff --git a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp index f1a360fd7d..791c86eba8 100644 --- a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -61,7 +62,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////// void CFileCacheManager::Update() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); AudioFileCacheManagerNotficationBus::ExecuteQueuedEvents(); UpdatePreloadRequestsStatus(); @@ -538,7 +539,7 @@ namespace Audio bool CFileCacheManager::FinishCachingFileInternal(CATLAudioFileEntry* const audioFileEntry, [[maybe_unused]] AZ::IO::SizeType bytesRead, AZ::IO::IStreamerTypes::RequestStatus requestState) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); bool success = false; audioFileEntry->m_asyncStreamRequest.reset(); @@ -640,7 +641,7 @@ namespace Audio /////////////////////////////////////////////////////////////////////////////////////////////// bool CFileCacheManager::AllocateMemoryBlockInternal(CATLAudioFileEntry* const audioFileEntry) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); // Must not have valid memory yet. AZ_Assert(!audioFileEntry->m_memoryBlock, "FileCacheManager AllocateMemoryBlockInternal - Memory appears to be set already!"); @@ -786,7 +787,7 @@ namespace Audio const bool overrideUseCount /* = false */, const size_t useCount /* = 0 */) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); bool success = false; @@ -842,7 +843,7 @@ namespace Audio audioFileEntry->m_asyncStreamRequest, [this](AZ::IO::FileRequestHandle request) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Audio); + AZ_PROFILE_FUNCTION(Audio); AudioFileCacheManagerNotficationBus::QueueBroadcast( &AudioFileCacheManagerNotficationBus::Events::FinishAsyncStreamRequest, request); diff --git a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp index d05a679733..ec6e7bbbb9 100644 --- a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp +++ b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp @@ -187,7 +187,7 @@ namespace Blast void BlastFamilyComponent::Activate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); AZ_Assert(m_blastAsset.GetId().IsValid(), "BlastFamilyComponent created with invalid blast asset."); @@ -199,7 +199,7 @@ namespace Blast void BlastFamilyComponent::Deactivate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); // cleanup collision handlers for (auto& itr : m_collisionHandlers) @@ -216,7 +216,7 @@ namespace Blast void BlastFamilyComponent::Spawn() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (!m_blastAsset.IsReady()) { @@ -297,7 +297,7 @@ namespace Blast void BlastFamilyComponent::Despawn() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); m_isSpawned = false; @@ -414,7 +414,7 @@ namespace Blast void BlastFamilyComponent::OnCollisionBegin(const AzPhysics::CollisionEvent& collisionEvent) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); for (const auto* body : {collisionEvent.m_body1, collisionEvent.m_body2}) { @@ -493,7 +493,7 @@ namespace Blast void BlastFamilyComponent::ApplyStressDamage() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (m_solver) { @@ -589,7 +589,7 @@ namespace Blast // Update positions of entities with render meshes corresponding to their right dynamic bodies. void BlastFamilyComponent::SyncMeshes() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (m_actorRenderManager) { diff --git a/Gems/Blast/Code/Source/Components/BlastSystemComponent.cpp b/Gems/Blast/Code/Source/Components/BlastSystemComponent.cpp index bee94ed116..711d3a0087 100644 --- a/Gems/Blast/Code/Source/Components/BlastSystemComponent.cpp +++ b/Gems/Blast/Code/Source/Components/BlastSystemComponent.cpp @@ -112,7 +112,7 @@ namespace Blast void BlastSystemComponent::Activate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); auto blastAssetHandler = aznew BlastAssetHandler(); blastAssetHandler->Register(); m_assetHandlers.emplace_back(blastAssetHandler); @@ -141,7 +141,7 @@ namespace Blast void BlastSystemComponent::Deactivate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); CrySystemEventBus::Handler::BusDisconnect(); AZ::TickBus::Handler::BusDisconnect(); BlastSystemRequestBus::Handler::BusDisconnect(); @@ -185,7 +185,7 @@ namespace Blast void BlastSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); AZ::JobCompletion jobCompletion; @@ -226,18 +226,18 @@ namespace Blast for (auto& group : m_groups) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "ExtGroupTaskManager::process"); + AZ_PROFILE_SCOPE(Physics, "ExtGroupTaskManager::process"); group.m_extGroupTaskManager->process(); } for (auto& group : m_groups) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "ExtGroupTaskManager::wait"); + AZ_PROFILE_SCOPE(Physics, "ExtGroupTaskManager::wait"); group.m_extGroupTaskManager->wait(); } // Clean up damage descriptions and program params now that groups have run. { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "BlastSystemComponent::OnTick::Cleanup"); + AZ_PROFILE_SCOPE(Physics, "BlastSystemComponent::OnTick::Cleanup"); m_radialDamageDescs.clear(); m_capsuleDamageDescs.clear(); m_shearDamageDescs.clear(); @@ -248,7 +248,7 @@ namespace Blast if (gEnv && m_debugRenderMode) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "BlastSystemComponent::OnTick::DebugRender"); + AZ_PROFILE_SCOPE(Physics, "BlastSystemComponent::OnTick::DebugRender"); DebugRenderBuffer buffer; BlastFamilyComponentRequestBus::Broadcast( &BlastFamilyComponentRequests::FillDebugRenderBuffer, buffer, m_debugRenderMode); @@ -428,12 +428,12 @@ namespace Blast void BlastSystemComponent::AZBlastProfilerCallback::zoneStart(const char* eventName) { - AZ_PROFILE_EVENT_BEGIN(AZ::Debug::ProfileCategory::Physics, eventName); + AZ_PROFILE_BEGIN(Physics, eventName); } void BlastSystemComponent::AZBlastProfilerCallback::zoneEnd() { - AZ_PROFILE_EVENT_END(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_END(); } static void CmdToggleBlastDebugVisualization(IConsoleCmdArgs* args) diff --git a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp index 58f28ed32a..3bc6da4297 100644 --- a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp +++ b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp @@ -96,7 +96,7 @@ namespace Blast void EditorBlastFamilyComponent::Activate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); if (m_blastAsset.GetId().IsValid()) { @@ -107,7 +107,7 @@ namespace Blast void EditorBlastFamilyComponent::Deactivate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); AZ::Data::AssetBus::MultiHandler::BusDisconnect(); } diff --git a/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp b/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp index 23ec5ae524..9d0e4fe2ff 100644 --- a/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp +++ b/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp @@ -86,7 +86,7 @@ namespace Blast void EditorBlastMeshDataComponent::Activate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); OnMeshAssetsChanged(); m_meshFeatureProcessor = @@ -100,7 +100,7 @@ namespace Blast void EditorBlastMeshDataComponent::Deactivate() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::System); + AZ_PROFILE_FUNCTION(System); EditorComponentBase::Deactivate(); AZ::Render::MaterialComponentNotificationBus::Handler::BusDisconnect(GetEntityId()); AZ::TransformNotificationBus::Handler::BusDisconnect(GetEntityId()); diff --git a/Gems/Blast/Code/Source/Family/ActorRenderManager.cpp b/Gems/Blast/Code/Source/Family/ActorRenderManager.cpp index 98ea7d6741..aca1e94d16 100644 --- a/Gems/Blast/Code/Source/Family/ActorRenderManager.cpp +++ b/Gems/Blast/Code/Source/Family/ActorRenderManager.cpp @@ -33,7 +33,7 @@ namespace Blast void ActorRenderManager::OnActorCreated(const BlastActor& actor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); const AZStd::vector& chunkIndices = actor.GetChunkIndices(); @@ -47,7 +47,7 @@ namespace Blast void ActorRenderManager::OnActorDestroyed(const BlastActor& actor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); const AZStd::vector& chunkIndices = actor.GetChunkIndices(); @@ -62,7 +62,7 @@ namespace Blast { // It is more natural to have chunk entities be transform children of rigid body entity, // however having them separate and manually synchronizing transform is more efficient. - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); for (auto chunkId = 0u; chunkId < m_chunkCount; ++chunkId) { diff --git a/Gems/Blast/Code/Source/Family/ActorTracker.cpp b/Gems/Blast/Code/Source/Family/ActorTracker.cpp index 4c81c2d934..e441e7a074 100644 --- a/Gems/Blast/Code/Source/Family/ActorTracker.cpp +++ b/Gems/Blast/Code/Source/Family/ActorTracker.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -46,7 +47,7 @@ namespace Blast BlastActor* ActorTracker::FindClosestActor(const AZ::Vector3& position) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); const auto candidate = std::min_element( m_actors.begin(), m_actors.end(), diff --git a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp index 2690a12f24..56c785b310 100644 --- a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp +++ b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp @@ -122,7 +122,7 @@ namespace Blast void BlastFamilyImpl::HandleEvents(const Nv::Blast::TkEvent* events, uint32_t eventCount) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); AZStd::vector newActors; AZStd::unordered_set actorsToDelete; @@ -150,7 +150,7 @@ namespace Blast const Nv::Blast::TkSplitEvent* splitEvent, AZStd::vector& newActors, AZStd::unordered_set& actorsToDelete) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); AZ_Assert(splitEvent, "Received null TkSplitEvent from the Blast library."); if (!splitEvent) @@ -256,7 +256,7 @@ namespace Blast void BlastFamilyImpl::CreateActors(const AZStd::vector& actorDescs) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); for (auto& actorDesc : actorDescs) { @@ -268,7 +268,7 @@ namespace Blast void BlastFamilyImpl::DestroyActors(const AZStd::unordered_set& actors) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); for (const auto actor : actors) { @@ -294,14 +294,14 @@ namespace Blast void BlastFamilyImpl::DispatchActorCreated(const BlastActor& actor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); m_listener->OnActorCreated(*this, actor); } void BlastFamilyImpl::DispatchActorDestroyed(const BlastActor& actor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); m_listener->OnActorDestroyed(*this, actor); } diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp index 82b06c8171..300543c896 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp @@ -190,7 +190,7 @@ namespace EMotionFX // update void EMotionFXManager::Update(float timePassedInSeconds) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Animation, "EMotionFXManager::Update"); + AZ_PROFILE_SCOPE(Animation, "EMotionFXManager::Update"); m_debugDraw->Clear(); m_recorder->UpdatePlayMode(timePassedInSeconds); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/MultiThreadScheduler.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/MultiThreadScheduler.cpp index 6f07936fe7..8b7fbad316 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/MultiThreadScheduler.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/MultiThreadScheduler.cpp @@ -165,7 +165,7 @@ namespace EMotionFX AZ::JobContext* jobContext = nullptr; AZ::Job* job = AZ::CreateJobFunction([this, timePassedInSeconds, actorInstance]() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Animation, "MultiThreadScheduler::Execute::ActorInstanceUpdateJob"); + AZ_PROFILE_SCOPE(Animation, "MultiThreadScheduler::Execute::ActorInstanceUpdateJob"); const AZ::u32 threadIndex = AZ::JobContext::GetGlobalContext()->GetJobManager().GetWorkerThreadId(); actorInstance->SetThreadIndex(threadIndex); diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/ActorComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/ActorComponent.cpp index 303a7e118b..da4c72b70a 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/ActorComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/ActorComponent.cpp @@ -542,7 +542,7 @@ namespace EMotionFX ////////////////////////////////////////////////////////////////////////// void ActorComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Animation); + AZ_PROFILE_FUNCTION(Animation); if (!m_actorInstance || !m_actorInstance->GetIsEnabled()) { diff --git a/Gems/ExpressionEvaluation/Code/Source/ExpressionEvaluationSystemComponent.cpp b/Gems/ExpressionEvaluation/Code/Source/ExpressionEvaluationSystemComponent.cpp index 42ac124e6e..09b7bf878b 100644 --- a/Gems/ExpressionEvaluation/Code/Source/ExpressionEvaluationSystemComponent.cpp +++ b/Gems/ExpressionEvaluation/Code/Source/ExpressionEvaluationSystemComponent.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -251,7 +252,7 @@ namespace ExpressionEvaluation AZ::Outcome ExpressionEvaluationSystemComponent::ParseRestrictedExpressionInPlace(const AZStd::unordered_set& parsers, AZStd::string_view expressionString, ExpressionTree& expressionTree) const { - AZ_PROFILE_TIMER("ExpressionEvaluation", __FUNCTION__); + AZ_PROFILE_FUNCTION(ExpressionEvaluation); expressionTree.ClearTree(); @@ -513,7 +514,7 @@ namespace ExpressionEvaluation ExpressionResult ExpressionEvaluationSystemComponent::Evaluate(const ExpressionTree& expressionTree) const { - AZ_PROFILE_TIMER("ExpressionEvaluation", __FUNCTION__); + AZ_PROFILE_SCOPE("ExpressionEvaluation", __FUNCTION__); ExpressionResultStack resultStack; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index a7b0338ac1..c06265fb24 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -87,7 +88,7 @@ namespace GradientSignal inline float GradientSampler::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (m_opacity <= 0.0f || !m_gradientId.IsValid()) { diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index 3b71278f86..dbc2cd2827 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -224,7 +224,7 @@ namespace GradientSignal float DitherGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const AZ::Vector3& coordinate = sampleParams.m_position; diff --git a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp index d07f3a2e66..bdda0e48d2 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp @@ -263,7 +263,7 @@ namespace GradientSignal void GradientSurfaceDataComponent::OnCompositionChanged() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); UpdateRegistryAndCache(m_modifierHandle); } diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index af92a0e16c..38936dc302 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -324,7 +324,7 @@ namespace GradientSignal void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -415,7 +415,7 @@ namespace GradientSignal void GradientTransformComponent::UpdateFromShape() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 650dba209a..9e01b690e0 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -190,7 +190,7 @@ namespace GradientSignal float ImageGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Vector3 uvw = sampleParams.m_position; diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index 97dd8faa3c..af26ba494d 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -172,7 +172,7 @@ namespace GradientSignal float LevelsGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); float output = 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index ddf349645b..5f6a18c7fb 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -257,7 +257,7 @@ namespace GradientSignal float MixedGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //accumulate the mixed/combined result of all layers and operations float result = 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 6bc7108c64..e150ff4305 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -172,7 +172,7 @@ namespace GradientSignal float PerlinGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (m_perlinImprovedNoise) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index 4e02e92db3..d28fe13aff 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -137,7 +137,7 @@ namespace GradientSignal float RandomGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Vector3 uvw = sampleParams.m_position; diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index 3c1fea6563..28ffaad7d3 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -131,7 +131,7 @@ namespace GradientSignal float ReferenceGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); float output = 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index 3a3b9a2efd..cdf542bf51 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -157,7 +157,7 @@ namespace GradientSignal float ShapeAreaFalloffGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); float distance = 0.0f; LmbrCentral::ShapeComponentRequestsBus::EventResult(distance, m_configuration.m_shapeEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::DistanceFromPoint, sampleParams.m_position); diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index c321fe2a54..476e0971f4 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -244,7 +244,7 @@ namespace GradientSignal void SurfaceAltitudeGradientComponent::UpdateFromShape() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index 389fcf3678..7f46ad6e98 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -161,7 +161,7 @@ namespace GradientSignal float SurfaceMaskGradientComponent::GetValue(const GradientSampleParams& params) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); float result = 0.0f; diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 5d3397bbbd..c67f86c6b8 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -153,7 +153,7 @@ namespace GradientSignal float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (imageAsset.IsReady()) { diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h index 60c147e98e..ae55baa681 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphCanvasProfiler.h @@ -9,12 +9,12 @@ #include -#define GRAPH_CANVAS_PROFILE_FUNCTION() AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); -#define GRAPH_CANVAS_PROFILE_SCOPE(message) AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, message); +#define GRAPH_CANVAS_PROFILE_FUNCTION() AZ_PROFILE_FUNCTION(AzToolsFramework); +#define GRAPH_CANVAS_PROFILE_SCOPE(message) AZ_PROFILE_SCOPE(AzToolsFramework, message); #if GRAPH_CANVAS_ENABLE_DETAILED_PROFILING -#define GRAPH_CANVAS_DETAILED_PROFILE_FUNCTION() AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); -#define GRAPH_CANVAS_DETAILED_PROFILE_SCOPE(message) AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, message); +#define GRAPH_CANVAS_DETAILED_PROFILE_FUNCTION() AZ_PROFILE_FUNCTION(AzToolsFramework); +#define GRAPH_CANVAS_DETAILED_PROFILE_SCOPE(message) AZ_PROFILE_SCOPE(AzToolsFramework, message); #else #define GRAPH_CANVAS_DETAILED_PROFILE_FUNCTION() #define GRAPH_CANVAS_DETAILED_PROFILE_SCOPE(message) diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.h index 4e6e85250a..230655a455 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.h +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.inl b/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.inl index d6ad18325a..cc4a3e2740 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.inl +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Dependency/DependencyMonitor.inl @@ -15,7 +15,7 @@ namespace LmbrCentral inline void DependencyMonitor::Reset() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Data::AssetBus::MultiHandler::BusDisconnect(); AZ::EntityBus::MultiHandler::BusDisconnect(); @@ -35,7 +35,7 @@ namespace LmbrCentral inline void DependencyMonitor::ConnectDependency(const AZ::EntityId& entityId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (entityId.IsValid()) { AZ::EntityBus::MultiHandler::BusConnect(entityId); @@ -47,7 +47,7 @@ namespace LmbrCentral inline void DependencyMonitor::ConnectDependencies(const AZStd::vector& entityIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); for (const auto& entityId : entityIds) { @@ -57,7 +57,7 @@ namespace LmbrCentral inline void DependencyMonitor::ConnectDependency(const AZ::Data::AssetId& assetId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (assetId.IsValid()) { @@ -120,7 +120,7 @@ namespace LmbrCentral inline void DependencyMonitor::SendNotification() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //test if notification is in progress to prevent recursion in case of nested dependencies if (!m_notificationInProgress) diff --git a/Gems/LyShine/Code/Editor/PropertiesContainer.cpp b/Gems/LyShine/Code/Editor/PropertiesContainer.cpp index 21b3b99b02..9f9023f84d 100644 --- a/Gems/LyShine/Code/Editor/PropertiesContainer.cpp +++ b/Gems/LyShine/Code/Editor/PropertiesContainer.cpp @@ -595,7 +595,7 @@ bool PropertiesContainer::DoesIntersectNonSelectedComponentEditor(const QRect& g void PropertiesContainer::ClearComponentEditorSelection() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (auto componentEditor : m_componentEditors) { componentEditor->SetSelected(false); diff --git a/Gems/LyShine/Code/Editor/UiSliceManager.cpp b/Gems/LyShine/Code/Editor/UiSliceManager.cpp index c86da38d80..97e9a51e11 100644 --- a/Gems/LyShine/Code/Editor/UiSliceManager.cpp +++ b/Gems/LyShine/Code/Editor/UiSliceManager.cpp @@ -158,7 +158,7 @@ bool UiSliceManager::MakeNewSlice( bool inheritSlices, AZ::SerializeContext* serializeContext) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (entities.empty()) { @@ -240,7 +240,7 @@ bool UiSliceManager::MakeNewSlice( // Setup and execute transaction for the new slice. // { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "UiSliceManager::MakeNewSlice:SetupAndExecuteTransaction"); + AZ_PROFILE_SCOPE(AzToolsFramework, "UiSliceManager::MakeNewSlice:SetupAndExecuteTransaction"); using AzToolsFramework::SliceUtilities::SliceTransaction; @@ -249,7 +249,7 @@ bool UiSliceManager::MakeNewSlice( [this, &entitiesToInclude, &commonParent, &insertBefore] (SliceTransaction::TransactionPtr transaction, const char* fullPath, const SliceTransaction::SliceAssetPtr& /*asset*/) -> void { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "UiSliceManager::MakeNewSlice:PostSaveCallback"); + AZ_PROFILE_SCOPE(AzToolsFramework, "UiSliceManager::MakeNewSlice:PostSaveCallback"); // Once the asset is processed and ready, we can replace the source entities with an instance of the new slice. UiEditorEntityContextRequestBus::Event(m_entityContextId, &UiEditorEntityContextRequestBus::Events::QueueSliceReplacement, @@ -260,7 +260,7 @@ bool UiSliceManager::MakeNewSlice( // Add entities { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "UiSliceManager::MakeNewSlice:SetupAndExecuteTransaction:AddEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "UiSliceManager::MakeNewSlice:SetupAndExecuteTransaction:AddEntities"); for (const AZ::EntityId& entityId : orderedEntityList) { SliceTransaction::Result addResult = transaction->AddEntity(entityId, !inheritSlices ? SliceTransaction::SliceAddEntityFlags::DiscardSliceAncestry : 0); @@ -348,7 +348,7 @@ AzToolsFramework::SliceUtilities::SliceTransaction::Result SlicePreSaveCallbackF [[maybe_unused]] const char* fullPath, AzToolsFramework::SliceUtilities::SliceTransaction::SliceAssetPtr& asset) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SlicePreSaveCallbackForUiEntities"); + AZ_PROFILE_SCOPE(AzToolsFramework, "SlicePreSaveCallbackForUiEntities"); // we want to ensure that "bad" data never gets pushed to a slice // This mostly relates to the m_childEntityIdOrder array since this is something that diff --git a/Gems/MultiplayerCompression/Code/Tests/MultiplayerCompressionTest.cpp b/Gems/MultiplayerCompression/Code/Tests/MultiplayerCompressionTest.cpp index 91839b1e23..5a3304fecd 100644 --- a/Gems/MultiplayerCompression/Code/Tests/MultiplayerCompressionTest.cpp +++ b/Gems/MultiplayerCompression/Code/Tests/MultiplayerCompressionTest.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothSkinning.cpp b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothSkinning.cpp index 8baea091a2..ef42aba7f0 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothSkinning.cpp +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothSkinning.cpp @@ -233,7 +233,7 @@ namespace NvCloth void ActorClothSkinningLinear::UpdateSkinning() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_skinningMatrices = Internal::ObtainSkinningMatrices(m_entityId); } @@ -250,7 +250,7 @@ namespace NvCloth return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); const size_t vertexCount = m_simulatedVertices.size(); for (size_t index = 0; index < vertexCount; ++index) @@ -274,7 +274,7 @@ namespace NvCloth return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); for (const AZ::u32 index : m_nonSimulatedVertices) { @@ -342,7 +342,7 @@ namespace NvCloth void ActorClothSkinningDualQuaternion::UpdateSkinning() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_skinningDualQuaternions = Internal::ObtainSkinningDualQuaternions(m_entityId, m_jointIndices); } @@ -359,7 +359,7 @@ namespace NvCloth return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); const size_t vertexCount = m_simulatedVertices.size(); for (size_t index = 0; index < vertexCount; ++index) @@ -383,7 +383,7 @@ namespace NvCloth return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); for (const AZ::u32 index : m_nonSimulatedVertices) { diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp index 5a7564d72a..54e9619eea 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ClothComponentMesh.cpp @@ -250,7 +250,7 @@ namespace NvCloth [[maybe_unused]] ClothId clothId, float deltaTime) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); UpdateSimulationCollisions(); @@ -267,7 +267,7 @@ namespace NvCloth [[maybe_unused]] float deltaTime, const AZStd::vector& updatedParticles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); // Next buffer index of the render data m_renderDataBufferIndex = (m_renderDataBufferIndex + 1) % RenderDataBufferSize; @@ -326,7 +326,7 @@ namespace NvCloth { if (m_actorClothColliders) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_actorClothColliders->Update(); @@ -342,7 +342,7 @@ namespace NvCloth { if (m_actorClothSkinning) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_actorClothSkinning->UpdateSkinning(); @@ -376,7 +376,7 @@ namespace NvCloth void ClothComponentMesh::UpdateSimulationConstraints() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_motionConstraints = m_clothConstraints->GetMotionConstraints(); m_separationConstraints = m_clothConstraints->GetSeparationConstraints(); @@ -396,7 +396,7 @@ namespace NvCloth void ClothComponentMesh::UpdateRenderData(const AZStd::vector& particles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); if (!m_cloth) { @@ -449,7 +449,7 @@ namespace NvCloth void ClothComponentMesh::CopyRenderDataToModel() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); // Previous buffer index of the render data const AZ::u32 previousBufferIndex = (m_renderDataBufferIndex + RenderDataBufferSize - 1) % RenderDataBufferSize; diff --git a/Gems/NvCloth/Code/Source/System/Cloth.cpp b/Gems/NvCloth/Code/Source/System/Cloth.cpp index 2aad4c402f..c71d1bd584 100644 --- a/Gems/NvCloth/Code/Source/System/Cloth.cpp +++ b/Gems/NvCloth/Code/Source/System/Cloth.cpp @@ -165,7 +165,7 @@ namespace NvCloth void Cloth::Update() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); ResolveStaticParticles(); diff --git a/Gems/NvCloth/Code/Source/System/FabricCooker.cpp b/Gems/NvCloth/Code/Source/System/FabricCooker.cpp index 668675aeaa..e9da64f970 100644 --- a/Gems/NvCloth/Code/Source/System/FabricCooker.cpp +++ b/Gems/NvCloth/Code/Source/System/FabricCooker.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -304,7 +305,7 @@ namespace NvCloth const AZ::Vector3& fabricGravity, bool useGeodesicTether) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); return Internal::Cook(particles, indices, fabricGravity, useGeodesicTether); } @@ -317,7 +318,7 @@ namespace NvCloth AZStd::vector& remappedVertices, bool removeStaticTriangles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); // Weld vertices together AZStd::vector weldedParticles; diff --git a/Gems/NvCloth/Code/Source/System/Solver.cpp b/Gems/NvCloth/Code/Source/System/Solver.cpp index 6c20631409..3db9d3a1d9 100644 --- a/Gems/NvCloth/Code/Source/System/Solver.cpp +++ b/Gems/NvCloth/Code/Source/System/Solver.cpp @@ -110,7 +110,7 @@ namespace NvCloth AZ_Assert(!m_isSimulating, "Please make sure the ongoing simulation is finished before attempting to start a new one"); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); m_deltaTime = deltaTime; m_simulationCompletion.Reset(true /*isClearDependent*/); @@ -147,7 +147,7 @@ namespace NvCloth return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); // Waiting for the simulation pass completition. m_simulationCompletion.StartAndWaitForCompletion(); @@ -191,14 +191,14 @@ namespace NvCloth void Solver::ClothsSimulationJob::Process() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Cloth, "NvCloth::BeginSimulationJob"); + AZ_PROFILE_SCOPE(Cloth, "NvCloth::BeginSimulationJob"); if (m_solver->beginSimulation(m_deltaTime)) { // Setup the end simulation job. AZ::Job* endSimulationJob = AZ::CreateJobFunction([solver = m_solver] { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Cloth, "NvCloth::EndSimulationJob"); + AZ_PROFILE_SCOPE(Cloth, "NvCloth::EndSimulationJob"); solver->endSimulation(); }, true /*isAutoDelete*/); @@ -209,7 +209,7 @@ namespace NvCloth { AZ::Job* chunkSimulationJob = AZ::CreateJobFunction([solver = m_solver, chunkIndex] { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Cloth, "NvCloth::ChunkSimulationJob"); + AZ_PROFILE_SCOPE(Cloth, "NvCloth::ChunkSimulationJob"); solver->simulateChunk(chunkIndex); }, true /*isAutoDelete*/); @@ -241,7 +241,7 @@ namespace NvCloth { AZ::Job* eventSignalJob = AZ::CreateJobFunction([cloth, deltaTime = m_deltaTime] { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Cloth, "NvCloth::PostSimulationJob"); + AZ_PROFILE_SCOPE(Cloth, "NvCloth::PostSimulationJob"); // Update the cloth data after the simulation cloth->Update(); @@ -270,7 +270,7 @@ namespace NvCloth { AZ::Job* eventSignalJob = AZ::CreateJobFunction([cloth, deltaTime = m_deltaTime] { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Cloth, "NvCloth::PreSimulationJob"); + AZ_PROFILE_SCOPE(Cloth, "NvCloth::PreSimulationJob"); // Issue pre-simulation events cloth->m_preSimulationEvent.Signal(cloth->GetId(), deltaTime); diff --git a/Gems/NvCloth/Code/Source/System/SystemComponent.cpp b/Gems/NvCloth/Code/Source/System/SystemComponent.cpp index 083a866a4e..02a57cea6f 100644 --- a/Gems/NvCloth/Code/Source/System/SystemComponent.cpp +++ b/Gems/NvCloth/Code/Source/System/SystemComponent.cpp @@ -106,11 +106,11 @@ namespace NvCloth { if (detached) { - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::Cloth, AZ::Crc32(eventName), eventName); + AZ_PROFILE_INTERVAL_START(Cloth, AZ::Crc32(eventName), eventName); } else { - AZ_PROFILE_EVENT_BEGIN(AZ::Debug::ProfileCategory::Cloth, eventName); + AZ_PROFILE_BEGIN(Cloth, eventName); } return nullptr; } @@ -121,11 +121,11 @@ namespace NvCloth { if (detached) { - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::Cloth, AZ::Crc32(eventName)); + AZ_PROFILE_INTERVAL_END(Cloth, AZ::Crc32(eventName)); } else { - AZ_PROFILE_EVENT_END(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_END(); } } }; @@ -309,7 +309,7 @@ namespace NvCloth const AZStd::vector& initialParticles, const FabricCookedData& fabricCookedData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); FabricId fabricId = FindOrCreateFabric(fabricCookedData); if (!fabricId.IsValid()) @@ -403,7 +403,7 @@ namespace NvCloth float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); for (auto& solverIt : m_solvers) { diff --git a/Gems/NvCloth/Code/Source/System/TangentSpaceHelper.cpp b/Gems/NvCloth/Code/Source/System/TangentSpaceHelper.cpp index 3c47ad46fd..17d8c629e6 100644 --- a/Gems/NvCloth/Code/Source/System/TangentSpaceHelper.cpp +++ b/Gems/NvCloth/Code/Source/System/TangentSpaceHelper.cpp @@ -8,6 +8,8 @@ #include +#include + namespace NvCloth { namespace @@ -20,7 +22,7 @@ namespace NvCloth const AZStd::vector& indices, AZStd::vector& outNormals) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); if ((indices.size() % 3) != 0) { @@ -86,7 +88,7 @@ namespace NvCloth AZStd::vector& outTangents, AZStd::vector& outBitangents) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); if ((indices.size() % 3) != 0) { @@ -174,7 +176,7 @@ namespace NvCloth AZStd::vector& outBitangents, AZStd::vector& outNormals) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); if ((indices.size() % 3) != 0) { diff --git a/Gems/NvCloth/Code/Source/Utils/MeshAssetHelper.cpp b/Gems/NvCloth/Code/Source/Utils/MeshAssetHelper.cpp index da48485dfa..c95c8896ab 100644 --- a/Gems/NvCloth/Code/Source/Utils/MeshAssetHelper.cpp +++ b/Gems/NvCloth/Code/Source/Utils/MeshAssetHelper.cpp @@ -66,7 +66,7 @@ namespace NvCloth MeshNodeInfo& meshNodeInfo, MeshClothInfo& meshClothInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Cloth); + AZ_PROFILE_FUNCTION(Cloth); AZ::Data::Asset modelDataAsset; AZ::Render::MeshComponentRequestBus::EventResult( diff --git a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp index af929bbab3..f8f5f1991e 100644 --- a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp +++ b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp @@ -115,7 +115,7 @@ namespace PhysX void ForceRegionComponent::PostPhysicsSubTick(float fixedDeltaTime) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); for (auto entityId : m_entities) { diff --git a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp index d21bd02737..e4d64d4139 100644 --- a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp @@ -106,7 +106,7 @@ namespace PhysX AZStd::shared_ptr stream, [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); HeightFieldAsset* physXHeightFieldAsset = asset.GetAs(); if (!physXHeightFieldAsset) @@ -166,7 +166,7 @@ namespace PhysX bool HeightFieldAssetHandler::SaveAssetData(const AZ::Data::Asset& asset, AZ::IO::GenericStream* stream) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); HeightFieldAsset* physXHeightFieldAsset = asset.GetAs(); if (!physXHeightFieldAsset) diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index a47f0ba16f..bdd253d70c 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -529,7 +529,7 @@ namespace PhysX void PhysXScene::StartSimulation(float deltatime) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::StartSimulation"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::StartSimulation"); if (!IsEnabled()) { @@ -537,7 +537,7 @@ namespace PhysX } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "OnSceneSimulationStartEvent::Signaled"); + AZ_PROFILE_SCOPE(Physics, "OnSceneSimulationStartEvent::Signaled"); m_sceneSimuationStartEvent.Signal(m_sceneHandle, deltatime); } @@ -549,7 +549,7 @@ namespace PhysX void PhysXScene::FinishSimulation() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::FinishSimulation"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::FinishSimulation"); if (!IsEnabled()) { @@ -557,7 +557,7 @@ namespace PhysX } { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::CheckResults"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::CheckResults"); // Wait for the simulation to complete. // In the multithreaded environment we need to make sure we don't lock the scene for write here. @@ -569,7 +569,7 @@ namespace PhysX bool activeActorsEnabled = false; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::FetchResults"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::FetchResults"); PHYSX_SCENE_WRITE_LOCK(m_pxScene); activeActorsEnabled = m_pxScene->getFlags() & physx::PxSceneFlag::eENABLE_ACTIVE_ACTORS; @@ -580,7 +580,7 @@ namespace PhysX if (activeActorsEnabled) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::ActiveActors"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::ActiveActors"); PHYSX_SCENE_READ_LOCK(m_pxScene); @@ -602,7 +602,7 @@ namespace PhysX ClearDeferedDeletions(); { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "OnSceneSimulationFinishedEvent::Signaled"); + AZ_PROFILE_SCOPE(Physics, "OnSceneSimulationFinishedEvent::Signaled"); m_sceneSimuationFinishEvent.Signal(m_sceneHandle, m_currentDeltaTime); } @@ -1108,7 +1108,7 @@ namespace PhysX void PhysXScene::ProcessTriggerEvents() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::ProcessTriggerEvents"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::ProcessTriggerEvents"); AzPhysics::TriggerEventList& triggers = m_simulationEventCallback.GetQueuedTriggerEvents(); if (triggers.empty()) @@ -1135,7 +1135,7 @@ namespace PhysX void PhysXScene::ProcessCollisionEvents() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysXScene::ProcessCollisionEvents"); + AZ_PROFILE_SCOPE(Physics, "PhysXScene::ProcessCollisionEvents"); AzPhysics::CollisionEventList& collisions = m_simulationEventCallback.GetQueuedCollisionEvents(); if (collisions.empty()) @@ -1181,7 +1181,7 @@ namespace PhysX return; } - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, "PhysX::Statistics"); + AZ_PROFILE_SCOPE(Physics, "PhysX::Statistics"); physx::PxSimulationStatistics stats; @@ -1193,33 +1193,33 @@ namespace PhysX [[maybe_unused]] const char* RootCategory = "PhysX/%s/%s"; [[maybe_unused]] const char* ShapesSubCategory = "Shapes"; - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eSPHERE], RootCategory, ShapesSubCategory, "Sphere"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::ePLANE], RootCategory, ShapesSubCategory, "Plane"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eCAPSULE], RootCategory, ShapesSubCategory, "Capsule"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eBOX], RootCategory, ShapesSubCategory, "Box"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eCONVEXMESH], RootCategory, ShapesSubCategory, "ConvexMesh"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eTRIANGLEMESH], RootCategory, ShapesSubCategory, "TriangleMesh"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbShapes[PxGeometryType::eHEIGHTFIELD], RootCategory, ShapesSubCategory, "Heightfield"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eSPHERE], RootCategory, ShapesSubCategory, "Sphere"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::ePLANE], RootCategory, ShapesSubCategory, "Plane"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eCAPSULE], RootCategory, ShapesSubCategory, "Capsule"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eBOX], RootCategory, ShapesSubCategory, "Box"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eCONVEXMESH], RootCategory, ShapesSubCategory, "ConvexMesh"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eTRIANGLEMESH], RootCategory, ShapesSubCategory, "TriangleMesh"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbShapes[PxGeometryType::eHEIGHTFIELD], RootCategory, ShapesSubCategory, "Heightfield"); [[maybe_unused]] const char* ObjectsSubCategory = "Objects"; - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbActiveConstraints, RootCategory, ObjectsSubCategory, "ActiveConstraints"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbActiveDynamicBodies, RootCategory, ObjectsSubCategory, "ActiveDynamicBodies"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbActiveKinematicBodies, RootCategory, ObjectsSubCategory, "ActiveKinematicBodies"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbStaticBodies, RootCategory, ObjectsSubCategory, "StaticBodies"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbDynamicBodies, RootCategory, ObjectsSubCategory, "DynamicBodies"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbKinematicBodies, RootCategory, ObjectsSubCategory, "KinematicBodies"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbAggregates, RootCategory, ObjectsSubCategory, "Aggregates"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbArticulations, RootCategory, ObjectsSubCategory, "Articulations"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbActiveConstraints, RootCategory, ObjectsSubCategory, "ActiveConstraints"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbActiveDynamicBodies, RootCategory, ObjectsSubCategory, "ActiveDynamicBodies"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbActiveKinematicBodies, RootCategory, ObjectsSubCategory, "ActiveKinematicBodies"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbStaticBodies, RootCategory, ObjectsSubCategory, "StaticBodies"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbDynamicBodies, RootCategory, ObjectsSubCategory, "DynamicBodies"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbKinematicBodies, RootCategory, ObjectsSubCategory, "KinematicBodies"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbAggregates, RootCategory, ObjectsSubCategory, "Aggregates"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbArticulations, RootCategory, ObjectsSubCategory, "Articulations"); [[maybe_unused]] const char* SolverSubCategory = "Solver"; - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbAxisSolverConstraints, RootCategory, SolverSubCategory, "AxisSolverConstraints"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.compressedContactSize, RootCategory, SolverSubCategory, "CompressedContactSize"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.requiredContactConstraintMemory, RootCategory, SolverSubCategory, "RequiredContactConstraintMemory"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.peakConstraintMemory, RootCategory, SolverSubCategory, "PeakConstraintMemory"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbAxisSolverConstraints, RootCategory, SolverSubCategory, "AxisSolverConstraints"); + AZ_PROFILE_DATAPOINT(Physics, stats.compressedContactSize, RootCategory, SolverSubCategory, "CompressedContactSize"); + AZ_PROFILE_DATAPOINT(Physics, stats.requiredContactConstraintMemory, RootCategory, SolverSubCategory, "RequiredContactConstraintMemory"); + AZ_PROFILE_DATAPOINT(Physics, stats.peakConstraintMemory, RootCategory, SolverSubCategory, "PeakConstraintMemory"); [[maybe_unused]] const char* BroadphaseSubCategory = "Broadphase"; - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.getNbBroadPhaseAdds(), RootCategory, BroadphaseSubCategory, "BroadPhaseAdds"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.getNbBroadPhaseRemoves(), RootCategory, BroadphaseSubCategory, "BroadPhaseRemoves"); + AZ_PROFILE_DATAPOINT(Physics, stats.getNbBroadPhaseAdds(), RootCategory, BroadphaseSubCategory, "BroadPhaseAdds"); + AZ_PROFILE_DATAPOINT(Physics, stats.getNbBroadPhaseRemoves(), RootCategory, BroadphaseSubCategory, "BroadPhaseRemoves"); // Compute pair stats for all geometry types AZ::u32 ccdPairs = 0; @@ -1240,16 +1240,16 @@ namespace PhysX } [[maybe_unused]] const char* CollisionsSubCategory = "Collisions"; - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, ccdPairs, RootCategory, CollisionsSubCategory, "CCDPairs"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, modifiedPairs, RootCategory, CollisionsSubCategory, "ModifiedPairs"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, triggerPairs, RootCategory, CollisionsSubCategory, "TriggerPairs"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbDiscreteContactPairsTotal, RootCategory, CollisionsSubCategory, "DiscreteContactPairsTotal"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbDiscreteContactPairsWithCacheHits, RootCategory, CollisionsSubCategory, "DiscreteContactPairsWithCacheHits"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbDiscreteContactPairsWithContacts, RootCategory, CollisionsSubCategory, "DiscreteContactPairsWithContacts"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbNewPairs, RootCategory, CollisionsSubCategory, "NewPairs"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbLostPairs, RootCategory, CollisionsSubCategory, "LostPairs"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbNewTouches, RootCategory, CollisionsSubCategory, "NewTouches"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbLostTouches, RootCategory, CollisionsSubCategory, "LostTouches"); - AZ_PROFILE_DATAPOINT(AZ::Debug::ProfileCategory::Physics, stats.nbPartitions, RootCategory, CollisionsSubCategory, "Partitions"); + AZ_PROFILE_DATAPOINT(Physics, ccdPairs, RootCategory, CollisionsSubCategory, "CCDPairs"); + AZ_PROFILE_DATAPOINT(Physics, modifiedPairs, RootCategory, CollisionsSubCategory, "ModifiedPairs"); + AZ_PROFILE_DATAPOINT(Physics, triggerPairs, RootCategory, CollisionsSubCategory, "TriggerPairs"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbDiscreteContactPairsTotal, RootCategory, CollisionsSubCategory, "DiscreteContactPairsTotal"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbDiscreteContactPairsWithCacheHits, RootCategory, CollisionsSubCategory, "DiscreteContactPairsWithCacheHits"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbDiscreteContactPairsWithContacts, RootCategory, CollisionsSubCategory, "DiscreteContactPairsWithContacts"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbNewPairs, RootCategory, CollisionsSubCategory, "NewPairs"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbLostPairs, RootCategory, CollisionsSubCategory, "LostPairs"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbNewTouches, RootCategory, CollisionsSubCategory, "NewTouches"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbLostTouches, RootCategory, CollisionsSubCategory, "LostTouches"); + AZ_PROFILE_DATAPOINT(Physics, stats.nbPartitions, RootCategory, CollisionsSubCategory, "Partitions"); } } diff --git a/Gems/PhysX/Code/Source/System/PhysXJob.cpp b/Gems/PhysX/Code/Source/System/PhysXJob.cpp index d65f2b756e..597c8bea98 100644 --- a/Gems/PhysX/Code/Source/System/PhysXJob.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXJob.cpp @@ -19,7 +19,7 @@ namespace PhysX void PhysXJob::Process() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Physics, m_pxTask.getName()); + AZ_PROFILE_SCOPE(Physics, m_pxTask.getName()); m_pxTask.run(); m_pxTask.release(); } diff --git a/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.cpp b/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.cpp index f0182cdbcc..28981722b6 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.cpp @@ -45,11 +45,11 @@ namespace PhysX { if (!detached) { - AZ_PROFILE_EVENT_BEGIN(AZ::Debug::ProfileCategory::Physics, eventName); + AZ_PROFILE_BEGIN(Physics, eventName); } else { - AZ_PROFILE_INTERVAL_START(AZ::Debug::ProfileCategory::Physics, AZ::Crc32(eventName), eventName); + AZ_PROFILE_INTERVAL_START(Physics, AZ::Crc32(eventName), eventName); } return nullptr; } @@ -59,11 +59,11 @@ namespace PhysX { if (!detached) { - AZ_PROFILE_EVENT_END(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_END(); } else { - AZ_PROFILE_INTERVAL_END(AZ::Debug::ProfileCategory::Physics, AZ::Crc32(eventName)); + AZ_PROFILE_INTERVAL_END(Physics, AZ::Crc32(eventName)); } } } diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index cc55255e24..ba9cc58011 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -130,7 +130,7 @@ namespace PhysX void PhysXSystem::Simulate(float deltaTime) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (m_state != State::Initialized) { diff --git a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp index 831a7fdf1d..f9f5d63b2c 100644 --- a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp +++ b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp @@ -347,7 +347,7 @@ namespace PhysXDebug static const physx::PxRenderBuffer& GetRenderBuffer(physx::PxScene* physxScene) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); PHYSX_SCENE_READ_LOCK(physxScene); return physxScene->getRenderBuffer(); } @@ -439,7 +439,7 @@ namespace PhysXDebug return; } - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); m_currentTime = time; bool dirty = true; @@ -620,7 +620,7 @@ namespace PhysXDebug void SystemComponent::ConfigurePhysXVisualizationParameters() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (physx::PxScene* physxScene = GetCurrentPxScene()) { @@ -667,7 +667,7 @@ namespace PhysXDebug void SystemComponent::ConfigureCullingBox() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); // Currently using the Cry view camera to support Editor, Game and Launcher modes. This will be updated in due course. const AZ::Vector3 cameraTranslation = GetViewCameraPosition(); @@ -694,7 +694,7 @@ namespace PhysXDebug void SystemComponent::GatherTriangles(const physx::PxRenderBuffer& rb) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (!m_settings.m_visualizationEnabled) { return; @@ -728,7 +728,7 @@ namespace PhysXDebug void SystemComponent::GatherLines(const physx::PxRenderBuffer& rb) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (!m_settings.m_visualizationEnabled) { @@ -763,7 +763,7 @@ namespace PhysXDebug void SystemComponent::GatherJointLimits() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); physx::PxScene* scene = GetCurrentPxScene(); @@ -824,7 +824,7 @@ namespace PhysXDebug void SystemComponent::DrawDebugCullingBox(const AZ::Aabb& cullingBoxAabb) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); if (m_settings.m_visualizationEnabled && m_culling.m_boxWireframe) { @@ -842,7 +842,7 @@ namespace PhysXDebug AZ::Color SystemComponent::MapOriginalPhysXColorToUserDefinedValues(const physx::PxU32& originalColor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); // color mapping from PhysX to LY user preference: \PhysX_3.4\Include\common\PxRenderBuffer.h switch (static_cast(originalColor)) @@ -878,7 +878,7 @@ namespace PhysXDebug void SystemComponent::InitPhysXColorMappings() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Physics); + AZ_PROFILE_FUNCTION(Physics); m_colorMappings.m_defaultColor.FromU32(physx::PxDebugColor::eARGB_GREEN); m_colorMappings.m_black.FromU32(physx::PxDebugColor::eARGB_BLACK); m_colorMappings.m_red.FromU32(physx::PxDebugColor::eARGB_RED); diff --git a/Gems/RADTelemetry/Code/Source/ProfileTelemetryComponent.cpp b/Gems/RADTelemetry/Code/Source/ProfileTelemetryComponent.cpp index b76d36d189..7e38f76592 100644 --- a/Gems/RADTelemetry/Code/Source/ProfileTelemetryComponent.cpp +++ b/Gems/RADTelemetry/Code/Source/ProfileTelemetryComponent.cpp @@ -312,7 +312,7 @@ namespace RADTelemetry using MaskType = AZ::Debug::ProfileCategoryPrimitiveType; // Set all the category bits "below" FirstDetailedCategory and do not enable memory capture by default - return (static_cast(1) << static_cast(AZ::Debug::ProfileCategory::FirstDetailedCategory)) - 1; + return (static_cast(1) << static_cast(FirstDetailedCategory)) - 1; } AZ::Debug::ProfileCategoryPrimitiveType ProfileTelemetryComponent::GetDefaultCaptureMask() diff --git a/Gems/RADTelemetry/Code/Source/RADTelemetryModule.cpp b/Gems/RADTelemetry/Code/Source/RADTelemetryModule.cpp index 56dc8f310a..dc23505833 100644 --- a/Gems/RADTelemetry/Code/Source/RADTelemetryModule.cpp +++ b/Gems/RADTelemetry/Code/Source/RADTelemetryModule.cpp @@ -48,7 +48,7 @@ namespace RADTelemetry } // Mask off the memory capture flag and add it back if memory capture is enabled - const MaskType fullCaptureMask = (maskCvarValue & ~AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(AZ::Debug::ProfileCategory::MemoryReserved)) | (s_memCaptureEnabled ? AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(AZ::Debug::ProfileCategory::MemoryReserved) : 0); + const MaskType fullCaptureMask = (maskCvarValue & ~AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(MemoryReserved)) | (s_memCaptureEnabled ? AZ_PROFILE_CAT_TO_RAD_CAPFLAGS(MemoryReserved) : 0); TelemetryRequestBus::Broadcast(&TelemetryRequests::SetCaptureMask, fullCaptureMask); } diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshBuilder.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshBuilder.cpp index acbc9ee46e..0f967f644e 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshBuilder.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshBuilder.cpp @@ -250,7 +250,7 @@ namespace AZ::MeshBuilder AZ::JobContext* jobContext = nullptr; AZ::Job* job = AZ::CreateJobFunction([&subMesh]() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Animation, "MeshBuilder::GenerateSubMeshVertexOrders::SubMeshJob"); + AZ_PROFILE_SCOPE(Animation, "MeshBuilder::GenerateSubMeshVertexOrders::SubMeshJob"); subMesh->GenerateVertexOrder(); }, true, jobContext); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 43ef9b3d3a..e7dc2343f2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -706,7 +706,7 @@ namespace ScriptCanvasEditor bool savedSuccess; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvasAssetHandler::SaveAssetData"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvasAssetHandler::SaveAssetData"); ScriptCanvasMemoryAsset cloneAsset; m_sourceAsset->CloneTo(cloneAsset); @@ -716,14 +716,14 @@ namespace ScriptCanvasEditor stream.Close(); if (savedSuccess) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement"); + AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement"); AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); const bool targetFileExists = fileIO->Exists(m_saveInfo.m_streamName.data()); bool removedTargetFile; { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RemoveTarget"); + AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RemoveTarget"); removedTargetFile = fileIO->Remove(m_saveInfo.m_streamName.data()); } @@ -733,7 +733,7 @@ namespace ScriptCanvasEditor } else { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RenameTempFile"); + AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RenameTempFile"); AZ::IO::Result renameResult = fileIO->Rename(tempPath.data(), m_saveInfo.m_streamName.data()); if (!renameResult) { diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index 24daf5b2b0..388da67987 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -103,7 +103,7 @@ namespace ScriptCanvasEditor void UndoHelper::Undo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); if (sceneUndoState) @@ -123,7 +123,7 @@ namespace ScriptCanvasEditor void UndoHelper::Redo() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); if (sceneUndoState) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp index 15df6b0261..bb3a28099e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeCreateUtils.cpp @@ -99,7 +99,7 @@ namespace ScriptCanvasEditor::Nodes AZStd::pair CreateAndGetNode(const AZ::Uuid& classId, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const StyleConfiguration& styleConfiguration, AZStd::function onCreateCallback) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; ScriptCanvas::Node* node{}; @@ -134,7 +134,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateObjectMethodNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId, ScriptCanvas::PropertyStatus propertyStatus) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIds; ScriptCanvas::Node* node = nullptr; @@ -161,7 +161,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateObjectMethodOverloadNode(AZStd::string_view className, AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasGraphId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIds; ScriptCanvas::Node* node = nullptr; @@ -188,7 +188,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateGlobalMethodNode(AZStd::string_view methodName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIds; ScriptCanvas::Node* node = nullptr; @@ -215,7 +215,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateEbusWrapperNode(AZStd::string_view busName, const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; ScriptCanvas::Node* node = nullptr; @@ -241,7 +241,7 @@ namespace ScriptCanvasEditor::Nodes { AZ_Assert(assetId.IsValid(), "CreateScriptEventReceiverNode asset Id must be valid"); - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); @@ -276,7 +276,7 @@ namespace ScriptCanvasEditor::Nodes { AZ_Assert(assetId.IsValid(), "CreateScriptEventSenderNode asset Id must be valid"); - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); @@ -302,7 +302,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateGetVariableNode(const ScriptCanvas::VariableId& variableId, ScriptCanvas::ScriptCanvasId scriptCanvasId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); const AZ::Uuid k_VariableNodeTypeId = azrtti_typeid(); NodeIdPair nodeIds; @@ -333,7 +333,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateSetVariableNode(const ScriptCanvas::VariableId& variableId, ScriptCanvas::ScriptCanvasId scriptCanvasId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); const AZ::Uuid k_VariableNodeTypeId = azrtti_typeid(); NodeIdPair nodeIds; @@ -366,7 +366,7 @@ namespace ScriptCanvasEditor::Nodes { AZ_Assert(assetId.IsValid(), "CreateFunctionNode source asset Id must be valid"); - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::PreLoad); @@ -394,7 +394,7 @@ namespace ScriptCanvasEditor::Nodes NodeIdPair CreateAzEventHandlerNode(const AZ::BehaviorMethod& methodWithAzEventReturn, ScriptCanvas::ScriptCanvasId scriptCanvasId, AZ::EntityId connectingMethodNodeId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeIdPair nodeIdPair; // Make sure the method returns an AZ::Event by reference or pointer diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index c045a1c0da..65129e4054 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -57,7 +57,7 @@ namespace ScriptCanvasEditor::Nodes // Handles the creation of a node through the node configurations for most nodes. AZ::EntityId DisplayGeneralScriptCanvasNode(AZ::EntityId, const ScriptCanvas::Node* node, const NodeConfiguration& nodeConfiguration) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); AZ::Entity* graphCanvasEntity = nullptr; @@ -445,7 +445,7 @@ namespace ScriptCanvasEditor::Nodes AZ::EntityId DisplayEbusEventNode(AZ::EntityId, const AZStd::string& busName, const AZStd::string& eventName, const ScriptCanvas::EBusEventId& eventId) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); AZ::EntityId graphCanvasNodeId; @@ -668,7 +668,7 @@ namespace ScriptCanvasEditor::Nodes AZ::EntityId DisplayScriptEventNode(AZ::EntityId, const AZ::Data::AssetId assetId, const ScriptEvents::Method& methodDefinition) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); AZ::EntityId graphCanvasNodeId; @@ -1001,7 +1001,7 @@ namespace ScriptCanvasEditor::Nodes AZ::EntityId DisplayGetVariableNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::GetVariableNode* variableNode) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeConfiguration nodeConfiguration; nodeConfiguration.PopulateComponentDescriptors(); @@ -1033,7 +1033,7 @@ namespace ScriptCanvasEditor::Nodes AZ::EntityId DisplaySetVariableNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Nodes::Core::SetVariableNode* variableNode) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); NodeConfiguration nodeConfiguration; nodeConfiguration.PopulateComponentDescriptors(); @@ -1069,7 +1069,7 @@ namespace ScriptCanvasEditor::Nodes /////////////////// AZ::EntityId DisplayScriptCanvasNode(AZ::EntityId graphCanvasGraphId, const ScriptCanvas::Node* node) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); AZ::EntityId graphCanvasNodeId; if (azrtti_istypeof(node)) @@ -1122,7 +1122,7 @@ namespace ScriptCanvasEditor::Nodes static void RegisterAndActivateGraphCanvasSlot(AZ::EntityId graphCanvasNodeId, const ScriptCanvas::SlotId& slotId, AZ::Entity* slotEntity) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); if (slotEntity) { slotEntity->Init(); @@ -1166,7 +1166,7 @@ namespace ScriptCanvasEditor::Nodes return AZ::EntityId(); } - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); AZ::Entity* slotEntity = nullptr; AZ::Uuid typeId = ScriptCanvas::Data::ToAZType(slot.GetDataType()); @@ -1258,7 +1258,7 @@ namespace ScriptCanvasEditor::Nodes::SlotDisplayHelper { AZ::EntityId DisplayPropertySlot(AZ::EntityId graphCanvasNodeId, const ScriptCanvas::VisualExtensionSlotConfiguration& propertyConfiguration) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); GraphCanvas::SlotConfiguration graphCanvasConfiguration; @@ -1284,7 +1284,7 @@ namespace ScriptCanvasEditor::Nodes::SlotDisplayHelper AZ::EntityId DisplayExtendableSlot(AZ::EntityId graphCanvasNodeId, const ScriptCanvas::VisualExtensionSlotConfiguration& extenderConfiguration) { - AZ_PROFILE_TIMER("ScriptCanvas", __FUNCTION__); + AZ_PROFILE_SCOPE("ScriptCanvas", __FUNCTION__); GraphCanvas::ExtenderSlotConfiguration graphCanvasConfiguration; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/EBusHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/EBusHandler.cpp index d878415341..bd19482dd8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/EBusHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/EBusHandler.cpp @@ -115,7 +115,7 @@ namespace ScriptCanvas void EBusHandler::OnEventGenericHook(void* userData, const char* eventName, int eventIndex, AZ::BehaviorValueParameter* result, int numParameters, AZ::BehaviorValueParameter* parameters) { AZ_UNUSED(eventName); - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "EBusEventHandler::OnEvent %s", eventName); + AZ_PROFILE_SCOPE(ScriptCanvas, "EBusEventHandler::OnEvent %s", eventName); auto handler = reinterpret_cast(userData); SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT(handler->GetScriptCanvasId(), handler->GetAssetId()); handler->OnEvent(nullptr, eventIndex, result, numParameters, parameters); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index 6e87e52f87..5aac3715eb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -1022,7 +1022,7 @@ namespace ScriptCanvas void Node::SetToDefaultValueOfType(const SlotId& slotId) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::SetToDefaultValueOfType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::SetToDefaultValueOfType"); Slot* slot = GetSlot(slotId); @@ -1616,7 +1616,7 @@ namespace ScriptCanvas Data::Type Node::GetSlotDataType(const SlotId& slotId) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlotDataType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlotDataType"); const auto* slot = GetSlot(slotId); @@ -1631,7 +1631,7 @@ namespace ScriptCanvas VariableId Node::GetSlotVariableId(const SlotId& slotId) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlotVariableId"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlotVariableId"); Slot* slot = GetSlot(slotId); @@ -1645,7 +1645,7 @@ namespace ScriptCanvas void Node::SetSlotVariableId(const SlotId& slotId, const VariableId& variableId) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::SetSlotVariableId"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::SetSlotVariableId"); Slot* slot = GetSlot(slotId); @@ -1664,7 +1664,7 @@ namespace ScriptCanvas void Node::ClearSlotVariableId(const SlotId& slotId) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::ResetSlotVariableId"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::ResetSlotVariableId"); SetSlotVariableId(slotId, VariableId()); } @@ -1861,7 +1861,7 @@ namespace ScriptCanvas AZStd::vector Node::GetAllSlotsByDescriptor(const SlotDescriptor& slotDescriptor, bool allowLatentSlots) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlotsByType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlotsByType"); AZStd::vector slots; @@ -1879,7 +1879,7 @@ namespace ScriptCanvas AZStd::vector Node::GetAllEndpointsByDescriptor(const SlotDescriptor& slotDescriptor, bool allowLatentSlots) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetEndpointsByType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetEndpointsByType"); AZStd::vector endpoints; @@ -1898,7 +1898,7 @@ namespace ScriptCanvas AZStd::vector Node::GetSlotIds(AZStd::string_view slotName) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlotIds"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlotIds"); auto nameSlotRange = m_slotNameMap.equal_range(slotName); AZStd::vector result; @@ -1911,7 +1911,7 @@ namespace ScriptCanvas Slot* Node::GetSlot(const SlotId& slotId) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlot"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlot"); if (slotId.IsValid()) { @@ -1994,7 +1994,7 @@ namespace ScriptCanvas AZStd::vector Node::GetAllSlots() const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetAllSlots"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetAllSlots"); const SlotList& slots = GetSlots(); @@ -2011,7 +2011,7 @@ namespace ScriptCanvas AZStd::vector Node::ModAllSlots() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::ModAllSlots"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::ModAllSlots"); SlotList& slots = GetSlots(); @@ -2408,7 +2408,7 @@ namespace ScriptCanvas NodePtrConstList Node::FindConnectedNodesByDescriptor(const SlotDescriptor& slotDescriptor, bool followLatentConnections) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodesByType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodesByType"); NodePtrConstList connectedNodes; @@ -2427,7 +2427,7 @@ namespace ScriptCanvas AZStd::vector> Node::FindConnectedNodesAndSlotsByDescriptor(const SlotDescriptor& slotDescriptor, bool followLatentConnections) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodesAndSlotsByType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodesAndSlotsByType"); AZStd::vector> connectedNodes; @@ -2593,7 +2593,7 @@ namespace ScriptCanvas void Node::OnDatumEdited(const Datum* datum) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::OnDatumChanged"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::OnDatumChanged"); SlotId slotId; @@ -2788,7 +2788,7 @@ namespace ScriptCanvas SlotId Node::FindSlotIdForDescriptor(AZStd::string_view slotName, const SlotDescriptor& descriptor) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::FindSlotIdForDescriptor"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::FindSlotIdForDescriptor"); auto slotNameRange = m_slotNameMap.equal_range(slotName); auto nameSlotIt = AZStd::find_if(slotNameRange.first, slotNameRange.second, [descriptor](const AZStd::pair& nameSlotPair) @@ -2801,7 +2801,7 @@ namespace ScriptCanvas int Node::FindSlotIndex(const SlotId& slotId) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::FindSlotIndex"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::FindSlotIndex"); auto slotIdIter = m_slotIdIteratorCache.find(slotId); @@ -2816,7 +2816,7 @@ namespace ScriptCanvas bool Node::IsConnected(const Slot& slot) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::IsConnected"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::IsConnected"); return slot.IsVariableReference() || m_graphRequestBus->IsEndpointConnected(slot.GetEndpoint()); } @@ -2862,7 +2862,7 @@ namespace ScriptCanvas EndpointsResolved Node::GetConnectedNodes(const Slot& slot) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodes"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetConnectedNodes"); EndpointsResolved connectedNodes; @@ -2906,7 +2906,7 @@ namespace ScriptCanvas AZStd::vector> Node::ModConnectedNodes(const Slot& slot) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::ModConnectedNodes"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::ModConnectedNodes"); AZStd::vector> connectedNodes; ModConnectedNodes(slot, connectedNodes); return connectedNodes; @@ -3481,7 +3481,7 @@ namespace ScriptCanvas AZStd::vector Node::GetSlotsByType(CombinedSlotType slotType) const { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::Node::GetSlotsByType"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::Node::GetSlotsByType"); AZStd::vector slots; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index ac19028fd5..89c69ee4c5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -61,7 +61,7 @@ namespace ScriptCanvas void RuntimeComponent::Execute() { - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); + AZ_PROFILE_SCOPE(ScriptCanvas, "RuntimeComponent::Execute (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); AZ_Assert(m_executionState, "RuntimeComponent::Execute called without an execution state"); SC_EXECUTION_TRACE_GRAPH_ACTIVATED(CreateActivationInfo()); SCRIPT_CANVAS_PERFORMANCE_SCOPE_EXECUTION(m_executionState->GetScriptCanvasId(), m_runtimeOverrides.m_runtimeAsset.GetId()); @@ -117,7 +117,7 @@ namespace ScriptCanvas AZ_Assert(m_runtimeAsset.Get(), "RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().data()); #endif - AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); + AZ_PROFILE_SCOPE(ScriptCanvas, "RuntimeComponent::InitializeExecution (%s)", m_runtimeOverrides.m_runtimeAsset.GetId().ToString().c_str()); SCRIPT_CANVAS_PERFORMANCE_SCOPE_INITIALIZATION(m_scriptCanvasId, m_runtimeOverrides.m_runtimeAsset.GetId()); m_executionState = ExecutionState::Create(ExecutionStateConfig(m_runtimeOverrides.m_runtimeAsset, *this)); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp index 8c8eac5e1b..d6454ef4a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodeables/BaseTimer.cpp @@ -46,7 +46,7 @@ namespace ScriptCanvas void BaseTimer::OnTick(float delta, AZ::ScriptTimePoint) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT(GetScriptCanvasId(), GetAssetId()); switch (m_timeUnits) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp index b2741f4498..552e04a850 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Internal/Nodes/StringFormatted.cpp @@ -191,7 +191,7 @@ namespace ScriptCanvas AZStd::string StringFormatted::ProcessFormat() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::ScriptCanvas, "ScriptCanvas::StringFormatted::ProcessFormat"); + AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvas::StringFormatted::ProcessFormat"); AZStd::string text; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp index abbb4d8b6c..06ccb617ff 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Math/OperatorMul.cpp @@ -58,7 +58,7 @@ namespace ScriptCanvas void OperatorMul::Operator(Data::eType type, const ArithmeticOperands& operands, Datum& result) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); switch (type) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.cpp index 168b6d825a..c7842f28fd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DelayNodeable.cpp @@ -49,7 +49,7 @@ namespace ScriptCanvas void DelayNodeable::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT(GetScriptCanvasId(), GetAssetId()); m_currentTime -= static_cast(deltaTime); if (m_currentTime <= 0.f) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.cpp index 942271ad3a..f7f08874db 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/DurationNodeable.cpp @@ -28,7 +28,7 @@ namespace ScriptCanvas void DurationNodeable::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT(GetScriptCanvasId(), GetAssetId()); if (m_elapsedTime <= m_duration) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.cpp index db50f66f35..37d4d026c1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/TimerNodeable.cpp @@ -16,7 +16,7 @@ namespace ScriptCanvas { void TimerNodeable::OnTick(float /*deltaTime*/, AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ScriptCanvas); + AZ_PROFILE_FUNCTION(ScriptCanvas); SCRIPT_CANVAS_PERFORMANCE_SCOPE_LATENT(GetScriptCanvasId(), GetAssetId()); double milliseconds = time.GetMilliseconds() - m_start.GetMilliseconds(); double seconds = time.GetSeconds() - m_start.GetSeconds(); diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h b/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h index 18899ac3b1..c72f725a07 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/Utility/SurfaceDataUtility.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -33,7 +34,7 @@ namespace SurfaceData AZ::Vector3& outPosition, AZ::Vector3& outNormal) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const size_t vertexCount = vertices.size(); if (vertexCount > 0 && vertexCount % 4 == 0) diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp index 22328fc73f..eef9179194 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataColliderComponent.cpp @@ -184,7 +184,7 @@ namespace SurfaceData bool SurfaceDataColliderComponent::DoRayTrace(const AZ::Vector3& inPosition, bool queryPointOnly, AZ::Vector3& outPosition, AZ::Vector3& outNormal) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -249,7 +249,7 @@ namespace SurfaceData void SurfaceDataColliderComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -303,7 +303,7 @@ namespace SurfaceData void SurfaceDataColliderComponent::UpdateColliderData() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool colliderValidBeforeUpdate = false; bool colliderValidAfterUpdate = false; diff --git a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp index 6129094115..890f8fba54 100644 --- a/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Components/SurfaceDataShapeComponent.cpp @@ -143,7 +143,7 @@ namespace SurfaceData void SurfaceDataShapeComponent::GetSurfacePoints(const AZ::Vector3& inPosition, SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -168,7 +168,7 @@ namespace SurfaceData void SurfaceDataShapeComponent::ModifySurfacePoints(SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_cacheMutex); @@ -221,7 +221,7 @@ namespace SurfaceData void SurfaceDataShapeComponent::UpdateShapeData() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool shapeValidBeforeUpdate = false; bool shapeValidAfterUpdate = false; diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp index 356785df35..7638b6720e 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceDataSystemComponent.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -180,7 +181,7 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const bool hasDesiredTags = HasValidTags(desiredTags); const bool hasModifierTags = hasDesiredTags && HasMatchingTags(desiredTags, m_registeredModifierTags); @@ -228,7 +229,7 @@ namespace SurfaceData void SurfaceDataSystemComponent::GetSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, const SurfaceTagVector& desiredTags, SurfacePointListPerPosition& surfacePointListPerPosition) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard registrationLock(m_registrationMutex); @@ -317,7 +318,7 @@ namespace SurfaceData void SurfaceDataSystemComponent::CombineSortAndFilterNeighboringPoints(SurfacePointList& sourcePointList, bool hasDesiredTags, const SurfaceTagVector& desiredTags) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (sourcePointList.empty()) { diff --git a/Gems/SurfaceData/Code/Source/SurfaceDataUtility.cpp b/Gems/SurfaceData/Code/Source/SurfaceDataUtility.cpp index d55f79faea..ba21d0a616 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceDataUtility.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceDataUtility.cpp @@ -17,7 +17,7 @@ namespace SurfaceData const AZ::Vector3& rayStart, const AZ::Vector3& rayEnd, AZ::Vector3& outPosition, AZ::Vector3& outNormal) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const AZ::Vector3 clampedScale = nonUniformScale.GetMax(AZ::Vector3(AZ::MinTransformScale)); diff --git a/Gems/SurfaceData/Code/Source/SurfaceTag.cpp b/Gems/SurfaceData/Code/Source/SurfaceTag.cpp index 70a2669b19..f986509140 100644 --- a/Gems/SurfaceData/Code/Source/SurfaceTag.cpp +++ b/Gems/SurfaceData/Code/Source/SurfaceTag.cpp @@ -88,7 +88,7 @@ namespace SurfaceData AZStd::vector> SurfaceTag::GetRegisteredTags() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); SurfaceTagNameSet labels; SurfaceDataTagProviderRequestBus::Broadcast(&SurfaceDataTagProviderRequestBus::Events::GetRegisteredSurfaceTagNames, labels); @@ -134,7 +134,7 @@ namespace SurfaceData AZStd::vector> SurfaceTag::BuildSelectableTagList() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::vector> selectableTags = GetRegisteredTags(); @@ -152,7 +152,7 @@ namespace SurfaceData AZStd::string SurfaceTag::GetDisplayName() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::string name; FindDisplayName(GetRegisteredTags(), name); diff --git a/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp b/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp index 7ce1a2c0a3..4ffed260de 100644 --- a/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp +++ b/Gems/Vegetation/Code/Source/AreaSystemComponent.cpp @@ -617,7 +617,7 @@ namespace Vegetation void AreaSystemComponent::EnumerateInstancesInOverlappingSectors(const AZ::Aabb& bounds, AreaSystemEnumerateCallback callback) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (!bounds.IsValid()) { @@ -644,7 +644,7 @@ namespace Vegetation void AreaSystemComponent::EnumerateInstancesInAabb(const AZ::Aabb& bounds, AreaSystemEnumerateCallback callback) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (!bounds.IsValid()) { @@ -723,7 +723,7 @@ namespace Vegetation void AreaSystemComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (m_configuration.m_sectorSizeInMeters < 0) { @@ -792,7 +792,7 @@ namespace Vegetation m_threadData.m_vegetationThreadState = PersistentThreadData::VegetationThreadState::Running; auto job = AZ::CreateJobFunction([this]() { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Entity, "Vegetation::AreaSystemComponent::VegetationThread"); + AZ_PROFILE_SCOPE(Entity, "Vegetation::AreaSystemComponent::VegetationThread"); UpdateContext context; context.Run(&m_threadData, &m_vegTasks, &m_cachedMainThreadData); @@ -830,7 +830,7 @@ namespace Vegetation bool AreaSystemComponent::CalculateViewRect() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //Get the active camera. bool cameraPositionIsValid = false; @@ -983,7 +983,7 @@ namespace Vegetation void AreaSystemComponent::OnSystemEvent(ESystemEvent event, [[maybe_unused]] UINT_PTR wparam, [[maybe_unused]] UINT_PTR lparam) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); switch (event) { @@ -1016,7 +1016,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::ProcessVegetationThreadTasks(UpdateContext* context, PersistentThreadData* threadData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); VegetationThreadTasks::VegetationThreadTaskList tasks; { @@ -1056,7 +1056,7 @@ namespace Vegetation const AreaSystemComponent::SectorInfo* AreaSystemComponent::VegetationThreadTasks::GetSector(const SectorId& sectorId) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_sectorRollingWindowMutex); auto itSector = m_sectorRollingWindow.find(sectorId); @@ -1065,7 +1065,7 @@ namespace Vegetation AreaSystemComponent::SectorInfo* AreaSystemComponent::VegetationThreadTasks::GetSector(const SectorId& sectorId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_sectorRollingWindowMutex); auto itSector = m_sectorRollingWindow.find(sectorId); @@ -1074,7 +1074,7 @@ namespace Vegetation AreaSystemComponent::SectorInfo* AreaSystemComponent::VegetationThreadTasks::CreateSector(const SectorId& sectorId, int sectorDensity, int sectorSizeInMeters, SnapMode sectorPointSnapMode) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); SectorInfo sectorInfo; sectorInfo.m_id = sectorId; @@ -1089,7 +1089,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::UpdateSectorPoints(SectorInfo& sectorInfo, int sectorDensity, int sectorSizeInMeters, SnapMode sectorPointSnapMode) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const float vegStep = sectorSizeInMeters / static_cast(sectorDensity); //build a free list of all points in the sector for areas to consume @@ -1190,7 +1190,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::DeleteSector(const SectorId& sectorId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_sectorRollingWindowMutex); auto itSector = m_sectorRollingWindow.find(sectorId); @@ -1249,7 +1249,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::ReleaseUnregisteredClaims(SectorInfo& sectorInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (!m_unregisteredVegetationAreaSet.empty()) { @@ -1275,7 +1275,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::ReleaseUnusedClaims(SectorInfo& sectorInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::unordered_map> claimsToRelease; @@ -1310,7 +1310,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::FillSector(SectorInfo& sectorInfo, const VegetationAreaVector& activeAreas) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); VEG_PROFILE_METHOD(DebugNotificationBus::TryQueueBroadcast(&DebugNotificationBus::Events::FillSectorStart, sectorInfo.GetSectorX(), sectorInfo.GetSectorY(), AZStd::chrono::system_clock::now())); ReleaseUnregisteredClaims(sectorInfo); @@ -1352,7 +1352,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::EmptySector(SectorInfo& sectorInfo) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::unordered_map> claimsToRelease; @@ -1384,7 +1384,7 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::ClearSectors() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_sectorRollingWindowMutex); for (auto& sectorPair : m_sectorRollingWindow) @@ -1399,13 +1399,13 @@ namespace Vegetation void AreaSystemComponent::VegetationThreadTasks::CreateClaim(SectorInfo& sectorInfo, const ClaimHandle handle, const InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); sectorInfo.m_claimedWorldPoints[handle] = instanceData; } ClaimHandle AreaSystemComponent::VegetationThreadTasks::CreateClaimHandle(const SectorInfo& sectorInfo, uint32_t index) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); ClaimHandle handle = 0; AreaSystemUtil::hash_combine_64(handle, sectorInfo.m_id.first); @@ -1456,7 +1456,7 @@ namespace Vegetation void AreaSystemComponent::UpdateContext::Run(PersistentThreadData* threadData, VegetationThreadTasks* vegTasks, CachedMainThreadData* cachedMainThreadData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); // Ensure that the main thread doesn't activate or deactivate the component until after this thread finishes. // Note that this does *not* prevent the main thread from running OnTick, which can communicate data changes @@ -1466,7 +1466,7 @@ namespace Vegetation bool keepProcessing = true; while (keepProcessing && (threadData->m_vegetationThreadState != PersistentThreadData::VegetationThreadState::InterruptRequested)) { - AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Entity, "Vegetation::AreaSystemComponent::UpdateContext::Run-InnerLoop"); + AZ_PROFILE_SCOPE(Entity, "Vegetation::AreaSystemComponent::UpdateContext::Run-InnerLoop"); // Update thread state if its dirty PersistentThreadData::VegetationDataSyncState expected = PersistentThreadData::VegetationDataSyncState::Dirty; if (threadData->m_vegetationDataSyncState.compare_exchange_strong(expected, PersistentThreadData::VegetationDataSyncState::Updating)) @@ -1501,7 +1501,7 @@ namespace Vegetation void AreaSystemComponent::UpdateContext::UpdateActiveVegetationAreas(PersistentThreadData* threadData, const ViewRect& viewRect) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //build a priority sorted list of all active areas if (threadData->m_activeAreasDirty) @@ -1553,7 +1553,7 @@ namespace Vegetation bool AreaSystemComponent::UpdateContext::UpdateSectorWorkLists(PersistentThreadData* threadData, VegetationThreadTasks* vegTasks) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); auto& worldToSector = m_cachedMainThreadData.m_worldToSector; auto& currViewRect = m_cachedMainThreadData.m_currViewRect; @@ -1761,7 +1761,7 @@ namespace Vegetation bool AreaSystemComponent::UpdateContext::UpdateOneSector(PersistentThreadData* threadData, VegetationThreadTasks* vegTasks) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); // This chooses work in the following order: // 1) Delete if we have more sectors than the total that should be in the view rectangle diff --git a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp index d31a6be69d..8bf48de58e 100644 --- a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp @@ -220,7 +220,7 @@ namespace Vegetation bool AreaBlenderComponent::PrepareToClaim(EntityIdStack& stackIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool result = true; @@ -257,7 +257,7 @@ namespace Vegetation void AreaBlenderComponent::ClaimPositions(EntityIdStack& stackIds, ClaimContext& context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (context.m_availablePoints.empty()) { @@ -293,7 +293,7 @@ namespace Vegetation void AreaBlenderComponent::UnclaimPosition(const ClaimHandle handle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); if (!m_isRequestInProgress) @@ -311,7 +311,7 @@ namespace Vegetation AZ::Aabb AreaBlenderComponent::GetEncompassingAabb() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Aabb bounds = AZ::Aabb::CreateNull(); @@ -340,7 +340,7 @@ namespace Vegetation AZ::u32 AreaBlenderComponent::GetProductCount() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::u32 count = 0; diff --git a/Gems/Vegetation/Code/Source/Components/AreaComponentBase.cpp b/Gems/Vegetation/Code/Source/Components/AreaComponentBase.cpp index 6e87154e5b..6a9060c6d4 100644 --- a/Gems/Vegetation/Code/Source/Components/AreaComponentBase.cpp +++ b/Gems/Vegetation/Code/Source/Components/AreaComponentBase.cpp @@ -279,13 +279,13 @@ namespace Vegetation void AreaComponentBase::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& /*world*/) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); OnCompositionChanged(); } void AreaComponentBase::OnShapeChanged([[maybe_unused]] ShapeComponentNotifications::ShapeChangeReasons reasons) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); OnCompositionChanged(); } } diff --git a/Gems/Vegetation/Code/Source/Components/BlockerComponent.cpp b/Gems/Vegetation/Code/Source/Components/BlockerComponent.cpp index d980f7e45a..e26f1aee47 100644 --- a/Gems/Vegetation/Code/Source/Components/BlockerComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/BlockerComponent.cpp @@ -185,7 +185,7 @@ namespace Vegetation bool BlockerComponent::ClaimPosition(EntityIdStack& processedIds, const ClaimPoint& point, InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); #if VEG_BLOCKER_ENABLE_CACHING { @@ -245,7 +245,7 @@ namespace Vegetation void BlockerComponent::ClaimPositions(EntityIdStack& stackIds, ClaimContext& context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //adding entity id to the stack of entity ids affecting vegetation EntityIdStack emptyIds; @@ -285,7 +285,7 @@ namespace Vegetation AZ::Aabb BlockerComponent::GetEncompassingAabb() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Aabb bounds = AZ::Aabb::CreateNull(); LmbrCentral::ShapeComponentRequestsBus::EventResult(bounds, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetEncompassingAabb); diff --git a/Gems/Vegetation/Code/Source/Components/DescriptorListCombinerComponent.cpp b/Gems/Vegetation/Code/Source/Components/DescriptorListCombinerComponent.cpp index bcb42fb2e3..abdec31b98 100644 --- a/Gems/Vegetation/Code/Source/Components/DescriptorListCombinerComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/DescriptorListCombinerComponent.cpp @@ -187,7 +187,7 @@ namespace Vegetation void DescriptorListCombinerComponent::GetDescriptors(DescriptorPtrVec& descriptors) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); for (const auto& entityId : m_configuration.m_descriptorProviders) { @@ -200,7 +200,7 @@ namespace Vegetation void DescriptorListCombinerComponent::GetInclusionSurfaceTags(SurfaceData::SurfaceTagVector& tags, bool& includeAll) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); for (const auto& entityId : m_configuration.m_descriptorProviders) { @@ -213,7 +213,7 @@ namespace Vegetation void DescriptorListCombinerComponent::GetExclusionSurfaceTags(SurfaceData::SurfaceTagVector& tags) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); for (const auto& entityId : m_configuration.m_descriptorProviders) { diff --git a/Gems/Vegetation/Code/Source/Components/DescriptorWeightSelectorComponent.cpp b/Gems/Vegetation/Code/Source/Components/DescriptorWeightSelectorComponent.cpp index 5e4781302d..093de396dd 100644 --- a/Gems/Vegetation/Code/Source/Components/DescriptorWeightSelectorComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/DescriptorWeightSelectorComponent.cpp @@ -144,7 +144,7 @@ namespace Vegetation void DescriptorWeightSelectorComponent::SelectDescriptors(const DescriptorSelectorParams& params, DescriptorPtrVec& descriptors) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); switch (m_configuration.m_sortBehavior) { diff --git a/Gems/Vegetation/Code/Source/Components/DistanceBetweenFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/DistanceBetweenFilterComponent.cpp index 489862a797..e6d5701f64 100644 --- a/Gems/Vegetation/Code/Source/Components/DistanceBetweenFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/DistanceBetweenFilterComponent.cpp @@ -187,7 +187,7 @@ namespace Vegetation bool DistanceBetweenFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool intersects = false; diff --git a/Gems/Vegetation/Code/Source/Components/DistributionFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/DistributionFilterComponent.cpp index 18a83347d4..2505b243ad 100644 --- a/Gems/Vegetation/Code/Source/Components/DistributionFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/DistributionFilterComponent.cpp @@ -188,7 +188,7 @@ namespace Vegetation bool DistributionFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const GradientSignal::GradientSampleParams sampleParams(instanceData.m_position); const float noise = m_configuration.m_gradientSampler.GetValue(sampleParams); diff --git a/Gems/Vegetation/Code/Source/Components/MeshBlockerComponent.cpp b/Gems/Vegetation/Code/Source/Components/MeshBlockerComponent.cpp index 58f23bff72..52461e691c 100644 --- a/Gems/Vegetation/Code/Source/Components/MeshBlockerComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/MeshBlockerComponent.cpp @@ -197,7 +197,7 @@ namespace Vegetation bool MeshBlockerComponent::PrepareToClaim([[maybe_unused]] EntityIdStack& stackIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard cacheLock(m_cacheMutex); @@ -217,7 +217,7 @@ namespace Vegetation bool MeshBlockerComponent::ClaimPosition(EntityIdStack& processedIds, const ClaimPoint& point, InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard cacheLock(m_cacheMutex); @@ -283,7 +283,7 @@ namespace Vegetation void MeshBlockerComponent::ClaimPositions(EntityIdStack& stackIds, ClaimContext& context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //adding entity id to the stack of entity ids affecting vegetation EntityIdStack emptyIds; @@ -371,7 +371,7 @@ namespace Vegetation void MeshBlockerComponent::UpdateMeshData() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard cacheLock(m_cacheMutex); diff --git a/Gems/Vegetation/Code/Source/Components/PositionModifierComponent.cpp b/Gems/Vegetation/Code/Source/Components/PositionModifierComponent.cpp index 4d3b4f9867..17457786f2 100644 --- a/Gems/Vegetation/Code/Source/Components/PositionModifierComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/PositionModifierComponent.cpp @@ -281,7 +281,7 @@ namespace Vegetation void PositionModifierComponent::Execute(InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const GradientSignal::GradientSampleParams sampleParams(instanceData.m_position); float factorX = m_configuration.m_gradientSamplerX.GetValue(sampleParams); diff --git a/Gems/Vegetation/Code/Source/Components/RotationModifierComponent.cpp b/Gems/Vegetation/Code/Source/Components/RotationModifierComponent.cpp index df52222edb..1c13c08c2f 100644 --- a/Gems/Vegetation/Code/Source/Components/RotationModifierComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/RotationModifierComponent.cpp @@ -239,7 +239,7 @@ namespace Vegetation void RotationModifierComponent::Execute(InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const GradientSignal::GradientSampleParams sampleParams(instanceData.m_position); float factorX = m_configuration.m_gradientSamplerX.GetValue(sampleParams); diff --git a/Gems/Vegetation/Code/Source/Components/ScaleModifierComponent.cpp b/Gems/Vegetation/Code/Source/Components/ScaleModifierComponent.cpp index 74d11d6f6c..8c8099599d 100644 --- a/Gems/Vegetation/Code/Source/Components/ScaleModifierComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/ScaleModifierComponent.cpp @@ -162,7 +162,7 @@ namespace Vegetation void ScaleModifierComponent::Execute(InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const GradientSignal::GradientSampleParams sampleParams(instanceData.m_position); float factor = m_configuration.m_gradientSampler.GetValue(sampleParams); diff --git a/Gems/Vegetation/Code/Source/Components/ShapeIntersectionFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/ShapeIntersectionFilterComponent.cpp index 27dabfd76e..968d711e04 100644 --- a/Gems/Vegetation/Code/Source/Components/ShapeIntersectionFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/ShapeIntersectionFilterComponent.cpp @@ -147,7 +147,7 @@ namespace Vegetation bool ShapeIntersectionFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool inside = false; LmbrCentral::ShapeComponentRequestsBus::EventResult(inside, m_configuration.m_shapeEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::IsPointInside, instanceData.m_position); diff --git a/Gems/Vegetation/Code/Source/Components/SlopeAlignmentModifierComponent.cpp b/Gems/Vegetation/Code/Source/Components/SlopeAlignmentModifierComponent.cpp index 75a468b751..5e8e784bc6 100644 --- a/Gems/Vegetation/Code/Source/Components/SlopeAlignmentModifierComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SlopeAlignmentModifierComponent.cpp @@ -159,7 +159,7 @@ namespace Vegetation void SlopeAlignmentModifierComponent::Execute(InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const bool useOverrides = m_configuration.m_allowOverrides && instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->m_surfaceAlignmentOverrideEnabled; const float min = useOverrides ? instanceData.m_descriptorPtr->m_surfaceAlignmentMin : m_configuration.m_rangeMin; diff --git a/Gems/Vegetation/Code/Source/Components/SpawnerComponent.cpp b/Gems/Vegetation/Code/Source/Components/SpawnerComponent.cpp index b373edf051..404e425489 100644 --- a/Gems/Vegetation/Code/Source/Components/SpawnerComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SpawnerComponent.cpp @@ -206,7 +206,7 @@ namespace Vegetation bool SpawnerComponent::PrepareToClaim(EntityIdStack& stackIds) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //adding entity id to the stack of entity ids affecting vegetation EntityIdStack emptyIds; @@ -259,7 +259,7 @@ namespace Vegetation bool SpawnerComponent::CreateInstance([[maybe_unused]] const ClaimPoint &point, InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); instanceData.m_instanceId = InvalidInstanceId; if (instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->IsSpawnable()) @@ -279,7 +279,7 @@ namespace Vegetation bool SpawnerComponent::EvaluateFilters(EntityIdStack& processedIds, InstanceData& instanceData, const FilterStage intendedStage) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); bool accepted = true; for (const auto& id : processedIds) @@ -302,7 +302,7 @@ namespace Vegetation bool SpawnerComponent::ProcessInstance(EntityIdStack& processedIds, const ClaimPoint& point, InstanceData& instanceData, DescriptorPtr descriptorPtr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (!descriptorPtr) { @@ -353,7 +353,7 @@ namespace Vegetation bool SpawnerComponent::ClaimPosition(EntityIdStack& processedIds, const ClaimPoint& point, InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); #if VEG_SPAWNER_ENABLE_CACHING { @@ -413,7 +413,7 @@ namespace Vegetation void SpawnerComponent::ClaimPositions(EntityIdStack& stackIds, ClaimContext& context) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //reject entire spawner if there are inclusion tags to consider that don't exist in the context if (SurfaceData::HasValidTags(context.m_masks) && @@ -497,7 +497,7 @@ namespace Vegetation void SpawnerComponent::UnclaimPosition(const ClaimHandle handle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); InstanceId instanceId = InvalidInstanceId; { @@ -518,7 +518,7 @@ namespace Vegetation AZ::Aabb SpawnerComponent::GetEncompassingAabb() const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZ::Aabb bounds = AZ::Aabb::CreateNull(); LmbrCentral::ShapeComponentRequestsBus::EventResult(bounds, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetEncompassingAabb); @@ -533,7 +533,7 @@ namespace Vegetation void SpawnerComponent::OnCompositionChanged() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AreaComponentBase::OnCompositionChanged(); #if VEG_SPAWNER_ENABLE_CACHING @@ -546,7 +546,7 @@ namespace Vegetation void SpawnerComponent::DestroyAllInstances() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); ClaimInstanceMapping claimInstanceMapping; { diff --git a/Gems/Vegetation/Code/Source/Components/SurfaceAltitudeFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/SurfaceAltitudeFilterComponent.cpp index e2a1404bf1..1f1dfd7a54 100644 --- a/Gems/Vegetation/Code/Source/Components/SurfaceAltitudeFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SurfaceAltitudeFilterComponent.cpp @@ -175,7 +175,7 @@ namespace Vegetation bool SurfaceAltitudeFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const bool useOverrides = m_configuration.m_allowOverrides && instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->m_altitudeFilterOverrideEnabled; const float min = useOverrides ? instanceData.m_descriptorPtr->m_altitudeFilterMin : m_configuration.m_altitudeMin; diff --git a/Gems/Vegetation/Code/Source/Components/SurfaceMaskDepthFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/SurfaceMaskDepthFilterComponent.cpp index f4bd07e816..b4e65beb3f 100644 --- a/Gems/Vegetation/Code/Source/Components/SurfaceMaskDepthFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SurfaceMaskDepthFilterComponent.cpp @@ -203,7 +203,7 @@ namespace Vegetation bool SurfaceMaskDepthFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const bool useOverrides = m_configuration.m_allowOverrides && instanceData.m_descriptorPtr && !instanceData.m_descriptorPtr->m_surfaceTagDistance.m_tags.empty(); const SurfaceData::SurfaceTagVector& surfaceTagsToCompare = useOverrides ? instanceData.m_descriptorPtr->m_surfaceTagDistance.m_tags : m_configuration.m_depthComparisonTags; diff --git a/Gems/Vegetation/Code/Source/Components/SurfaceMaskFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/SurfaceMaskFilterComponent.cpp index 8dd9821cb1..9be6764460 100644 --- a/Gems/Vegetation/Code/Source/Components/SurfaceMaskFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SurfaceMaskFilterComponent.cpp @@ -268,7 +268,7 @@ namespace Vegetation bool SurfaceMaskFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //determine if tags provided by the component should be considered bool useCompTags = !m_configuration.m_allowOverrides || (instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->m_surfaceFilterOverrideMode != OverrideMode::Replace); diff --git a/Gems/Vegetation/Code/Source/Components/SurfaceSlopeFilterComponent.cpp b/Gems/Vegetation/Code/Source/Components/SurfaceSlopeFilterComponent.cpp index b99c2b7c81..fb0673bdf2 100644 --- a/Gems/Vegetation/Code/Source/Components/SurfaceSlopeFilterComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/SurfaceSlopeFilterComponent.cpp @@ -162,7 +162,7 @@ namespace Vegetation bool SurfaceSlopeFilterComponent::Evaluate(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); const bool useOverrides = m_configuration.m_allowOverrides && instanceData.m_descriptorPtr && instanceData.m_descriptorPtr->m_slopeFilterOverrideEnabled; const float min = useOverrides ? instanceData.m_descriptorPtr->m_slopeFilterMin : m_configuration.m_slopeMin; diff --git a/Gems/Vegetation/Code/Source/InstanceSystemComponent.cpp b/Gems/Vegetation/Code/Source/InstanceSystemComponent.cpp index 74fb2696ea..d4185fde6c 100644 --- a/Gems/Vegetation/Code/Source/InstanceSystemComponent.cpp +++ b/Gems/Vegetation/Code/Source/InstanceSystemComponent.cpp @@ -169,7 +169,7 @@ namespace Vegetation DescriptorPtr InstanceSystemComponent::RegisterUniqueDescriptor(const Descriptor& descriptor) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_uniqueDescriptorsMutex); @@ -217,7 +217,7 @@ namespace Vegetation void InstanceSystemComponent::ReleaseUniqueDescriptor(DescriptorPtr descriptorPtr) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard lock(m_uniqueDescriptorsMutex); @@ -267,7 +267,7 @@ namespace Vegetation void InstanceSystemComponent::CreateInstance(InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (!IsDescriptorValid(instanceData.m_descriptorPtr)) { @@ -299,7 +299,7 @@ namespace Vegetation void InstanceSystemComponent::DestroyInstance(InstanceId instanceId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (instanceId == InvalidInstanceId) { @@ -439,7 +439,7 @@ namespace Vegetation bool InstanceSystemComponent::IsInstanceSkippable(const InstanceData& instanceData) const { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); //if the instance was queued for deletion before its creation task executed then skip it AZStd::lock_guard instanceDeletionSet(m_instanceDeletionSetMutex); @@ -448,7 +448,7 @@ namespace Vegetation void InstanceSystemComponent::CreateInstanceNode(const InstanceData& instanceData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); if (IsInstanceSkippable(instanceData)) { @@ -489,7 +489,7 @@ namespace Vegetation void InstanceSystemComponent::ReleaseInstanceNode(InstanceId instanceId) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); DescriptorPtr descriptor = nullptr; InstancePtr opaqueInstanceData = nullptr; @@ -521,7 +521,7 @@ namespace Vegetation void InstanceSystemComponent::AddTask(const Task& task) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard mainThreadTaskLock(m_mainThreadTaskMutex); if (m_mainThreadTaskQueue.empty() || m_mainThreadTaskQueue.back().size() >= m_configuration.m_maxInstanceTaskBatchSize) @@ -534,7 +534,7 @@ namespace Vegetation void InstanceSystemComponent::ClearTasks() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard mainThreadTaskInProgressLock(m_mainThreadTaskInProgressMutex); AZStd::lock_guard mainThreadTaskLock(m_mainThreadTaskMutex); @@ -546,7 +546,7 @@ namespace Vegetation bool InstanceSystemComponent::GetTasks(TaskList& removedTasks) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard mainThreadTaskLock(m_mainThreadTaskMutex); if (!m_mainThreadTaskQueue.empty()) @@ -559,7 +559,7 @@ namespace Vegetation void InstanceSystemComponent::ExecuteTasks() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); AZStd::lock_guard scopedLock(m_mainThreadTaskInProgressMutex); @@ -588,7 +588,7 @@ namespace Vegetation void InstanceSystemComponent::ProcessMainThreadTasks() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity); + AZ_PROFILE_FUNCTION(Entity); ExecuteTasks(); } diff --git a/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp b/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp index 3bcd2dbd94..5ed409cd0d 100644 --- a/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp +++ b/Gems/WhiteBox/Code/Source/Core/WhiteBoxToolApi.cpp @@ -253,7 +253,7 @@ namespace OpenMesh::IO // return binary size of the value static size_t size_of(const value_type& _v) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (_v.empty()) { @@ -274,7 +274,7 @@ namespace OpenMesh::IO static size_t store(std::ostream& _os, const value_type& _v, bool _swap = false) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); size_t bytes = 0; const auto count = static_cast(_v.size()); @@ -291,7 +291,7 @@ namespace OpenMesh::IO static size_t restore(std::istream& _is, value_type& _v, bool _swap = false) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); size_t bytes = 0; uint32_t count = 0; @@ -325,7 +325,7 @@ namespace OpenMesh::IO // return binary size of the value static size_t size_of(const value_type& _v) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (_v.empty()) { @@ -347,7 +347,7 @@ namespace OpenMesh::IO static size_t store(std::ostream& _os, const value_type& _v, bool _swap = false) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); size_t bytes = 0; const auto count = static_cast(_v.size()); @@ -365,7 +365,7 @@ namespace OpenMesh::IO static size_t restore(std::istream& _is, value_type& _v, bool _swap = false) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); size_t bytes = 0; uint32_t count = 0; @@ -483,7 +483,7 @@ namespace WhiteBox FaceHandlesInternal InternalFaceHandlesFromPolygon(const Api::PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); FaceHandlesInternal faceHandlesInternal; faceHandlesInternal.reserve(polygonHandle.m_faceHandles.size()); @@ -586,7 +586,7 @@ namespace WhiteBox VertexHandles MeshVertexHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); VertexHandles vertexHandles; vertexHandles.reserve(whiteBox.mesh.n_vertices()); @@ -600,7 +600,7 @@ namespace WhiteBox FaceHandles MeshFaceHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); FaceHandles faceHandles; faceHandles.reserve(whiteBox.mesh.n_faces()); @@ -614,7 +614,7 @@ namespace WhiteBox PolygonHandles MeshPolygonHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); PolygonPropertyHandle polygonPropsHandle; whiteBox.mesh.get_property_handle(polygonPropsHandle, PolygonProps); @@ -637,7 +637,7 @@ namespace WhiteBox EdgeHandlesCollection PolygonBorderEdgeHandles(const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const HalfedgeHandlesCollection halfedgeHandlesCollection = PolygonBorderHalfedgeHandles(whiteBox, polygonHandle); @@ -663,7 +663,7 @@ namespace WhiteBox EdgeHandles PolygonBorderEdgeHandlesFlattened(const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const EdgeHandlesCollection borderEdgeHandlesCollection = PolygonBorderEdgeHandles(whiteBox, polygonHandle); @@ -679,7 +679,7 @@ namespace WhiteBox EdgeHandles MeshPolygonEdgeHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto polygonHandles = MeshPolygonHandles(whiteBox); @@ -698,7 +698,7 @@ namespace WhiteBox EdgeHandles MeshEdgeHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EdgeHandles edgeHandles; edgeHandles.reserve(whiteBox.mesh.n_edges()); @@ -712,7 +712,7 @@ namespace WhiteBox EdgeTypes MeshUserEdgeHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EdgeHandles userEdgeHandles = MeshPolygonEdgeHandles(whiteBox); AZStd::sort(userEdgeHandles.begin(), userEdgeHandles.end()); @@ -732,7 +732,7 @@ namespace WhiteBox AZStd::vector MeshVertexPositions(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return VertexPositions(whiteBox, MeshVertexHandles(whiteBox)); } @@ -794,7 +794,7 @@ namespace WhiteBox AZStd::vector FacesPositions(const WhiteBoxMesh& whiteBox, const FaceHandles& faceHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::vector triangles; triangles.reserve(faceHandles.size() * 3); @@ -866,7 +866,7 @@ namespace WhiteBox HalfedgeHandles VertexHalfedgeHandles(const WhiteBoxMesh& whiteBox, const VertexHandle vertexHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); HalfedgeHandles outgoingHandles = VertexOutgoingHalfedgeHandles(whiteBox, vertexHandle); HalfedgeHandles incomingHandles = VertexIncomingHalfedgeHandles(whiteBox, vertexHandle); @@ -881,7 +881,7 @@ namespace WhiteBox EdgeHandles VertexEdgeHandles(const WhiteBoxMesh& whiteBox, const VertexHandle vertexHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto omVertexHandle = om_vh(vertexHandle); @@ -898,7 +898,7 @@ namespace WhiteBox const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle, FaceHandles& faceHandles, const AZ::Vector3& normal) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto* const found_fh = AZStd::find(faceHandles.cbegin(), faceHandles.cend(), faceHandle); @@ -917,7 +917,7 @@ namespace WhiteBox static FaceHandle OppositeFaceHandle(const WhiteBoxMesh& whiteBox, const HalfedgeHandle halfedgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const HalfedgeHandle oppositeHalfedgeHandle = HalfedgeOppositeHalfedgeHandle(whiteBox, halfedgeHandle); @@ -936,7 +936,7 @@ namespace WhiteBox const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle, FaceHandles& faceHandles, const AZ::Vector3& normal) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (BuildFaceHandles(whiteBox, faceHandle, faceHandles, normal)) { @@ -957,7 +957,7 @@ namespace WhiteBox FaceHandles SideFaceHandles(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); FaceHandles faceHandles; SideFaceHandlesInternal( @@ -969,7 +969,7 @@ namespace WhiteBox static HalfedgeHandlesCollection BorderHalfedgeHandles( const WhiteBoxMesh& whiteBox, const FaceHandles& faceHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // build all possible halfedge handles HalfedgeHandles halfedgeHandles; @@ -1069,7 +1069,7 @@ namespace WhiteBox HalfedgeHandlesCollection SideBorderHalfedgeHandles(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // find all face handles for a side return BorderHalfedgeHandles(whiteBox, SideFaceHandles(whiteBox, faceHandle)); @@ -1078,7 +1078,7 @@ namespace WhiteBox static VertexHandlesCollection BorderVertexHandles( const WhiteBoxMesh& whiteBox, const HalfedgeHandlesCollection& halfedgeHandlesCollection) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); VertexHandlesCollection orderedVertexHandlesCollection; orderedVertexHandlesCollection.reserve(halfedgeHandlesCollection.size()); @@ -1101,14 +1101,14 @@ namespace WhiteBox VertexHandlesCollection SideBorderVertexHandles(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return BorderVertexHandles(whiteBox, SideBorderHalfedgeHandles(whiteBox, faceHandle)); } static VertexHandles FacesVertexHandles(const WhiteBoxMesh& whiteBox, const FaceHandles& faceHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); VertexHandles vertexHandles; for (const FaceHandle faceHandle : faceHandles) @@ -1132,7 +1132,7 @@ namespace WhiteBox VertexHandles SideVertexHandles(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return FacesVertexHandles(whiteBox, SideFaceHandles(whiteBox, faceHandle)); } @@ -1252,7 +1252,7 @@ namespace WhiteBox static bool EdgeIsUser( const WhiteBoxMesh& whiteBox, const HalfedgeHandle halfedgeHandle, const EdgeHandle edgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto polygonEdgeHandles = PolygonBorderEdgeHandlesFlattened( whiteBox, FacePolygonHandle(whiteBox, HalfedgeFaceHandle(whiteBox, halfedgeHandle))); @@ -1276,7 +1276,7 @@ namespace WhiteBox EdgeHandles EdgeGrouping(const WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // a non-user ('mesh') edge is never part of a grouping so if one is passed // in ensure we return an empty group @@ -1349,7 +1349,7 @@ namespace WhiteBox bool EdgeIsHidden(const WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const EdgeHandles userEdgeHandles = MeshPolygonEdgeHandles(whiteBox); return AZStd::find(userEdgeHandles.cbegin(), userEdgeHandles.cend(), edgeHandle) == userEdgeHandles.cend(); @@ -1357,7 +1357,7 @@ namespace WhiteBox AZStd::vector EdgeFaceHandles(const WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto openMeshEdgeHandle = om_eh(edgeHandle); const auto firstHalfedgeHandle = whiteBox.mesh.halfedge_handle(openMeshEdgeHandle, 0); @@ -1405,7 +1405,7 @@ namespace WhiteBox HalfedgeHandles EdgeHalfedgeHandles(const WhiteBoxMesh& whiteBox, EdgeHandle edgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZStd::array halfedgeHandles = { EdgeHalfedgeHandle(whiteBox, edgeHandle, EdgeHalfedge::First), @@ -1429,7 +1429,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "TranslateEdge eh(%s) %s", ToString(edgeHandle).c_str(), AZ::ToString(displacement).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto vertexHandles = EdgeVertexHandles(whiteBox, edgeHandle); for (const auto& vertexHandle : vertexHandles) @@ -1450,7 +1450,7 @@ namespace WhiteBox static HalfedgeHandle FindBestFitHalfedge( WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle, const AZ::Vector3& displacement) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // get both halfedge handles for the edge (0 and 1 just correspond to each halfedge) const HalfedgeHandle firstHalfedgeHandle = EdgeHalfedgeHandle(whiteBox, edgeHandle, EdgeHalfedge::First); @@ -1495,7 +1495,7 @@ namespace WhiteBox static Internal::EdgeAppendVertexHandles CalculateEdgeAppendVertexHandles( WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle, const AZ::Vector3& displacement) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // based on the displacement find which halfedge is a better fit (which direction did we move in) const HalfedgeHandle halfedgeHandle = FindBestFitHalfedge(whiteBox, edgeHandle, displacement); @@ -1575,7 +1575,7 @@ namespace WhiteBox static Internal::EdgeAppendPolygonHandles AddNewPolygonsForEdgeAppend( WhiteBoxMesh& whiteBox, const Internal::EdgeAppendVertexHandles& edgeAppendVertexHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); Internal::EdgeAppendPolygonHandles edgeAppendPolygonHandles; @@ -1636,7 +1636,7 @@ namespace WhiteBox static EdgeHandle FindSelectedEdgeHandle( const WhiteBoxMesh& whiteBox, const PolygonHandle& nearPolygonHandle, const PolygonHandle& farPolygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // actually find the new edge we created const EdgeHandles nearEdgeHandles = PolygonBorderEdgeHandlesFlattened(whiteBox, nearPolygonHandle); @@ -1670,7 +1670,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "TranslateEdgeAppend eh(%s) %s", ToString(edgeHandle).c_str(), AZ::ToString(displacement).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // the new and existing handles required for an edge append const Internal::EdgeAppendVertexHandles edgeAppendVertexHandles = @@ -1698,7 +1698,7 @@ namespace WhiteBox AZ::Vector3 PolygonNormal(const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return AZStd::accumulate( polygonHandle.m_faceHandles.cbegin(), polygonHandle.m_faceHandles.cend(), @@ -1712,7 +1712,7 @@ namespace WhiteBox PolygonHandle FacePolygonHandle(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); PolygonPropertyHandle polygonPropsHandle; whiteBox.mesh.get_property_handle(polygonPropsHandle, PolygonProps); @@ -1730,7 +1730,7 @@ namespace WhiteBox VertexHandles PolygonVertexHandles(const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return FacesVertexHandles(whiteBox, polygonHandle.m_faceHandles); } @@ -1738,7 +1738,7 @@ namespace WhiteBox VertexHandlesCollection PolygonBorderVertexHandles( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return BorderVertexHandles(whiteBox, PolygonBorderHalfedgeHandles(whiteBox, polygonHandle)); } @@ -1746,7 +1746,7 @@ namespace WhiteBox VertexHandles PolygonBorderVertexHandlesFlattened( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const VertexHandlesCollection borderVertexHandlesCollection = BorderVertexHandles(whiteBox, PolygonBorderHalfedgeHandles(whiteBox, polygonHandle)); @@ -1764,7 +1764,7 @@ namespace WhiteBox HalfedgeHandles PolygonBorderHalfedgeHandlesFlattened( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const HalfedgeHandlesCollection borderHalfedgeHandlesCollection = PolygonBorderHalfedgeHandles(whiteBox, polygonHandle); @@ -1781,7 +1781,7 @@ namespace WhiteBox HalfedgeHandles PolygonHalfedgeHandles(const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return AZStd::accumulate( polygonHandle.m_faceHandles.cbegin(), polygonHandle.m_faceHandles.cend(), HalfedgeHandles{}, @@ -1802,7 +1802,7 @@ namespace WhiteBox AZStd::vector PolygonVertexPositions( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return VertexPositions(whiteBox, PolygonVertexHandles(whiteBox, polygonHandle)); } @@ -1810,7 +1810,7 @@ namespace WhiteBox VertexPositionsCollection PolygonBorderVertexPositions( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto polygonBorderVertexHandlesCollection = PolygonBorderVertexHandles(whiteBox, polygonHandle); VertexPositionsCollection polygonBorderVertexPositionsCollection; @@ -1827,7 +1827,7 @@ namespace WhiteBox AZStd::vector PolygonFacesPositions( const WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return FacesPositions(whiteBox, polygonHandle.m_faceHandles); } @@ -1854,7 +1854,7 @@ namespace WhiteBox EdgeHandles VertexUserEdgeHandles(const WhiteBoxMesh& whiteBox, const VertexHandle vertexHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto vertexEdgeHandles = VertexEdgeHandles(whiteBox, vertexHandle); @@ -1874,7 +1874,7 @@ namespace WhiteBox static AZStd::vector VertexUserEdges( const WhiteBoxMesh& whiteBox, const VertexHandle vertexHandle, EdgeFn&& edgeFn) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto vertexEdgeHandles = VertexUserEdgeHandles(whiteBox, vertexHandle); @@ -1931,13 +1931,13 @@ namespace WhiteBox AZ::Vector3 FaceNormal(const WhiteBoxMesh& whiteBox, const FaceHandle faceHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return whiteBox.mesh.normal(om_fh(faceHandle)); } AZ::Vector2 HalfedgeUV(const WhiteBoxMesh& whiteBox, const HalfedgeHandle halfedgeHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return whiteBox.mesh.texcoord2D(om_heh(halfedgeHandle)); } @@ -1964,7 +1964,7 @@ namespace WhiteBox Faces MeshFaces(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); Faces faces; faces.reserve(MeshFaceCount(whiteBox)); @@ -1989,7 +1989,7 @@ namespace WhiteBox void CalculatePlanarUVs(WhiteBoxMesh& whiteBox, const FaceHandles& faceHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); auto& mesh = whiteBox.mesh; for (const auto faceHandle : faceHandles) @@ -2012,7 +2012,7 @@ namespace WhiteBox void CalculatePlanarUVs(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); CalculatePlanarUVs(whiteBox, MeshFaceHandles(whiteBox)); } @@ -2022,7 +2022,7 @@ namespace WhiteBox const HalfedgeHandle oppositeHalfedgeHandle, const HalfedgeHandles& borderHalfedgeHandles, const EdgeHandles& buildingEdgeHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // the polygon handle to build PolygonHandle polygonHandle; @@ -2119,7 +2119,7 @@ namespace WhiteBox WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle, EdgeHandles& restoringEdgeHandles) { WHITEBOX_LOG("White Box", "RestoreEdge eh(%s)", ToString(edgeHandle).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // check we're not selecting an existing user edge if (!EdgeIsHidden(whiteBox, edgeHandle)) @@ -2231,7 +2231,7 @@ namespace WhiteBox PolygonHandle HideEdge(WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle) { WHITEBOX_LOG("White Box", "HideEdge eh(%s)", ToString(edgeHandle).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (MeshHalfedgeCount(whiteBox) == 0) { @@ -2296,7 +2296,7 @@ namespace WhiteBox VertexHandle SplitFace(WhiteBoxMesh& whiteBox, const FaceHandle faceHandle, const AZ::Vector3& position) { WHITEBOX_LOG("White Box", "SplitFace fh(%s)", ToString(faceHandle).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto omFaceHandle = om_fh(faceHandle); const auto omVertexHandle = whiteBox.mesh.split_copy(omFaceHandle, position); @@ -2340,7 +2340,7 @@ namespace WhiteBox VertexHandle SplitEdge(WhiteBoxMesh& whiteBox, const EdgeHandle edgeHandle, const AZ::Vector3& position) { WHITEBOX_LOG("White Box", "SplitEdge eh(%s)", ToString(edgeHandle).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const HalfedgeHandle halfedgeHandle = EdgeHalfedgeHandle(whiteBox, edgeHandle, EdgeHalfedge::First); const VertexHandle tailVertexHandle = HalfedgeVertexHandleAtTail(whiteBox, halfedgeHandle); @@ -2441,7 +2441,7 @@ namespace WhiteBox void Clear(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); PolygonPropertyHandle polygonPropsHandle; whiteBox.mesh.get_property_handle(polygonPropsHandle, PolygonProps); @@ -2462,7 +2462,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "AddTriPolygon vh(%s), vh(%s), vh(%s)", ToString(vh0).c_str(), ToString(vh1).c_str(), ToString(vh2).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return AddPolygon(whiteBox, AZStd::vector{{vh0, vh1, vh2}}); } @@ -2474,7 +2474,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "AddQuadPolygon vh(%s), vh(%s), vh(%s), vh(%s)", ToString(vh0).c_str(), ToString(vh1).c_str(), ToString(vh2).c_str(), ToString(vh3).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return AddPolygon(whiteBox, AZStd::vector{{vh0, vh1, vh2}, {vh0, vh2, vh3}}); } @@ -2482,7 +2482,7 @@ namespace WhiteBox PolygonHandle AddPolygon(WhiteBoxMesh& whiteBox, const FaceVertHandlesList& faceVertHandles) { WHITEBOX_LOG("White Box", "AddPolygon [%s]", ToString(faceVertHandles).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); PolygonPropertyHandle polygonPropsHandle; whiteBox.mesh.get_property_handle(polygonPropsHandle, PolygonProps); @@ -2510,7 +2510,7 @@ namespace WhiteBox PolygonHandles InitializeAsUnitCube(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // generate vertices VertexHandle vertexHandles[8]; @@ -2550,7 +2550,7 @@ namespace WhiteBox PolygonHandle InitializeAsUnitQuad(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // generate vertices VertexHandle vertexHandles[4]; @@ -2573,7 +2573,7 @@ namespace WhiteBox PolygonHandle InitializeAsUnitTriangle(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // generate vertices VertexHandle vertexHandles[3]; @@ -2602,7 +2602,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "SetVertexPosition vh(%s) %s", ToString(vertexHandle).c_str(), AZ::ToString(position).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); whiteBox.mesh.set_point(om_vh(vertexHandle), position); } @@ -2613,7 +2613,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "SetVertexPositionAndUpdateUVs vh(%s) %s", ToString(vertexHandle).c_str(), AZ::ToString(position).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); SetVertexPosition(whiteBox, vertexHandle, position); CalculatePlanarUVs(whiteBox); @@ -2622,7 +2622,7 @@ namespace WhiteBox VertexHandle AddVertex(WhiteBoxMesh& whiteBox, const AZ::Vector3& vertex) { WHITEBOX_LOG("White Box", "AddVertex %s", AZ::ToString(vertex).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return wb_vh(whiteBox.mesh.add_vertex(vertex)); } @@ -2632,21 +2632,21 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "AddFace vh(%s), vh(%s), vh(%s)", ToString(v0).c_str(), ToString(v1).c_str(), ToString(v2).c_str()); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return wb_fh(whiteBox.mesh.add_face(om_vh(v0), om_vh(v1), om_vh(v2))); } void CalculateNormals(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); whiteBox.mesh.update_normals(); } void ZeroUVs(WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); for (const Mesh::FaceHandle faceHandle : whiteBox.mesh.faces()) { @@ -2692,7 +2692,7 @@ namespace WhiteBox AZ::Vector3 VerticesMidpoint(const WhiteBoxMesh& whiteBox, const VertexHandles& vertexHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AzToolsFramework::MidpointCalculator midpointCalculator; for (const auto vertexHandle : vertexHandles) @@ -2707,7 +2707,7 @@ namespace WhiteBox const WhiteBoxMesh& whiteBox, const Internal::VertexHandlePair vertexHandlePair, const PolygonHandle& selectedPolygonHandle, const PolygonHandle& adjacentPolygonHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto selectedPolygonEdgeHandles = PolygonBorderEdgeHandlesFlattened(whiteBox, selectedPolygonHandle); const auto adjacentPolygonEdgeHandles = PolygonBorderEdgeHandlesFlattened(whiteBox, adjacentPolygonHandle); @@ -2744,7 +2744,7 @@ namespace WhiteBox const PolygonHandle& selectedPolygonHandle, const PolygonHandle& adjacentPolygonHandle, FaceVertHandlesCollection& vertsForLinkingAdjacentPolygons) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // if we found a valid halfedge if (const HalfedgeHandle foundHalfedgeHandle = FindHalfedgeInAdjacentPolygon( @@ -2851,7 +2851,7 @@ namespace WhiteBox FaceVertHandlesCollection& vertsForExistingAdjacentPolygons, FaceVertHandlesCollection& vertsForLinkingAdjacentPolygons) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // adjacent faces for (size_t index = 0; index < borderVertexHandles.size(); ++index) @@ -2912,7 +2912,7 @@ namespace WhiteBox // during garbage_collect void RemoveFaces(WhiteBoxMesh& whiteBox, const FaceHandles& faceHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); whiteBox.mesh.request_face_status(); whiteBox.mesh.request_edge_status(); @@ -3014,7 +3014,7 @@ namespace WhiteBox AZStd::vector BuildNewVertexFaceHandles( WhiteBoxMesh& whiteBox, const Internal::AppendedVerts& appendedVerts, const FaceHandles& existingFaces) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::vector faces; faces.reserve(existingFaces.size()); @@ -3068,7 +3068,7 @@ namespace WhiteBox WhiteBoxMesh& whiteBox, const VertexHandles& existingVertexHandles, const PolygonHandle& polygonHandle, AppendVertFn&& appendFn) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::Vector3 polygonNormal = PolygonNormal(whiteBox, polygonHandle); const auto polygonHalfedgeHandles = PolygonHalfedgeHandles(whiteBox, polygonHandle); @@ -3146,7 +3146,7 @@ namespace WhiteBox static AppendedPolygonHandles Extrude( WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle, AppendVertexFn&& appendFn) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // find border vertex handles for polygon const auto polygonBorderVertexHandlesCollection = PolygonBorderVertexHandles(whiteBox, polygonHandle); @@ -3261,7 +3261,7 @@ namespace WhiteBox WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle, const float distance) { WHITEBOX_LOG("White Box", "TranslatePolygonAppend ph(%s) %f", ToString(polygonHandle).c_str(), distance) - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); return TranslatePolygonAppendAdvanced(whiteBox, polygonHandle, distance).m_appendedPolygonHandle; } @@ -3271,7 +3271,7 @@ namespace WhiteBox { WHITEBOX_LOG( "White Box", "TranslatePolygonAppendAdvanced ph(%s) %f", ToString(polygonHandle).c_str(), distance) - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // check mesh has faces if (whiteBox.mesh.n_faces() == 0) @@ -3288,7 +3288,7 @@ namespace WhiteBox void TranslatePolygon(WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle, const float distance) { WHITEBOX_LOG("White Box", "TranslatePolygon ph(%s) %d", ToString(polygonHandle).c_str(), distance) - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto vertexHandles = PolygonVertexHandles(whiteBox, polygonHandle); const auto vertexPositions = VertexPositions(whiteBox, vertexHandles); @@ -3306,7 +3306,7 @@ namespace WhiteBox WhiteBoxMesh& whiteBox, const PolygonHandle& polygonHandle, const float scale) { WHITEBOX_LOG("White Box", "ScalePolygonAppendRelative ph(%s) %f", ToString(polygonHandle).c_str(), scale); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // check mesh has faces if (whiteBox.mesh.n_faces() == 0) @@ -3329,7 +3329,7 @@ namespace WhiteBox static AZ::Transform BuildSpace(const AZ::Vector3& normal, const AZ::Vector3& pivot) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZ::Vector3 axis1; AZ::Vector3 axis2; @@ -3359,7 +3359,7 @@ namespace WhiteBox WHITEBOX_LOG( "White Box", "ScalePolygonRelative ph(%s) pivot %s scale: %f", ToString(polygonHandle).c_str(), AZ::ToString(pivot).c_str(), scaleDelta); - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const AZ::Transform polygonSpace = PolygonSpace(whiteBox, polygonHandle, pivot); for (const auto vertexHandle : PolygonVertexHandles(whiteBox, polygonHandle)) @@ -3375,7 +3375,7 @@ namespace WhiteBox bool WriteMesh(const WhiteBoxMesh& whiteBox, WhiteBoxMeshStream& output) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); AZStd::lock_guard lg(g_omSerializationLock); @@ -3399,7 +3399,7 @@ namespace WhiteBox ReadResult ReadMesh(WhiteBoxMesh& whiteBox, const WhiteBoxMeshStream& input) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (input.empty()) { @@ -3434,7 +3434,7 @@ namespace WhiteBox WhiteBoxMeshPtr CloneMesh(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WhiteBoxMeshStream clonedData; if (!WriteMesh(whiteBox, clonedData)) diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp index ad59da63d5..61796bde58 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp @@ -61,7 +61,7 @@ namespace WhiteBox // to be used to generate concrete render mesh static WhiteBoxRenderData CreateWhiteBoxRenderData(const WhiteBoxMesh& whiteBox, const WhiteBoxMaterial& material) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WhiteBoxRenderData renderData; WhiteBoxFaces& faceData = renderData.m_faces; @@ -407,7 +407,7 @@ namespace WhiteBox void EditorWhiteBoxComponent::RebuildRenderMesh() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // reset caches when the mesh changes m_worldAabb.reset(); @@ -474,7 +474,7 @@ namespace WhiteBox void EditorWhiteBoxComponent::OnTransformChanged( [[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); m_worldAabb.reset(); m_localAabb.reset(); @@ -490,7 +490,7 @@ namespace WhiteBox void EditorWhiteBoxComponent::RebuildPhysicsMesh() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); EditorWhiteBoxColliderRequestBus::Event( GetEntityId(), &EditorWhiteBoxColliderRequests::CreatePhysics, *GetWhiteBoxMesh()); @@ -673,7 +673,7 @@ namespace WhiteBox AZ::Aabb EditorWhiteBoxComponent::GetWorldBounds() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_worldAabb.has_value()) { @@ -686,7 +686,7 @@ namespace WhiteBox AZ::Aabb EditorWhiteBoxComponent::GetLocalBounds() { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_localAabb.has_value()) { @@ -708,7 +708,7 @@ namespace WhiteBox [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (!m_faces.has_value()) { @@ -905,7 +905,7 @@ namespace WhiteBox void EditorWhiteBoxComponent::DisplayEntityViewport( [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (DebugDrawingEnabled()) { diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentMode.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentMode.cpp index 3d04c87e6a..cd9e8090cd 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentMode.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentMode.cpp @@ -209,7 +209,7 @@ namespace WhiteBox bool EditorWhiteBoxComponentMode::HandleMouseInteraction( const AzToolsFramework::ViewportInteraction::MouseInteractionEvent& mouseInteraction) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WhiteBoxMesh* whiteBox = nullptr; EditorWhiteBoxComponentRequestBus::EventResult( @@ -301,7 +301,7 @@ namespace WhiteBox void EditorWhiteBoxComponentMode::DisplayEntityViewport( [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const auto modifiers = m_keyboardMofifierQueryFn(); @@ -374,7 +374,7 @@ namespace WhiteBox void EditorWhiteBoxComponentMode::RecalculateWhiteBoxIntersectionData(const EdgeSelectionType edgeSelectionMode) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WhiteBoxMesh* whiteBox = nullptr; EditorWhiteBoxComponentRequestBus::EventResult( diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentModeTypes.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentModeTypes.cpp index 239c8a3066..cbde5f4f4b 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentModeTypes.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponentModeTypes.cpp @@ -8,6 +8,7 @@ #include "EditorWhiteBoxComponentModeTypes.h" +#include #include namespace WhiteBox @@ -16,7 +17,7 @@ namespace WhiteBox AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, const AZStd::vector& edgeBoundsWithHandle, const Api::EdgeHandles& excludedEdgeHandles) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); debugDisplay.SetColor(color); for (const EdgeBoundWithHandle& edge : edgeBoundsWithHandle) diff --git a/Gems/WhiteBox/Code/Source/SubComponentModes/EditorWhiteBoxDefaultMode.cpp b/Gems/WhiteBox/Code/Source/SubComponentModes/EditorWhiteBoxDefaultMode.cpp index 136db8802c..3d6d9a4c0a 100644 --- a/Gems/WhiteBox/Code/Source/SubComponentModes/EditorWhiteBoxDefaultMode.cpp +++ b/Gems/WhiteBox/Code/Source/SubComponentModes/EditorWhiteBoxDefaultMode.cpp @@ -212,7 +212,7 @@ namespace WhiteBox AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Transform& worldFromLocal, const AzFramework::CameraState& cameraState, const IntersectionAndRenderData& renderData) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); const float vertexIndicatorLength = cl_whiteBoxVertexIndicatorLength; const float vertexIndicatorWidth = cl_whiteBoxVertexIndicatorWidth; @@ -252,7 +252,7 @@ namespace WhiteBox const IntersectionAndRenderData& renderData, [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); TryDestroyModifier(m_polygonTranslationModifier); TryDestroyModifier(m_edgeTranslationModifier); @@ -276,7 +276,7 @@ namespace WhiteBox Api::EdgeHandles DefaultMode::FindInteractiveEdgeHandles(const WhiteBoxMesh& whiteBox) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); // get all edge handles for hovered polygon const Api::EdgeHandles polygonHoveredEdgeHandles = m_polygonTranslationModifier @@ -322,7 +322,7 @@ namespace WhiteBox const WhiteBoxMesh& whiteBox, const PolygonScaleModifier* polygonScaleModifier, const EdgeScaleModifier* edgeScaleModifier, const Api::VertexHandle vertexHandle) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); if (Api::VertexIsHidden(whiteBox, vertexHandle)) { @@ -371,7 +371,7 @@ namespace WhiteBox const AZStd::optional& polygonIntersection, const AZStd::optional& vertexIntersection) { - AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + AZ_PROFILE_FUNCTION(AzToolsFramework); WhiteBoxMesh* whiteBox = nullptr; EditorWhiteBoxComponentRequestBus::EventResult(