2
3
4
5
9#include "Render/Vulkan/VulkanUtils.h"
11#include <NvPerfHudDataModel.h>
12#include <NvPerfHudImPlotRenderer.h>
13#include <NvPerfPeriodicSamplerVulkan.h>
14#include <NvPerfReportGeneratorVulkan.h>
19
20
26
27
28
32
33
37
38
42
43
44
48
49
50
54
55
59
60
61
65
66
67
71
72
73
74
75
79
80
81
82
83
86 VkPhysicalDevice physicalDevice ,
87 std::vector<
const char*>& deviceExtensionNames
91
92
93
94
98
99
103
104
110
111
112
118
119
123
124
128
129
133
134
138
139
143
144
148
149
153
154
158#define NSIGHTPERF_GPUPROFILERHUD_QUERYDEVICEEXTENSION(...) { ::Spices::NsightPerfGPUProfilerHUD::QueryDeviceExtensionRequirement(__VA_ARGS__); }
159#define NSIGHTPERF_GPUPROFILERHUD_QUERYINSTANCEEXTENSION(...) { ::Spices::NsightPerfGPUProfilerHUD::QueryInstanceExtensionRequirement(__VA_ARGS__); }
163#define NSIGHTPERF_GPUPROFILERHUD_CREATEINSTANCE(...) { ::Spices::NsightPerfGPUProfilerHUD::CreateInstance(__VA_ARGS__); }
164#define NSIGHTPERF_GPUPROFILERHUD_INITHUDRENDERER { ::Spices::NsightPerfGPUProfilerHUD::Get().InitHUDRenderer(); }
165#define NSIGHTPERF_GPUPROFILERHUD_FRAMECONSUME { ::Spices::NsightPerfGPUProfilerHUD::Get().ConsumeSample(); }
166#define NSIGHTPERF_GPUPROFILERHUD_RENDERHUD { ::Spices::NsightPerfGPUProfilerHUD::Get().RenderHUD(); }
167#define NSIGHTPERF_GPUPROFILERHUD_SETINSESSION(...) { ::Spices::NsightPerfGPUProfilerHUD::Get().SetInSession(__VA_ARGS__); }
168#define NSIGHTPERF_GPUPROFILERHUD_ENDFRAME(...) { ::Spices::NsightPerfGPUProfilerHUD::Get().EndFrame(__VA_ARGS__); }
169#define NSIGHTPERF_GPUPROFILERHUD_RESET { ::Spices::NsightPerfGPUProfilerHUD::Get().Reset(); }
175#define NSIGHTPERF_GPUPROFILERHUD_CREATEINSTANCE(...)
176#define NSIGHTPERF_GPUPROFILERHUD_INITHUDRENDERER
177#define NSIGHTPERF_GPUPROFILERHUD_FRAMECONSUME
178#define NSIGHTPERF_GPUPROFILERHUD_RENDERHUD
179#define NSIGHTPERF_GPUPROFILERHUD_SETINSESSION(...)
180#define NSIGHTPERF_GPUPROFILERHUD_ENDFRAME(...)
181#define NSIGHTPERF_GPUPROFILERHUD_RESET
#define NSPERF_CHECK(val)
#define SPICES_PROFILE_ZONE
nv::perf::sampler::PeriodicSamplerTimeHistoryVulkan m_Sampler
Sampler.
void Create(VulkanState &state)
Create this.
NsightPerfGPUProfilerHUD(VulkanState &state)
Constructor Function.
void RenderHUD()
Inform the sampler about the frame end, and use the HUD renderer to visualize the populated data mode...
void Reset()
Reset Sampler.
bool m_IsReachBufferBound
True if Decode and Consume failed.
void ConsumeSample()
Samples to be periodically fetched and processed by the sampler utility classes. Caveat: If this is n...
void SetInSession(bool inSession)
Set if is needed in session.
bool m_IsInSession
True if in a Session.
void EndFrame(VulkanState &state)
End Sampler Frame.
static void QueryDeviceExtensionRequirement(VkInstance instance, VkPhysicalDevice physicalDevice, std::vector< const char * > &deviceExtensionNames)
virtual ~NsightPerfGPUProfilerHUD()=default
Destructor Function.
static std::shared_ptr< NsightPerfGPUProfilerHUD > m_NsightPerfGPUProfilerHUD
This Single Instance.
static void CreateInstance(VulkanState &state)
Create this Single Instance.
bool m_IsHUDInitialized
True id HUD is initialized.
static void QueryInstanceExtensionRequirement(std::vector< const char * > &instanceExtensionNames, uint32_t apiVersion)
Query Instance Extension Requirements.
uint32_t SelectSamplingFrequency() const
Select a SamplingFrequency (Hz) by ImGui::IO.
VulkanState & m_VulkanState
VulkanState.
void InitHUDRenderer()
Initialize ImGui, ImPlot and pass the data model into HUD Renderer.
nv::perf::hud::HudImPlotRenderer m_HudRenderer
HUD imgui renderer.
static NsightPerfGPUProfilerHUD & Get()
Get this Single Instance.
nv::perf::hud::HudDataModel m_HudDataModel
HUD data.
Wrapper of Nvidia Nsight Performance HUD.
This struct contains all Vulkan object in used global.