SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Create()

void Spices::NsightPerfGPUProfilerHUD::Create ( VulkanState & state)

Create this.

Initialize the sampler any time after VkDevice initialization.

start a recording session and specify the sampling frequency, maximum decoding latency (explained below) and the number of concurrently unfinished frames (maxFrameLatency).

Todo
There remains a bug about off screen frames still fill in buffer, That will cause buffer is fulled useage.
Attention
we set Buffer size can hold 1 h data with 60 HZ.

Select a HUD configuration to record via the HudPresets classĄŁ

Initialize the data model, choose a window of time to store in the TimePlots, and specify the sampling interval.

Pass the newly created counter configuration to the sampler, and prepare the sample-to-frame data processing pipeline.

Initialize the sampler any time after VkDevice initialization.

start a recording session and specify the sampling frequency, maximum decoding latency (explained below) and the number of concurrently unfinished frames (maxFrameLatency).

Todo
There remains a bug about off screen frames still fill in buffer, That will cause buffer is fulled useage.
Attention
we set Buffer size can hold 1 h data with 60 HZ.

Select a HUD configuration to record via the HudPresets classĄŁ

Initialize the data model, choose a window of time to store in the TimePlots, and specify the sampling interval.

Pass the newly created counter configuration to the sampler, and prepare the sample-to-frame data processing pipeline.

Definition at line 41 of file NsightPerfGPUProfilerHUD.cpp.

42 {
44
48 NSPERF_CHECK(m_Sampler.Initialize(state.m_Instance, state.m_PhysicalDevice, state.m_Device))
49
50
54 uint32_t samplingFrequencyInHz = SelectSamplingFrequency();
55
61 uint32_t samplingIntervalInNs = 1000 * 1000 * 1000 / samplingFrequencyInHz; // 1 / 60 s.
62 uint32_t maxDecodeLatencyInNs = 1000 * 1000 * 1000 * 10; // 10 s.
63 size_t maxFrameLatency = MaxFrameInFlight + 1; // requires +1 due to this sample's synchronization model
64 NSPERF_CHECK(m_Sampler.BeginSession(
65 state.m_GraphicQueue ,
66 state.m_GraphicQueueFamily ,
67 samplingIntervalInNs ,
68 maxDecodeLatencyInNs ,
69 maxFrameLatency
70 ))
71
75 nv::perf::hud::HudPresets hudPresents;
76 auto deviceIdentifiers = m_Sampler.GetGpuDeviceIdentifiers();
77 NSPERF_CHECK(hudPresents.Initialize(deviceIdentifiers.pChipName))
78 NSPERF_CHECK(m_HudDataModel.Load(hudPresents.GetPreset("SpicesEngineDefault")))
79
84 double plotTimeWidthInSeconds = 4.0;
85 NSPERF_CHECK(m_HudDataModel.Initialize(1.0 / samplingFrequencyInHz, plotTimeWidthInSeconds))
86
91 NSPERF_CHECK(m_Sampler.SetConfig(&m_HudDataModel.GetCounterConfiguration()))
92 NSPERF_CHECK(m_HudDataModel.PrepareSampleProcessing(m_Sampler.GetCounterData()))
93 }
#define NSPERF_CHECK(val)
#define SPICES_PROFILE_ZONE
nv::perf::sampler::PeriodicSamplerTimeHistoryVulkan m_Sampler
Sampler.
uint32_t SelectSamplingFrequency() const
Select a SamplingFrequency (Hz) by ImGui::IO.
nv::perf::hud::HudDataModel m_HudDataModel
HUD data.
constexpr uint32_t MaxFrameInFlight
Max In Flight Frame. 2 buffers are enough in this program.
Definition VulkanUtils.h:22

References SelectSamplingFrequency().

Referenced by EndFrame(), and NsightPerfGPUProfilerHUD().