1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-22 01:54:21 +00:00

ImDrawData: call _PopUnusedDrawCmd() later. as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch). (#6406, #4879, #1878)

Amend/fix dbeeeae for docking.
+ Build fix when using IMGUI_DISABLE_DEBUG_TOOLS
This commit is contained in:
ocornut 2023-07-12 18:22:34 +02:00
parent 0110f4c8cc
commit 023e59a5f2
2 changed files with 5 additions and 1 deletions

View file

@ -5356,8 +5356,12 @@ void ImGui::Render()
if (viewport->DrawLists[1] != NULL)
AddDrawListToDrawDataEx(&viewport->DrawDataP, viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
// We call _PopUnusedDrawCmd() last thing, as RenderDimmedBackgrounds() rely on a valid command being there (especially in docking branch).
ImDrawData* draw_data = &viewport->DrawDataP;
IM_ASSERT(draw_data->CmdLists.Size == draw_data->CmdListsCount);
for (int draw_list_n = 0; draw_list_n < draw_data->CmdLists.Size; draw_list_n++)
draw_data->CmdLists[draw_list_n]->_PopUnusedDrawCmd();
g.IO.MetricsRenderVertices += draw_data->TotalVtxCount;
g.IO.MetricsRenderIndices += draw_data->TotalIdxCount;
}