Files
Scott Romero a95c609bd8 [development] Migrate Atom CPU timing stats tracking to use global stats profiler (#4549)
This change is a preparation for moving the CPU profiler/visualization system from Atom into its own Gem by removing the dependency on local time tracking object AZ::RHI::CpuTimingStatistics

Full changes include:
- Removed all usage of AZ::RHI::CpuTimingStatistics
-- Replaced with pushing to AZ::Statistics::StatisticalProfilerProxy global instance
- Promoted VariableTimer from AZ::RHI to AZ::Debug
- Removed now unused CpuTimingStatistics.h

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
2021-10-11 14:00:42 -07:00

72 lines
2.2 KiB
C++

/*
* 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
#include <AzCore/UnitTest/TestTypes.h>
#include <Atom/RHI/Device.h>
#include <AzCore/Memory/SystemAllocator.h>
namespace UnitTest
{
class PhysicalDevice
: public AZ::RHI::PhysicalDevice
{
public:
AZ_CLASS_ALLOCATOR(PhysicalDevice, AZ::SystemAllocator, 0);
static AZ::RHI::PhysicalDeviceList Enumerate();
private:
PhysicalDevice();
};
class Device
: public AZ::RHI::Device
{
public:
AZ_CLASS_ALLOCATOR(Device, AZ::SystemAllocator, 0);
Device();
private:
AZ::RHI::ResultCode InitInternal(AZ::RHI::PhysicalDevice&) override { return AZ::RHI::ResultCode::Success; }
void ShutdownInternal() override {}
void BeginFrameInternal() override {}
void EndFrameInternal() override {}
void WaitForIdleInternal() override {}
void CompileMemoryStatisticsInternal(AZ::RHI::MemoryStatisticsBuilder&) override {}
void UpdateCpuTimingStatisticsInternal() const override {}
AZStd::chrono::microseconds GpuTimestampToMicroseconds([[maybe_unused]] uint64_t gpuTimestamp, [[maybe_unused]] AZ::RHI::HardwareQueueClass queueClass) const override
{
return AZStd::chrono::microseconds();
}
void FillFormatsCapabilitiesInternal([[maybe_unused]] FormatCapabilitiesList& formatsCapabilities) override {}
AZ::RHI::ResultCode InitializeLimits() override { return AZ::RHI::ResultCode::Success; }
void PreShutdown() override {}
AZ::RHI::ResourceMemoryRequirements GetResourceMemoryRequirements([[maybe_unused]] const AZ::RHI::ImageDescriptor& descriptor) { return AZ::RHI::ResourceMemoryRequirements{}; };
AZ::RHI::ResourceMemoryRequirements GetResourceMemoryRequirements([[maybe_unused]] const AZ::RHI::BufferDescriptor& descriptor) { return AZ::RHI::ResourceMemoryRequirements{}; };
void ObjectCollectionNotify(AZ::RHI::ObjectCollectorNotifyFunction notifyFunction) override {}
};
AZ::RHI::Ptr<AZ::RHI::Device> MakeTestDevice();
}