ImGui DirectX 12 예제에서 사용된 멀티프레임 구조 초기화에 대해 설명드리겠습니다. 핵심은 프레임 별 리소스 분리와 GPU-CPU 동기화를 통해 프레임 파이프라인을 효율화하는 데 있습니다.
FrameContext
struct FrameContext
{
ID3D12CommandAllocator* CommandAllocator;
UINT64 FenceValue;
};
APP_NUM_FRAMES_IN_FLIGHT
만큼 배열로 선언되어 GPU가 렌더링 중인 프레임과 CPU가 준비하는 프레임이 겹치지 않도록 구성됨.RenderDrawData()
에 넘기는데,Viewport
, Docking
, FontAtlas
, PlatformWindows
등도 프레임 사이에 상태를 공유하거나 유지합니다.Begin()
ImGui_ImplDX12_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGuizmo::BeginFrame();