Switched Gradient Surface benchmarks to use actual surface components. (#7468)
* Switched Gradient Surface benchmarks to use actual surface components. The gradient unit tests and benchmarks were previously using a mock surface data system, which led to misleading benchmark results. Now, the actual SurfaceData system gets constructed, and the tests use a mock provider, but the benchmarks use actual shape providers for more realistic benchmarking. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed unit tests to have better query ranges. Half of each previous range was querying outside the surface provider's data. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/std/sort.h>
|
||||
|
||||
#include "SurfaceDataSystemComponent.h"
|
||||
#include <SurfaceData/Components/SurfaceDataSystemComponent.h>
|
||||
#include <SurfaceData/SurfaceDataConstants.h>
|
||||
#include <SurfaceData/SurfaceTag.h>
|
||||
#include <SurfaceData/SurfaceDataSystemNotificationBus.h>
|
||||
@@ -175,6 +175,34 @@ namespace SurfaceData
|
||||
SurfaceDataSystemNotificationBus::Broadcast(&SurfaceDataSystemNotificationBus::Events::OnSurfaceChanged, AZ::EntityId(), dirtyBounds, dirtyBounds);
|
||||
}
|
||||
|
||||
SurfaceDataRegistryHandle SurfaceDataSystemComponent::GetSurfaceDataProviderHandle(const AZ::EntityId& providerEntityId)
|
||||
{
|
||||
AZStd::shared_lock<decltype(m_registrationMutex)> registrationLock(m_registrationMutex);
|
||||
|
||||
for (auto& [providerHandle, providerEntry] : m_registeredSurfaceDataProviders)
|
||||
{
|
||||
if (providerEntry.m_entityId == providerEntityId)
|
||||
{
|
||||
return providerHandle;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
SurfaceDataRegistryHandle SurfaceDataSystemComponent::GetSurfaceDataModifierHandle(const AZ::EntityId& modifierEntityId)
|
||||
{
|
||||
AZStd::shared_lock<decltype(m_registrationMutex)> registrationLock(m_registrationMutex);
|
||||
|
||||
for (auto& [modifierHandle, modifierEntry] : m_registeredSurfaceDataModifiers)
|
||||
{
|
||||
if (modifierEntry.m_entityId == modifierEntityId)
|
||||
{
|
||||
return modifierHandle;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void SurfaceDataSystemComponent::GetSurfacePoints(const AZ::Vector3& inPosition, const SurfaceTagVector& desiredTags, SurfacePointList& surfacePointList) const
|
||||
{
|
||||
const bool useTagFilters = HasValidTags(desiredTags);
|
||||
|
||||
Reference in New Issue
Block a user