diff options
| author | hachem <im@hachem.wtf> | 2026-08-24 03:57:40 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-24 03:57:40 +0200 |
| commit | 59b7c407550d63e997ed1e7bed286be5c332c285 (patch) | |
| tree | 95f168df75d33326dde486b401c1abf62608ff7c /src/rendering/rhi.h | |
| parent | 7ae22084c74cbe0c127e0ea1c96ec22a1f47d221 (diff) | |
[feat]: work on render path exporting
Diffstat (limited to 'src/rendering/rhi.h')
| -rw-r--r-- | src/rendering/rhi.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rendering/rhi.h b/src/rendering/rhi.h index e4e7e62..6a2042a 100644 --- a/src/rendering/rhi.h +++ b/src/rendering/rhi.h @@ -22,6 +22,7 @@ namespace Donut::RHI Swapchain, // a pipeline's colour target = the presented image (resolved per backend) RGBA8, // 8-bit unorm colour (LDR / off-screen) RGBA16F, // half-float colour (HDR / cubemap) + RGBA32F, // full-float colour (raw observable export) D32, // 32-bit depth }; @@ -146,6 +147,19 @@ namespace Donut::RHI virtual auto begin_frame(const glm::vec4& clear) -> CommandList* = 0; virtual auto end_frame() -> void = 0; + // One-shot off-screen work outside the frame loop (used by the exporter): + // records a self-contained pass into a transient command list and blocks + // until the GPU finishes, so the target can be read back immediately. + virtual auto run_offscreen(const std::function<void(CommandList&)>& record) -> void = 0; + + // Reads a render target's colour back to the CPU as tightly-packed RGBA8, + // top-left origin (out is resized to width*height*4). For export/analysis. + virtual auto read_render_target(RenderTarget* target, std::vector<uint8_t>& out) -> void = 0; + + // Same, but as full-float RGBA (out resized to width*height*4 floats). Read + // an RGBA32F target back for raw observable export. + virtual auto read_render_target_float(RenderTarget* target, std::vector<float>& out) -> void = 0; + // ImGui lives above the RHI but its platform/render backend is per-device. virtual auto init_imgui() -> void = 0; virtual auto imgui_new_frame() -> void = 0; |
