SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnRender()

void Spices::ImguiRendererProfilerHUD::OnRender ( )
overridevirtual

This interface is called On SlateRenderer Render.

Begin render RendererProfilerHUD.

Search String.

Begin render Search Input Text.

Render Datails.

End render RendererProfilerHUD Visualizer.

Begin render RendererProfilerHUD.

Search String.

Begin render Search Input Text.

Render Datails.

End render RendererProfilerHUD Visualizer.

Implements Spices::ImguiSlate.

Definition at line 25 of file ImguiRendererProfilerHUD.cpp.

26 {
28
29 if (!m_IsSlateOn) return;
30
34 Begin();
35 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f, 4.0f));
36
40 static std::string searchString;
41 static bool isEnableSearch = false;
42
46 {
47 SPICES_PROFILE_ZONEN("ImguiRendererProfilerHUD::Search");
48
49 ImGui::Spacing();
50 ImGui::PushItemWidth(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f - ImGui::GetStyle().WindowPadding.x);
51 static char search[256] = {};
52 if (ImGui::InputTextWithHint("##", ICON_TEXT(ICON_MD_SEARCH, Search), search, 128))
53 {
54 searchString = std::string(search);
55 if (searchString.size() == 0) isEnableSearch = false;
56 else isEnableSearch = true;
57 }
58 ImGui::PopItemWidth();
59
60 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 2.0f);
61 ImGui::Button(ICON_MD_FILTER_ALT, ImGuiH::GetLineItemSize());
62 ImGui::SameLine(m_PanelSize.x - ImGuiH::GetLineItemSize().x * 1.0f);
63 ImGui::Button(ICON_MD_REORDER, ImGuiH::GetLineItemSize());
64 ImGui::Spacing();
65 }
66
67 static int selectedStatistics = 0;
68 static int selectedChannel = 0;
69
70 ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
71 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
72 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
73 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
74
78 {
79 SPICES_PROFILE_ZONEN("ImguiRendererProfilerHUD::Datails");
80
81 {
82 ImGui::PushID("ImguiRendererProfilerHUD::Statistics Type");
83 ImGui::Columns(2, 0, false);
84 ImGui::SetColumnWidth(0, ImGuiH::GetLineItemSize().x * 4.0f);
85 ImGui::Text("Statistics");
86 ImGui::NextColumn();
87
88 static const char* type[] = { " TimeStamp", " PipelineStatistics" };
89 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
90 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.6f, 0.6f, 0.6f, 1.0f));
91 ImGui::Combo("##", &selectedStatistics, type, _countof(type));
92 ImGui::PopStyleColor();
93 ImGui::PopItemWidth();
94
95 ImGui::Columns(1);
96 ImGui::PopID();
97 }
98
99 if (selectedStatistics == 1)
100 {
101 ImGui::PushID("ImguiRendererProfilerHUD::PipelineChannel");
102 ImGui::Columns(2, 0, false);
103 ImGui::SetColumnWidth(0, ImGuiH::GetLineItemSize().x * 4.0f);
104 ImGui::Text("Channel");
105 ImGui::NextColumn();
106
107 static const char* channel[] = {
108 " Input Assembly Vertices",
109 " Input Assembly Primitive",
110 " Vertex Shader Invocations",
111 " Geometry Shader Invocations",
112 " Geometry Shader Primitive",
113 " Clipping Invocations",
114 " Clipping Primitive",
115 " Fragment Shader Invocations",
116 " Tessellation Control Invocations",
117 " Tessellation Evaluation Invocations",
118 " Compute Shader Invocations",
119 " Task Shader Invocations",
120 " Mesh Shader Invocations"
121 };
122 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
123 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.6f, 0.6f, 0.6f, 1.0f));
124 ImGui::Combo("##", &selectedChannel, channel, _countof(channel));
125 ImGui::PopStyleColor();
126 ImGui::PopItemWidth();
127
128 ImGui::Columns(1);
129 ImGui::PopID();
130 }
131
132 {
133 ImGui::PushID("ImguiRendererProfilerHUD::Refresh");
134 ImGui::Columns(2, 0, false);
135 ImGui::SetColumnWidth(0, ImGuiH::GetLineItemSize().x * 4.0f);
136 ImGui::Text("Refresh");
137 ImGui::NextColumn();
138
139 static bool isChecked = false;
140 ImGuiH::Checkbox(&isChecked);
141
142 if (isChecked)
143 {
144 RENDERPASS_STATISTICS_CAPTUREFRAME
145 isChecked = false;
146 }
147
148 ImGui::Columns(1);
149 ImGui::PopID();
150 }
151 }
152
153 ImGui::PopStyleColor(4);
154
155 if (selectedStatistics == 0)
156 {
158 }
159 else if(selectedStatistics == 1)
160 {
161 DrawPipelineStatistics(selectedChannel);
162 }
163
167 ImGui::PopStyleVar();
168 End();
169 }
#define ICON_TEXT(icon, text)
Definition ImguiHelper.h:24
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static void Checkbox(bool *isChecked)
ImGuiHelper Style Checkbox.
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
void End()
End a slate.
ImVec2 m_PanelSize
This slate's size.
Definition ImguiUtils.h:151

References Spices::ImGuiH::Checkbox(), DrawPipelineStatistics(), DrawTimeStamp(), Spices::ImguiSlate::End(), and Spices::ImguiSlate::m_IsSlateOn.