From 226923fa7e9d73e28958a04884943318797d9991 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 6 Aug 2023 20:30:07 +0200 Subject: [PATCH] Metrics: Fixed "Drawlists" section and per-viewport equivalent appearing empty (regression from c649aca). (#6597, #6475, #6167, #5776, #5109, #4763, #3515, #1860) --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 5eb96b358f1e..f7e6ec1ef70e 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -48,6 +48,8 @@ Other changes: v_max=INT_MAX (#6675, #6679) [@jbarthelmes] - ImDrawList: Fixed OOB access in _CalcCircleAutoSegmentCount when passing excessively large radius to AddCircle(). (#6657, #5317) [@EggsyCRO, @jdpatdiscord] +- Debug Tools: Metrics: Fixed "Drawlists" section and per-viewport equivalent + appearing empty (regression in 1.89.8). - Demo: Demonstrate out-of-order rendering using ImDrawListSplitter. diff --git a/imgui.cpp b/imgui.cpp index ba469efd698d..ca2a6777ca7b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4566,10 +4566,7 @@ void ImGui::NewFrame() // Mark rendering data as invalid to prevent user who may have a handle on it to use it. for (int n = 0; n < g.Viewports.Size; n++) - { - ImGuiViewportP* viewport = g.Viewports[n]; - viewport->DrawDataP.Clear(); - } + g.Viewports[n]->DrawDataP.Valid = false; // Drag and drop keep the source ID alive so even if the source disappear our state is consistent if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId)