You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Added trace event for Phase (Push + Pop) to make it easier to recreate the event hierarchy when analyzing the traces. - Merged enums EStateTreeTraceInstanceEventType and EStateTreeTraceNodeEventType to EStateTreeTraceEventType which is mainly a list of verbs that could be reused for different events (States, Instances, Tasks, etc.) - EStateTreeUpdatePhase is no longer used as flags and reduced to uint8 - Phase events are stacked when producing traces and sent only if meaningful events (Task, State, Transition, etc.) are sent during their scope. This is to avoid sending useless events when the StateTree is ticked without any changes #rnx #rb mikko.mononen #preflight 6474a5e62e05bcc3309d093e [CL 25663847 by yoan stamant in ue5-main branch]
44 lines
1.8 KiB
C++
44 lines
1.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#if WITH_STATETREE_DEBUGGER
|
|
|
|
#include "IStateTreeTraceProvider.h"
|
|
#include "Model/PointTimeline.h"
|
|
#include "StateTreeTypes.h" // required to compile TMap<FStateTreeInstanceDebugId, ...>
|
|
|
|
namespace TraceServices { class IAnalysisSession; }
|
|
class UStateTree;
|
|
namespace UE::StateTreeDebugger { struct FInstanceDescriptor; }
|
|
|
|
class FStateTreeTraceProvider : public IStateTreeTraceProvider
|
|
{
|
|
public:
|
|
static FName ProviderName;
|
|
|
|
explicit FStateTreeTraceProvider(TraceServices::IAnalysisSession& InSession);
|
|
|
|
void AppendEvent(FStateTreeInstanceDebugId InInstanceId, double InTime, const FStateTreeTraceEventVariantType& InEvent);
|
|
void AppendInstanceEvent(
|
|
const UStateTree* InStateTree,
|
|
const FStateTreeInstanceDebugId InInstanceId,
|
|
const TCHAR* InInstanceName,
|
|
double InTime,
|
|
double InWorldRecordingTime,
|
|
EStateTreeTraceEventType InEventType);
|
|
|
|
protected:
|
|
/** IStateTreeDebuggerProvider interface */
|
|
virtual void GetInstances(TArray<UE::StateTreeDebugger::FInstanceDescriptor>& OutInstances) const override;
|
|
virtual bool ReadTimelines(const FStateTreeInstanceDebugId InstanceId, TFunctionRef<void(const FStateTreeInstanceDebugId ProcessedInstanceId, const FEventsTimeline&)> Callback) const override;
|
|
virtual bool ReadTimelines(const UStateTree& StateTree, TFunctionRef<void(const FStateTreeInstanceDebugId ProcessedInstanceId, const FEventsTimeline&)> Callback) const override;
|
|
|
|
private:
|
|
TraceServices::IAnalysisSession& Session;
|
|
|
|
TMap<FStateTreeInstanceDebugId, uint32> InstanceIdToDebuggerEntryTimelines;
|
|
TArray<UE::StateTreeDebugger::FInstanceDescriptor> Descriptors;
|
|
TArray<TSharedRef<TraceServices::TPointTimeline<FStateTreeTraceEventVariantType>>> EventsTimelines;
|
|
};
|
|
#endif // WITH_STATETREE_DEBUGGER
|