Files
XCEngine/docs/api/XCEngine/Editor/UI/ImGuiBackendBridge/Frame-Rendering.md

1.2 KiB

ImGuiBackendBridge Frame Rendering

命名空间: XCEngine::Editor::UI

类型: method group

源文件: editor/src/UI/ImGuiBackendBridge.h

签名

void BeginFrame() const;
void RenderDrawData(ID3D12GraphicsCommandList* commandList) const;

作用

驱动 ImGui backend 的逐帧准备和 D3D12 draw data 提交。

当前实现行为

BeginFrame()

  • 依次调用:
    • ImGui_ImplDX12_NewFrame()
    • ImGui_ImplWin32_NewFrame()
    • ImGui::NewFrame()
  • 这说明它负责的是 backend 和 ImGui immediate frame 的起点。

RenderDrawData(commandList)

  • 直接调用:
ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData(), commandList);
  • 当前不做额外状态包装,调用方需要保证 command list 和 descriptor heap 已处在可渲染状态。

当前使用位置

  • Application 每帧会先调用 m_imguiBackend.BeginFrame()
  • D3D12WindowRenderer 在最终回写到交换链前会调用 RenderDrawData(...)

相关文档