SpiecsEngine
 
Loading...
Searching...
No Matches
ImguiGPURuntimeProfilerHUD.cpp
Go to the documentation of this file.
1/**
2* @file ImguiGPURuntimeProfilerHUD.cpp.
3* @brief The ImguiGPURuntimeProfilerHUD Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Debugger/Perf/NsightPerfGPUProfilerHUD.h"
10
11namespace Spices {
12
14 const std::string& panelName ,
15 FrameInfo& frameInfo
16 )
17 : ImguiSlate(panelName, frameInfo)
18 {}
19
21 {
23
24 NSIGHTPERF_GPUPROFILERHUD_SETINSESSION(m_IsSlateOn)
25
26 if (!m_IsSlateOn) return;
27
28 /**
29 * @brief Begin render PerfProfilerHUD.
30 */
31 Begin();
32
33 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f, 4.0f));
34
35 /**
36 * @brief Search String.
37 */
38 static std::string searchString;
39 static bool isEnableSearch = false;
40
41 /**
42 * @brief Begin render Search Input Text.
43 */
44 {
45 SPICES_PROFILE_ZONEN("ImguiGPURuntimeProfilerHUD::Search");
46
47 ImGui::Spacing();
48 ImGui::PushItemWidth(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f - ImGui::GetStyle().WindowPadding.x);
49 static char search[256] = {};
50 if (ImGui::InputTextWithHint("##", ICON_TEXT(ICON_MD_SEARCH, Search), search, 128))
51 {
52 searchString = std::string(search);
53 if (searchString.size() == 0) isEnableSearch = false;
54 else isEnableSearch = true;
55 }
56 ImGui::PopItemWidth();
57
58 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f);
59 ImGui::Button(ICON_MD_FILTER_ALT, ImGuiH::GetLineItemSize());
60 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 1.0f);
61 ImGui::Button(ICON_MD_REORDER, ImGuiH::GetLineItemSize());
62 ImGui::Spacing();
63 }
64
65 ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
66 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
67 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
68 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
69
70 NSIGHTPERF_GPUPROFILERHUD_RENDERHUD
71
72 ImGui::PopStyleColor(4);
73 ImGui::PopStyleVar();
74
75 /**
76 * @brief End render PerfProfilerHUD.
77 */
78 End();
79 }
80}
#define ICON_TEXT(icon, text)
Definition ImguiHelper.h:24
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
FrameInfo Class. This class defines the FrameInfo data.
Definition FrameInfo.h:32
virtual void OnRender() override
This interface is called On SlateRenderer Render.
ImguiGPURuntimeProfilerHUD(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function.
void End()
End a slate.
ImguiSlate(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function. Init with Slate's name.
Definition ImguiUtils.h:35
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...
Definition ImguiUtils.h:27