Deprecate profiler categories based on global enum

(to be supplanted by registered budgets in the future)

Signed-off-by: Jeremy Ong <jcong@amazon.com>
This commit is contained in:
Jeremy Ong
2021-08-17 12:10:57 -06:00
parent d15d40fec6
commit df9b4d4a2f
274 changed files with 1435 additions and 1965 deletions
@@ -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)
@@ -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<AZ::EntityId, AZStd::list<AZ::u64>> 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(
@@ -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())
@@ -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)
{
@@ -77,7 +77,7 @@ namespace AzToolsFramework
AzFramework::SliceInstantiationTicket SliceEditorEntityOwnershipService::InstantiateEditorSlice(
const AZ::Data::Asset<AZ::Data::AssetData>& 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<AZ::Data::AssetData> 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<AZ::Data::AssetData> 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);