Skip to content

Commit 65d429b

Browse files
committed
TestEngine: UI: remove ref value picker. Made PerfCalcRef() pick value over 100 frames.
1 parent 079e982 commit 65d429b

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

imgui_test_engine/imgui_te_context.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4472,15 +4472,15 @@ void ImGuiTestContext::UndockWindow(const char* window_name)
44724472
// ImGuiTestContext - Performance Tools
44734473
//-------------------------------------------------------------------------
44744474

4475-
// Calculate the reference DeltaTime, averaged over PerfIterations/500 frames, with GuiFunc disabled.
4475+
// Calculate the reference DeltaTime, averaged over 100 frames, with GuiFunc disabled.
44764476
void ImGuiTestContext::PerfCalcRef()
44774477
{
44784478
LogDebug("Measuring ref dt...");
44794479
RunFlags |= ImGuiTestRunFlags_GuiFuncDisable;
44804480

44814481
ImMovingAverage<double> delta_times;
4482-
delta_times.Init(PerfIterations);
4483-
for (int n = 0; n < PerfIterations && !Abort; n++)
4482+
delta_times.Init(100);
4483+
for (int n = 0; n < 100 && !Abort; n++)
44844484
{
44854485
Yield();
44864486

imgui_test_engine/imgui_te_engine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ static void ImGuiTestEngine_SettingsWriteAll(ImGuiContext* imgui_ctx, ImGuiSett
120120

121121
ImGuiTestEngine::ImGuiTestEngine()
122122
{
123-
PerfRefValue = 0.0f;
124123
PerfTool = IM_NEW(ImGuiPerfTool);
125124
UiFilterTests = IM_NEW(Str256); // We bite the bullet of adding an extra alloc/indirection in order to avoid including Str.h in our header
126125
UiFilterPerfs = IM_NEW(Str256);

imgui_test_engine/imgui_te_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ struct ImGuiTestEngine
219219
ImGuiTestEnginePerfRecord PerfDtPreRenderToPreSwap;
220220
ImGuiTestEnginePerfRecord PerfDtPreNewFrameToPreSwap;
221221
ImGuiTestEnginePerfRecord PerfDtPreSwapToPostSwap;
222-
double PerfRefValue;
223222
ImGuiPerfTool* PerfTool = nullptr;
224223

225224
// Screen/Video Capturing

imgui_test_engine/imgui_te_ui.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -745,16 +745,11 @@ static void ImGuiTestEngine_ShowLogAndTools(ImGuiTestEngine* engine)
745745
double fps_now = 1000.0 / dt_1;
746746

747747
ImGui::Checkbox("Unthrolled", &engine->IO.ConfigNoThrottle);
748-
ImGui::SameLine();
749-
if (ImGui::Button("Pick ref dt"))
750-
engine->PerfRefValue = avg_500;
751-
ImGui::Text("[ref] %6.3f ms", engine->PerfRefValue);
752748

753749
ImGui::SeparatorText("io.DeltaTime");
754-
double dt_ref = engine->PerfRefValue;
755-
ImGui::Text("[current] %6.3f ms (%.1f FPS) ++ %6.3f ms", dt_1, 1000.0 / dt_1, dt_1 - dt_ref);
756-
ImGui::Text("[avg 100] %6.3f ms (%.1f FPS) ++ %6.3f ms ~ converging in %.1f secs", avg_100, 1000.0 / avg_100, dt_1 - dt_ref, 100.0 / fps_now);
757-
ImGui::Text("[avg 500] %6.3f ms (%.1f FPS) ++ %6.3f ms ~ converging in %.1f secs", avg_500, 1000.0 / avg_500, dt_1 - dt_ref, 500.0 / fps_now);
750+
ImGui::Text("[current] %6.3f ms (%.1f FPS)", dt_1, 1000.0 / dt_1);
751+
ImGui::Text("[avg 100] %6.3f ms (%.1f FPS) ~ converging in %.1f secs", avg_100, 1000.0 / avg_100, 100.0 / fps_now);
752+
ImGui::Text("[avg 500] %6.3f ms (%.1f FPS) ~ converging in %.1f secs", avg_500, 1000.0 / avg_500, 500.0 / fps_now);
758753
ImGui::PlotLines("Last 500##0",
759754
[](void* data, int n) { ImMovingAverage<double>* ma = (ImMovingAverage<double>*)data; return (float)ma->Samples[n]; },
760755
ma, ma->Samples.Size, 0 * ma->Idx, nullptr, 0.0f, (float)(ImMax(avg_100, avg_500) * 1.2f), plot_size);

0 commit comments

Comments
 (0)