From 7877331d8afd4031d702d7fc043350e9d07ab8a9 Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Thu, 22 Sep 2022 14:03:01 +0200 Subject: [PATCH] [ImGui] Use ImDrawCmd::IdxOffset field https://github.com/ocornut/imgui/commit/c80e8b964cbb75c4202949ad86f4b0bb3ea6aa44 https://github.com/ocornut/imgui/issues/4845#issuecomment-1003329113 --- src/xenia/ui/imgui_drawer.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/xenia/ui/imgui_drawer.cc b/src/xenia/ui/imgui_drawer.cc index 5f3075ca5..a3c33f703 100644 --- a/src/xenia/ui/imgui_drawer.cc +++ b/src/xenia/ui/imgui_drawer.cc @@ -336,14 +336,13 @@ void ImGuiDrawer::RenderDrawLists(ImDrawData* data, batch.index_count = cmd_list->IdxBuffer.size(); immediate_drawer_->BeginDrawBatch(batch); - int index_offset = 0; for (int j = 0; j < cmd_list->CmdBuffer.size(); ++j) { const auto& cmd = cmd_list->CmdBuffer[j]; ImmediateDraw draw; draw.primitive_type = ImmediatePrimitiveType::kTriangles; draw.count = cmd.ElemCount; - draw.index_offset = index_offset; + draw.index_offset = cmd.IdxOffset; draw.texture = reinterpret_cast(cmd.TextureId); draw.scissor = true; draw.scissor_left = cmd.ClipRect.x; @@ -351,8 +350,6 @@ void ImGuiDrawer::RenderDrawLists(ImDrawData* data, draw.scissor_right = cmd.ClipRect.z; draw.scissor_bottom = cmd.ClipRect.w; immediate_drawer_->Draw(draw); - - index_offset += cmd.ElemCount; } immediate_drawer_->EndDrawBatch();