| 252 | } |
| 253 | |
| 254 | void ProfilerUI::renderOptions() |
| 255 | { |
| 256 | bool paused = mpProfiler->isPaused(); |
| 257 | if (ImGui::Checkbox("Pause", &paused)) |
| 258 | mpProfiler->setPaused(paused); |
| 259 | |
| 260 | ImGui::SameLine(); |
| 261 | ImGui::Checkbox("Average", &mEnableAverage); |
| 262 | |
| 263 | ImGui::SameLine(); |
| 264 | ImGui::SetNextItemWidth(100.f); |
| 265 | if (ImGui::Combo("Graph", reinterpret_cast<int*>(&mGraphMode), kGraphModes, (int)GraphMode::Count)) |
| 266 | clearGraphData(); |
| 267 | |
| 268 | if (mpProfiler->isCapturing()) |
| 269 | { |
| 270 | ImGui::SameLine(); |
| 271 | if (ImGui::Button("End Capture")) |
| 272 | { |
| 273 | auto pCapture = mpProfiler->endCapture(); |
| 274 | FALCOR_ASSERT(pCapture); |
| 275 | FileDialogFilterVec filters{{"json", "JSON"}}; |
| 276 | std::filesystem::path path; |
| 277 | if (saveFileDialog(filters, path)) |
| 278 | { |
| 279 | pCapture->writeToFile(path); |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | else |
| 284 | { |
| 285 | ImGui::SameLine(); |
| 286 | if (ImGui::Button("Start Capture")) |
| 287 | mpProfiler->startCapture(); |
| 288 | } |
| 289 | |
| 290 | ImGui::Separator(); |
| 291 | } |
| 292 | |
| 293 | void ProfilerUI::renderGraph(const ImVec2& size, size_t highlightIndex, size_t& newHighlightIndex) |
| 294 | { |
nothing calls this directly
no test coverage detected