From 59b7c407550d63e997ed1e7bed286be5c332c285 Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 24 Aug 2026 03:57:40 +0200 Subject: [feat]: work on render path exporting --- src/rendering/rhi.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/rendering/rhi.h') 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& 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& 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& 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; -- cgit v1.3