1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-29 03:00:05 +00:00

Correct frame render buffer indexing to start at 0

This commit is contained in:
Rémy Tassoux 2025-10-20 19:00:31 +02:00
parent 28dabdcb9e
commit 86aaffb887

View file

@ -294,8 +294,8 @@ void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandL
// FIXME: We are assuming that this only gets called once per frame!
ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData();
ImGui_ImplDX12_ViewportData* vd = (ImGui_ImplDX12_ViewportData*)draw_data->OwnerViewport->RendererUserData;
vd->FrameIndex++;
ImGui_ImplDX12_RenderBuffers* fr = &vd->FrameRenderBuffers[vd->FrameIndex % bd->numFramesInFlight];
vd->FrameIndex++;
// Create and grow vertex/index buffers if needed
if (fr->VertexBuffer == nullptr || fr->VertexBufferSize < draw_data->TotalVtxCount)