XII Release 0.1.0
Loading...
Searching...
No Matches
xiiRenderGraphProfiler Class Referenceabstract

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <RenderGraphProfiler.h>

Inheritance diagram for xiiRenderGraphProfiler:
[legend]

Public Member Functions

virtual void OnFrameBegin (xiiUInt64 uiFrameIndex)
 Selects the GPU frame before recording a graph. Several graphs may share one frame.
virtual void OnGraphBegin (xiiGALCommandList &commandList, xiiUInt64 uiGraphId, xiiUInt32 uiSubmissionIndex, xiiUInt32 uiQueueIndex)=0
 Called at the start of a submission command list.
virtual void OnGraphEnd (xiiGALCommandList &commandList, xiiUInt64 uiGraphId, xiiUInt32 uiSubmissionIndex, xiiUInt32 uiQueueIndex)=0
 Called at the end of a submission command list.
virtual void OnPassBegin (xiiGALCommandList &commandList, xiiStringView sPassName, xiiUInt32 uiPassIndex)=0
 Called immediately before a pass records its commands. Insert a begin-query here.
virtual void OnPassEnd (xiiGALCommandList &commandList, xiiStringView sPassName, xiiUInt32 uiPassIndex)=0
 Called immediately after a pass records its commands. Insert an end-query here.
virtual void OnFrameEnd (xiiUInt64 uiFrameIndex)=0
virtual void OnFrameAbort ()=0
virtual float GetPassDurationMs (xiiStringView sPassName) const =0
virtual void SetGraphInstance (xiiUInt64 uiInstanceId)
 Called before recording a graph; isolates instances which share a stable graph name.
virtual bool GetPassTiming (xiiUInt64 uiGraphId, xiiUInt32 uiPassIndex, xiiStringView sPassName, float &out_fDurationMs, xiiUInt64 &out_uiFrameIndex) const
 Lookup by process-local graph instance and registered pass index. False means unavailable, not zero cost.

Detailed Description

Copyright (c) Theophilus Eriata. All Rights Reserved.

Abstract interface for per-pass GPU timing instrumentation in the render graph.

Implement this interface to capture GPU performance data during render graph execution. The executor calls OnGraphBegin / OnGraphEnd around each queue submission command list, and OnPassBegin / OnPassEnd around each pass's RecordCommands call. OnFrameEnd is called after all passes have been submitted so implementations can schedule readback or finalize timing data.

Member Function Documentation

◆ GetPassDurationMs()

virtual float xiiRenderGraphProfiler::GetPassDurationMs ( xiiStringView sPassName) const
nodiscardpure virtual

Returns the last resolved GPU duration for the given pass in milliseconds. Returns 0.0f if no data is yet available (warmup frames).

Implemented in xiiRenderGraphTimestampProfiler.

◆ GetPassTiming()

virtual bool xiiRenderGraphProfiler::GetPassTiming ( xiiUInt64 uiGraphId,
xiiUInt32 uiPassIndex,
xiiStringView sPassName,
float & out_fDurationMs,
xiiUInt64 & out_uiFrameIndex ) const
inlinevirtual

Lookup by process-local graph instance and registered pass index. False means unavailable, not zero cost.

Reimplemented in xiiRenderGraphTimestampProfiler.

◆ OnFrameAbort()

virtual void xiiRenderGraphProfiler::OnFrameAbort ( )
pure virtual

Called instead of OnFrameEnd when recording fails, after closing any active query scope. Discard this frame's measurements while retaining in-flight query resources safely.

Implemented in xiiRenderGraphTimestampProfiler.

◆ OnFrameBegin()

virtual void xiiRenderGraphProfiler::OnFrameBegin ( xiiUInt64 uiFrameIndex)
inlinevirtual

Selects the GPU frame before recording a graph. Several graphs may share one frame.

Reimplemented in xiiRenderGraphTimestampProfiler.

◆ OnFrameEnd()

virtual void xiiRenderGraphProfiler::OnFrameEnd ( xiiUInt64 uiFrameIndex)
pure virtual

Called once per frame after all passes have been submitted. Implementations should schedule result readback here (with appropriate frame delay).

Implemented in xiiRenderGraphTimestampProfiler.

◆ OnGraphBegin()

virtual void xiiRenderGraphProfiler::OnGraphBegin ( xiiGALCommandList & commandList,
xiiUInt64 uiGraphId,
xiiUInt32 uiSubmissionIndex,
xiiUInt32 uiQueueIndex )
pure virtual

Called at the start of a submission command list.

Implemented in xiiRenderGraphTimestampProfiler.

◆ OnGraphEnd()

virtual void xiiRenderGraphProfiler::OnGraphEnd ( xiiGALCommandList & commandList,
xiiUInt64 uiGraphId,
xiiUInt32 uiSubmissionIndex,
xiiUInt32 uiQueueIndex )
pure virtual

Called at the end of a submission command list.

Implemented in xiiRenderGraphTimestampProfiler.

◆ OnPassBegin()

virtual void xiiRenderGraphProfiler::OnPassBegin ( xiiGALCommandList & commandList,
xiiStringView sPassName,
xiiUInt32 uiPassIndex )
pure virtual

Called immediately before a pass records its commands. Insert a begin-query here.

Implemented in xiiRenderGraphTimestampProfiler.

◆ OnPassEnd()

virtual void xiiRenderGraphProfiler::OnPassEnd ( xiiGALCommandList & commandList,
xiiStringView sPassName,
xiiUInt32 uiPassIndex )
pure virtual

Called immediately after a pass records its commands. Insert an end-query here.

Implemented in xiiRenderGraphTimestampProfiler.

◆ SetGraphInstance()

virtual void xiiRenderGraphProfiler::SetGraphInstance ( xiiUInt64 uiInstanceId)
inlinevirtual

Called before recording a graph; isolates instances which share a stable graph name.

Reimplemented in xiiRenderGraphTimestampProfiler.


The documentation for this class was generated from the following file: