[atom_cpu_profiler_gem_promotion] additional APIs for external control of the CPU profiler and visualization
Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com>
This commit is contained in:
@@ -19,6 +19,9 @@ namespace Profiler
|
||||
AZ_RTTI(ProfilerRequests, "{3757c4e5-1941-457c-85ae-16305e17a4c6}");
|
||||
virtual ~ProfilerRequests() = default;
|
||||
|
||||
//! Enable/Disable the CpuProfiler
|
||||
virtual void SetProfilerEnabled(bool enabled) = 0;
|
||||
|
||||
//! Dump a single frame of Cpu profiling data
|
||||
virtual bool CaptureCpuProfilingStatistics(const AZStd::string& outputFilePath) = 0;
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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/EBus/EBus.h>
|
||||
|
||||
namespace Profiler
|
||||
{
|
||||
class ProfilerImGuiRequests
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(ProfilerImGuiRequests, "{E0443400-D108-4D3F-8FF5-4F076FCF6D13}");
|
||||
virtual ~ProfilerImGuiRequests() = default;
|
||||
|
||||
// special request to render the CPU profiler window in a non-standard way
|
||||
// e.g not through ImGuiUpdateListenerBus::OnImGuiUpdate
|
||||
virtual void ShowCpuProfilerWindow(bool& keepDrawing) = 0;
|
||||
};
|
||||
|
||||
class ProfilerImGuiBusTraits
|
||||
: public AZ::EBusTraits
|
||||
{
|
||||
public:
|
||||
// EBusTraits overrides
|
||||
static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
|
||||
static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
};
|
||||
|
||||
using ProfilerImGuiRequestBus = AZ::EBus<ProfilerImGuiRequests, ProfilerImGuiBusTraits>;
|
||||
} // namespace Profiler
|
||||
Reference in New Issue
Block a user