summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Linn <jl@conductive.de>2022-09-22 14:03:01 +0200
committerRick Gibbed <rick@gibbed.us>2022-12-28 14:16:32 -0600
commit7877331d8afd4031d702d7fc043350e9d07ab8a9 (patch)
treeba893ad71625928ad3996314d97aa073e2d0b826
parent8f88bb237ebd2b9fd41410aa577425ad1860fe95 (diff)
[ImGui] Use ImDrawCmd::IdxOffset field
https://github.com/ocornut/imgui/commit/c80e8b964cbb75c4202949ad86f4b0bb3ea6aa44 https://github.com/ocornut/imgui/issues/4845#issuecomment-1003329113
-rw-r--r--src/xenia/ui/imgui_drawer.cc5
1 files changed, 1 insertions, 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<ImmediateTexture*>(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();