LeviLamina
Loading...
Searching...
No Matches
Profile.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/memory/MemoryCategory.h"
7
8// auto generated forward declare list
9// clang-format off
10namespace Bedrock::Profile { class ScopeStackStorage; }
11namespace Bedrock::Profiler::details { struct DynamicProfLabel; }
12namespace Core::Profile { class CPUProfileToken; }
13namespace Core::Profile { class GPUProfileToken; }
14namespace Core::Profile { class ProfileGroup; }
15namespace Core::Profile { struct FileCounters; }
16namespace brstd { struct source_location; }
17// clang-format on
18
19namespace Core::Profile {
20// functions
21// NOLINTBEGIN
22#ifdef LL_PLAT_C
23MCNAPI uchar createGPUContext(
24 char const* name,
25 int64 gpuTimestamp,
26 float gpuPeriod,
27 bool supportsMultithreadedRendering,
28 bool allowContextCallibration
29);
30
31MCNAPI void emitGPUTiming(uint gpuEvent, int64 beginTime, int64 endTime);
32
33MCNAPI void
34enterCPUProfile(::Bedrock::Profile::ScopeStackStorage& scope, ::Core::Profile::CPUProfileToken const& token);
35#endif
36
37MCNAPI void enterCPUProfileDynamic(
38 ::Bedrock::Profile::ScopeStackStorage& scope,
39 ::Core::Profile::CPUProfileToken const& token,
40 ::Bedrock::Profiler::details::DynamicProfLabel dynamicLabel
41);
42
43#ifdef LL_PLAT_C
44MCNAPI uint enterGPUProfile(
45 ::Bedrock::Profile::ScopeStackStorage& scope,
46 ::Core::Profile::GPUProfileToken const& token,
47 uchar context
48);
49#endif
50
51MCNAPI ::Core::Profile::ProfileGroup& findOrCreateGroup(::std::string_view name, uint color);
52
53#ifdef LL_PLAT_C
54MCNAPI ::Core::Profile::CPUProfileToken
55generateCPUProfileToken(char const* group, char const* label, uint color, ::brstd::source_location const& location);
56
57MCNAPI ::Core::Profile::GPUProfileToken generateGPUProfileTokenDynamic(
58 char const* group,
59 char const* label,
60 uint color,
61 ::brstd::source_location const& location
62);
63
64MCNAPI void getFileOpenStats(::Core::Profile::FileCounters& reads, ::Core::Profile::FileCounters& writes);
65
66MCNAPI int64 getProfilerTimestamp();
67#endif
68
69MCNAPI void initializeProfile();
70
71#ifdef LL_PLAT_C
72MCNAPI void
73leaveCPUProfile(::Bedrock::Profile::ScopeStackStorage& scope, ::Core::Profile::CPUProfileToken const& token);
74
75MCNAPI void leaveGPUProfile(::Bedrock::Profile::ScopeStackStorage& scope, uint gpuEvent);
76#endif
77
78MCNAPI void onFileOpenFailed(bool isReadOnly);
79
80MCNAPI void onFileOpenRequest(bool isReadOnly);
81
82MCNAPI void onFrameTransition(uchar previousFrameType);
83
84#ifdef LL_PLAT_C
85MCNAPI void
86onHeapAllocation(void const* pointer, uint64 size, ::Memory::MemoryCategory category, char const* categoryName);
87
88MCNAPI void onHeapFree(void const* pointer, uint64 size, ::Memory::MemoryCategory category, char const* categoryName);
89#endif
90
91MCNAPI void onMainThreadCreate();
92
93MCNAPI void onMainThreadDestroy();
94
95MCNAPI void shutdownProfile();
96
97#ifdef LL_PLAT_C
98MCNAPI void syncGPUTiming(uchar contextId, int64 cpuTimestamp, int64 gpuTimestamp, int64 cpuDeltaNS);
99#endif
100// NOLINTEND
101
102// static variables
103// NOLINTBEGIN
104MCNAPI bool& ProfilerInitialized();
105// NOLINTEND
106
107} // namespace Core::Profile
Definition ScopeStackStorage.h:7
Definition CPUProfileToken.h:7
Definition GPUProfileToken.h:10
Definition ProfileGroup.h:7
Definition DynamicProfLabel.h:7
Definition FileCounters.h:7
Definition source_location.h:7