Add renderer readback command contract

This commit is contained in:
2026-06-02 15:10:44 +02:00
parent a6a4e7b249
commit c58b9a3718
9 changed files with 255 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ enum class RecordedRenderCommandKind : std::uint8_t {
bind_shader,
bind_mesh,
draw,
read_texture,
end_render_pass,
trace_marker,
};
@@ -23,6 +24,9 @@ struct RecordedRenderCommand {
ClearColor clear_color {};
Viewport viewport {};
MeshDesc mesh_desc {};
TextureDesc texture_desc {};
ReadbackRegion readback_region {};
std::uint64_t readback_bytes = 0;
const char* component = "";
const char* name = "";
};
@@ -83,6 +87,10 @@ public:
[[nodiscard]] pp::foundation::Status bind_shader(IShaderProgram& shader) noexcept override;
[[nodiscard]] pp::foundation::Status bind_mesh(IMesh& mesh) noexcept override;
[[nodiscard]] pp::foundation::Status draw() noexcept override;
[[nodiscard]] pp::foundation::Status read_texture(
ITexture2D& texture,
ReadbackRegion region,
IReadbackBuffer& destination) noexcept override;
void end_render_pass() noexcept override;
[[nodiscard]] bool in_render_pass() const noexcept;