Add renderer trace scope contract

This commit is contained in:
2026-06-02 16:55:23 +02:00
parent 07293c0590
commit bbe3db1747
9 changed files with 305 additions and 101 deletions

View File

@@ -27,6 +27,8 @@ enum class RecordedRenderCommandKind : std::uint8_t {
blit_render_target,
end_render_pass,
trace_marker,
trace_begin_scope,
trace_end_scope,
};
struct RecordedRenderCommand {
@@ -176,10 +178,13 @@ private:
class RecordingRenderTrace final : public IRenderTrace {
public:
explicit RecordingRenderTrace(std::vector<RecordedRenderCommand>& commands) noexcept;
void marker(const char* component, const char* name) noexcept override;
[[nodiscard]] pp::foundation::Status marker(const char* component, const char* name) noexcept override;
[[nodiscard]] pp::foundation::Status begin_scope(const char* component, const char* name) noexcept override;
[[nodiscard]] pp::foundation::Status end_scope() noexcept override;
private:
std::vector<RecordedRenderCommand>* commands_ = nullptr;
std::uint32_t scope_depth_ = 0;
};
class RecordingRenderDevice final : public IRenderDevice {