From a9e7a8c880cf4a7fbf142b13a41bcbb1f43d0938 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 26 Jul 2026 15:42:48 +0200 Subject: [PATCH] ImDrawData: fixed a regression in 1.92.9 where legacy `ImDrawData::CmdListsCount` was always 0. --- docs/CHANGELOG.txt | 17 +++++++++++++++-- imgui.cpp | 4 +++- imgui_draw.cpp | 3 --- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a3e036018..35a67649a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -35,11 +35,24 @@ HOW TO UPDATE? and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users. - Please report any issue! +----------------------------------------------------------------------- + VERSION 1.92.9b (In Progress) +----------------------------------------------------------------------- + +Breaking Changes: + +Other Changes: + +- ImDrawData: fixed a regression in 1.92.9 where legacy `ImDrawData::CmdListsCount` was always 0. + Prefer using `ImDrawData::CmdList.Size` anyway. + + + ----------------------------------------------------------------------- VERSION 1.92.9 (Released 2026-07-25) ----------------------------------------------------------------------- -Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.8 +Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.9 Breaking Changes: @@ -1106,7 +1119,7 @@ Other Changes: not available. (#5924, #5562) - SDL3+DirectX11: Added SDL3+DirectX11 example. (#8956, #8957) [@tomaz82] - Win32+DirectX12: Rework synchronization logic. (#8961) [@RT2Code] - - Made examples's main.cpp consistent with returning 1 on error. + - Made examples' main.cpp consistent with returning 1 on error. ----------------------------------------------------------------------- diff --git a/imgui.cpp b/imgui.cpp index 2c536fa8f..da2780fd9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6243,7 +6243,9 @@ void ImGui::Render() ImDrawData* draw_data = &viewport->DrawDataP; for (ImDrawList* draw_list : draw_data->CmdLists) draw_list->_PopUnusedDrawCmd(); - +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + draw_data->CmdListsCount = draw_data->CmdLists.Size; +#endif g.IO.MetricsRenderVertices += draw_data->TotalVtxCount; g.IO.MetricsRenderIndices += draw_data->TotalIdxCount; } diff --git a/imgui_draw.cpp b/imgui_draw.cpp index acf377c55..d89e36a9a 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -2340,9 +2340,6 @@ void ImDrawData::AddDrawList(ImDrawList* draw_list) { draw_list->_PopUnusedDrawCmd(); ImGui::AddDrawListToDrawDataEx(this, &CmdLists, draw_list); -#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS - CmdListsCount = CmdLists.Size; -#endif } // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!