Merge branch 'development' into ExposeLodControls

This commit is contained in:
Kyle Birnbaum
2021-08-20 12:45:00 -07:00
committed by GitHub
3092 changed files with 61511 additions and 87536 deletions
@@ -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)
{
@@ -1010,13 +1010,13 @@ namespace Vegetation
if (m_debugData)
{
m_debugData->m_areaTaskQueueCount.store(m_vegetationThreadTasks.size(), AZStd::memory_order_relaxed);
m_debugData->m_areaTaskQueueCount.store(static_cast<int>(m_vegetationThreadTasks.size()), AZStd::memory_order_relaxed);
}
}
void AreaSystemComponent::VegetationThreadTasks::ProcessVegetationThreadTasks(UpdateContext* context, PersistentThreadData* threadData)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity);
AZ_PROFILE_FUNCTION(Entity);
VegetationThreadTasks::VegetationThreadTaskList tasks;
{
@@ -1025,8 +1025,8 @@ namespace Vegetation
if (m_debugData)
{
m_debugData->m_areaTaskQueueCount.store(m_vegetationThreadTasks.size(), AZStd::memory_order_relaxed);
m_debugData->m_areaTaskActiveCount.store(tasks.size(), AZStd::memory_order_relaxed);
m_debugData->m_areaTaskQueueCount.store(static_cast<int>(m_vegetationThreadTasks.size()), AZStd::memory_order_relaxed);
m_debugData->m_areaTaskActiveCount.store(static_cast<int>(tasks.size()), AZStd::memory_order_relaxed);
}
}
@@ -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<decltype(m_sectorRollingWindowMutex)> 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<decltype(m_sectorRollingWindowMutex)> 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<float>(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<decltype(m_sectorRollingWindowMutex)> 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<AZ::EntityId, AZStd::unordered_set<ClaimHandle>> 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<AZ::EntityId, AZStd::unordered_set<ClaimHandle>> 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<decltype(m_sectorRollingWindowMutex)> 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
@@ -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;
@@ -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();
}
}
@@ -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);
@@ -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)
{
@@ -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)
{
@@ -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;
@@ -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);
@@ -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<decltype(m_cacheMutex)> 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<decltype(m_cacheMutex)> 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<decltype(m_cacheMutex)> cacheLock(m_cacheMutex);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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;
@@ -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);
@@ -528,12 +528,12 @@ namespace Vegetation
AZ::u32 SpawnerComponent::GetProductCount() const
{
AZStd::lock_guard<decltype(m_claimInstanceMappingMutex)> claimInstanceMappingMutexLock(m_claimInstanceMappingMutex);
return m_claimInstanceMapping.size();
return static_cast<AZ::u32>(m_claimInstanceMapping.size());
}
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;
{
@@ -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;
@@ -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;
@@ -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);
@@ -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;
@@ -599,8 +599,8 @@ namespace DebugUtility
timing.m_lowestTimeUs = AZ::GetMin<decltype(timing.m_lowestTimeUs)>(timeSpan, timing.m_lowestTimeUs);
timing.m_peakTimeUs = AZ::GetMax<decltype(timing.m_peakTimeUs)>(timeSpan, timing.m_peakTimeUs);
timing.m_totalUpdateTimeUs += timeSpan;
timing.m_numInstancesCreated += datum.m_numInstancesCreated;
timing.m_numClaimPointsRemaining += datum.m_numClaimPointsRemaining;
timing.m_numInstancesCreated += static_cast<AZ::u32>(datum.m_numInstancesCreated);
timing.m_numClaimPointsRemaining += static_cast<AZ::u32>(datum.m_numClaimPointsRemaining);
++timing.m_totalCount;
timing.m_averageTimeUs = timing.m_totalUpdateTimeUs / timing.m_totalCount;
@@ -615,8 +615,8 @@ namespace DebugUtility
timing.m_peakTimeUs = timeSpan;
timing.m_averageTimeUs = timeSpan;
timing.m_totalUpdateTimeUs = timeSpan;
timing.m_numInstancesCreated = datum.m_numInstancesCreated;
timing.m_numClaimPointsRemaining = datum.m_numClaimPointsRemaining;
timing.m_numInstancesCreated = static_cast<AZ::u32>(datum.m_numInstancesCreated);
timing.m_numClaimPointsRemaining = static_cast<AZ::u32>(datum.m_numClaimPointsRemaining);
timing.m_totalCount = 1;
mergeData(datum, timing);
@@ -876,7 +876,7 @@ void DebugComponent::PrepareNextReport()
{
AreaSectorTiming& areaSectorTiming = iterator->second;
areaSectorTiming.m_totalTime += AZStd::chrono::microseconds(sectorAreaData.m_end - sectorAreaData.m_start).count();
areaSectorTiming.m_numInstances += sectorAreaData.m_numInstancesCreated;
areaSectorTiming.m_numInstances += static_cast<AZ::u32>(sectorAreaData.m_numInstancesCreated);
for( const auto& reasonValue : sectorAreaData.m_numInstancesRejectedByFilters )
{
DebugComponentUtilities::IncrementFilterReason(areaSectorTiming.m_numInstancesRejectedByFilters, reasonValue.first, reasonValue.second);
@@ -887,7 +887,7 @@ void DebugComponent::PrepareNextReport()
{
AreaSectorTiming newAreaSectorTiming;
newAreaSectorTiming.m_totalTime = AZStd::chrono::microseconds(sectorAreaData.m_end - sectorAreaData.m_start).count();
newAreaSectorTiming.m_numInstances = sectorAreaData.m_numInstancesCreated;
newAreaSectorTiming.m_numInstances = static_cast<AZ::u32>(sectorAreaData.m_numInstancesCreated);
newAreaSectorTiming.m_numInstancesRejectedByFilters = sectorAreaData.m_numInstancesRejectedByFilters;
newAreaSectorTiming.m_filteredByMasks = sectorAreaData.m_filteredByMasks;
sectorTiming.m_perAreaData[areaId] = newAreaSectorTiming;
@@ -913,7 +913,7 @@ void DebugComponent::PrepareNextReport()
AreaSectorTiming& areaSectorTiming = iterator->second;
areaSectorTiming.m_totalTime += AZStd::chrono::microseconds(areaTracker.m_end - areaTracker.m_start).count();
areaSectorTiming.m_numInstances += areaTracker.m_numInstancesCreated;
areaSectorTiming.m_numInstances += static_cast<AZ::u32>(areaTracker.m_numInstancesCreated);
for (const auto& filterReasonEntry : areaTracker.m_numInstancesRejectedByFilters)
{
DebugComponentUtilities::IncrementFilterReason(areaSectorTiming.m_numInstancesRejectedByFilters, filterReasonEntry.first, filterReasonEntry.second);
@@ -925,7 +925,7 @@ void DebugComponent::PrepareNextReport()
{
AreaSectorTiming newAreaSectorTiming;
newAreaSectorTiming.m_totalTime = AZStd::chrono::microseconds(areaTracker.m_end - areaTracker.m_start).count();
newAreaSectorTiming.m_numInstances = areaTracker.m_numInstancesCreated;
newAreaSectorTiming.m_numInstances = static_cast<AZ::u32>(areaTracker.m_numInstancesCreated);
newAreaSectorTiming.m_numInstancesRejectedByFilters = areaTracker.m_numInstancesRejectedByFilters;
newAreaSectorTiming.m_filteredByMasks = areaTracker.m_filteredByMasks;
areaTiming.m_perSectorData[areaTracker.m_sectorId] = newAreaSectorTiming;
@@ -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<decltype(m_uniqueDescriptorsMutex)> 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<decltype(m_uniqueDescriptorsMutex)> 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<decltype(m_instanceDeletionSetMutex)> 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))
{
@@ -483,13 +483,13 @@ namespace Vegetation
AZStd::lock_guard<decltype(m_instanceMapMutex)> scopedLock(m_instanceMapMutex);
AZ_Assert(m_instanceMap.find(instanceData.m_instanceId) == m_instanceMap.end(), "InstanceId %llu is already in use!", instanceData.m_instanceId);
m_instanceMap[instanceData.m_instanceId] = AZStd::make_pair(instanceData.m_descriptorPtr, opaqueInstanceData);
m_instanceCount = m_instanceMap.size();
m_instanceCount = static_cast<int>(m_instanceMap.size());
}
}
void InstanceSystemComponent::ReleaseInstanceNode(InstanceId instanceId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity);
AZ_PROFILE_FUNCTION(Entity);
DescriptorPtr descriptor = nullptr;
InstancePtr opaqueInstanceData = nullptr;
@@ -503,7 +503,7 @@ namespace Vegetation
opaqueInstanceData = instanceItr->second.second;
m_instanceMap.erase(instanceItr);
}
m_instanceCount = m_instanceMap.size();
m_instanceCount = static_cast<int>(m_instanceMap.size());
}
if (opaqueInstanceData)
@@ -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<decltype(m_mainThreadTaskMutex)> 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<decltype(m_mainThreadTaskInProgressMutex)> mainThreadTaskInProgressLock(m_mainThreadTaskInProgressMutex);
AZStd::lock_guard<decltype(m_mainThreadTaskMutex)> 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<decltype(m_mainThreadTaskMutex)> 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<decltype(m_mainThreadTaskInProgressMutex)> scopedLock(m_mainThreadTaskInProgressMutex);
@@ -588,7 +588,7 @@ namespace Vegetation
void InstanceSystemComponent::ProcessMainThreadTasks()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity);
AZ_PROFILE_FUNCTION(Entity);
ExecuteTasks();
}
+2 -1
View File
@@ -8,5 +8,6 @@
"canonical_tags": ["Gem"],
"user_tags": ["Environment", "Tools", "Design"],
"icon_path": "preview.png",
"requirements": ""
"requirements": "",
"documentation_url": "https://o3de.org/docs/user-guide/gems/reference/environment/vegetation/"
}