diff options
| author | hachem <im@hachem.wtf> | 2026-08-23 21:55:36 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-23 21:55:36 +0200 |
| commit | 5ea6c14c0e14bacee766ce1280ab2c71564e05ec (patch) | |
| tree | 34620051e8eaf65db4ff9cd40ffd982a03e1ccc8 /src/rendering/render_path.h | |
| parent | 8742482311b86bb705d93336805ab26881e96070 (diff) | |
[feat]: implement ui layer arch
Diffstat (limited to 'src/rendering/render_path.h')
| -rw-r--r-- | src/rendering/render_path.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/rendering/render_path.h b/src/rendering/render_path.h new file mode 100644 index 0000000..0d97395 --- /dev/null +++ b/src/rendering/render_path.h @@ -0,0 +1,40 @@ +#pragma once + +#include "rhi.h" +#include "view.h" +#include "scene_renderer.h" +#include "black_hole_renderer.h" +#include "core/memory.h" + +#include <string> + +namespace Donut +{ + class Scene; + + // Owns the device-side rendering: the two portable renderers, the shared HDRI + // cubemap, and the per-frame composition (off-screen geodesic pass -> present, + // or the scene pass), with ImGui drawn on top inside the swapchain pass. The + // Application hands it a Scene + View each frame; it knows nothing about the UI. + class RenderPath + { + public: + auto init(RHI::Device& device, const std::string& hdri_path) -> bool; + auto shutdown() -> void; + + // Rebuilds the environment cubemap if the path changed (device-idle). + auto sync_hdri(const std::string& hdri_path) -> void; + + // Composes one frame's viewport into the swapchain command list. `moving` + // drives the black hole's progressive resolution; `time` animates the disk. + auto render(RHI::CommandList& cmd, Scene& scene, View view, + int fb_width, int fb_height, bool moving, float time) -> void; + + private: + RHI::Device* m_device = nullptr; + Scope<SceneRenderer> m_scene_renderer; + Scope<BlackHoleRenderer> m_black_hole_renderer; + Ref<RHI::Texture> m_cubemap; + std::string m_hdri_path; + }; +} |
