Files
HelloVulkan/Engine/CMakeLists.txt
T
atdunbg 07792c34d7 feat: ImGui 叠加层接入 RenderGraph(docking 分支,dynamic rendering)
框架与 UI 的职责边界:
- ImGuiLayer(Engine/ImGui):只做管线桥接——上下文初始化、
  NewFrame/BuildDrawData、draw data 录入 cmd;框架自身永不绘制
  任何 ImGui 控件,UI 内容全部由派生类在 OnRenderOverlay() 定义
- 每帧顺序:NewFrame → OnRenderOverlay(声明控件)→ BuildDrawData →
  Renderer.Render(RG: Forward → ImGui(loadOp=Load 叠加) → Present)
- ImGui pass 常驻 RG,未启用叠加层时空转,无图结构开销
- 后端共存:VK_EXT_shader_object 引擎无 vk::Pipeline,ImGui 用
  UseDynamicRendering + PipelineInfoMain.PipelineRenderingCreateInfo
  (swapchain 格式),不需要 RenderPass
- 析构序:ImGuiLayer 在 Application 成员序中后声明(先于 Renderer
  析构),析构内 waitIdle 保证后端资源安全销毁

App 示例(证明职责边界):Scene Debug 面板实时拖动阴影光方向,
` 键反折叠加层
2026-09-22 17:09:55 +08:00

36 lines
913 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
file(GLOB_RECURSE ENGINE_SOURCES
src/*.cpp
)
# ImGui(docking 分支,vendored submodule)
set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/Lib/imgui)
set(IMGUI_SOURCES
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp
)
# 编译成静态库
add_library(Engine STATIC ${ENGINE_SOURCES} ${IMGUI_SOURCES})
target_include_directories(Engine PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/Lib/entt/src
${IMGUI_DIR}
${IMGUI_DIR}/backends
)
# 链接第三方库
target_link_libraries(Engine PUBLIC
glfw
Vulkan::Vulkan
spdlog::spdlog
stb
assimp::assimp
)
target_compile_definitions(Engine PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)