Skip to content

Commit

Permalink
Fixed ImGui Index offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Terria-K committed Oct 12, 2024
1 parent 907fb07 commit 5772361
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Riateu/Core/ImGui/ImGuiRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ private void RenderCommandLists(CommandBuffer buffer, RenderPass renderPass, ImD
renderPass.BindVertexBuffer(imGuiVertexBuffer);
renderPass.BindIndexBuffer(imGuiIndexBuffer, IndexElementSize.SixteenBit);

uint vertexOffset = 0;
int vertexOffset = 0;
uint indexOffset = 0;

for (int n = 0; n < drawDataPtr.CmdListsCount; n += 1)
{
Expand Down Expand Up @@ -296,13 +297,14 @@ private void RenderCommandLists(CommandBuffer buffer, RenderPass renderPass, ImD
renderPass.DrawIndexedPrimitives(
drawCmd.ElemCount,
1,
0u,
(int)vertexOffset,
indexOffset,
vertexOffset,
0u
);
indexOffset += (uint)drawCmd.ElemCount;
}

vertexOffset += (uint)cmdList.VtxBuffer.Size;
vertexOffset += cmdList.VtxBuffer.Size;
}
}

Expand Down

0 comments on commit 5772361

Please sign in to comment.