XII Release 0.1.0
Loading...
Searching...
No Matches
xiiRenderGraphTimestampProfiler Class Referencefinal

#include <RenderGraphProfiler.h>

Inheritance diagram for xiiRenderGraphTimestampProfiler:
[legend]

Public Member Functions

 xiiRenderGraphTimestampProfiler (xiiSharedPtr< xiiGALDevice > pDevice)
 Copyright (c) Theophilus Eriata. All Rights Reserved.
void OnFrameBegin (xiiUInt64 uiFrameIndex) override
 Selects the GPU frame before recording a graph. Several graphs may share one frame.
void SetGraphInstance (xiiUInt64 uiInstanceId) override
 Called before recording a graph; isolates instances which share a stable graph name.
void OnGraphBegin (xiiGALCommandList &commandList, xiiUInt64 uiGraphId, xiiUInt32 uiSubmissionIndex, xiiUInt32 uiQueueIndex) override
 Called at the start of a submission command list.
void OnGraphEnd (xiiGALCommandList &commandList, xiiUInt64 uiGraphId, xiiUInt32 uiSubmissionIndex, xiiUInt32 uiQueueIndex) override
 Called at the end of a submission command list.
void OnPassBegin (xiiGALCommandList &commandList, xiiStringView sPassName, xiiUInt32 uiPassIndex) override
 Called immediately before a pass records its commands. Insert a begin-query here.
void OnPassEnd (xiiGALCommandList &commandList, xiiStringView sPassName, xiiUInt32 uiPassIndex) override
 Called immediately after a pass records its commands. Insert an end-query here.
void OnFrameEnd (xiiUInt64 uiFrameIndex) override
void OnFrameAbort () override
float GetPassDurationMs (xiiStringView sPassName) const override
 Returns the last resolved GPU duration for the given pass in milliseconds.
bool GetPassTiming (xiiUInt64 uiGraphId, xiiUInt32 uiPassIndex, xiiStringView sPassName, float &out_fDurationMs, xiiUInt64 &out_uiFrameIndex) const override
 Lookup by process-local graph instance and registered pass index. False means unavailable, not zero cost.
float GetFrameDurationMs () const
 Returns the last resolved GPU duration for the entire frame in milliseconds.
float GetGraphDurationMs (xiiUInt64 uiGraphId) const
 Returns the sum of submission timings for one graph or one graph queue.
float GetQueueDurationMs (xiiUInt64 uiGraphId, xiiUInt32 uiQueueIndex) const

Static Public Attributes

static constexpr xiiUInt32 s_uiRingFrameCount = 3U
 Number of in-flight frames buffered.
static constexpr xiiUInt32 s_uiMaxTrackedPasses = 128U

Detailed Description

A concrete render graph profiler that uses GPU Duration queries.

Uses xiiGALQueryType::Duration to bracket each pass with BeginQuery / EndQuery. Results are read back with a configurable number of frames of delay (default: 2) to avoid GPU stalls. Up to xiiRenderGraphTimestampProfiler::MaxTrackedPasses distinct pass names can be tracked simultaneously.

Member Function Documentation

◆ GetPassDurationMs()

float xiiRenderGraphTimestampProfiler::GetPassDurationMs ( xiiStringView sPassName) const
nodiscardoverridevirtual

Returns the last resolved GPU duration for the given pass in milliseconds.

Implements xiiRenderGraphProfiler.

◆ GetPassTiming()

bool xiiRenderGraphTimestampProfiler::GetPassTiming ( xiiUInt64 uiGraphId,
xiiUInt32 uiPassIndex,
xiiStringView sPassName,
float & out_fDurationMs,
xiiUInt64 & out_uiFrameIndex ) const
overridevirtual

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

Reimplemented from xiiRenderGraphProfiler.

◆ OnFrameAbort()

void xiiRenderGraphTimestampProfiler::OnFrameAbort ( )
overridevirtual

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.

Implements xiiRenderGraphProfiler.

◆ OnFrameBegin()

void xiiRenderGraphTimestampProfiler::OnFrameBegin ( xiiUInt64 uiFrameIndex)
overridevirtual

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

Reimplemented from xiiRenderGraphProfiler.

◆ OnFrameEnd()

void xiiRenderGraphTimestampProfiler::OnFrameEnd ( xiiUInt64 uiFrameIndex)
overridevirtual

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

Implements xiiRenderGraphProfiler.

◆ OnGraphBegin()

void xiiRenderGraphTimestampProfiler::OnGraphBegin ( xiiGALCommandList & commandList,
xiiUInt64 uiGraphId,
xiiUInt32 uiSubmissionIndex,
xiiUInt32 uiQueueIndex )
overridevirtual

Called at the start of a submission command list.

Implements xiiRenderGraphProfiler.

◆ OnGraphEnd()

void xiiRenderGraphTimestampProfiler::OnGraphEnd ( xiiGALCommandList & commandList,
xiiUInt64 uiGraphId,
xiiUInt32 uiSubmissionIndex,
xiiUInt32 uiQueueIndex )
overridevirtual

Called at the end of a submission command list.

Implements xiiRenderGraphProfiler.

◆ OnPassBegin()

void xiiRenderGraphTimestampProfiler::OnPassBegin ( xiiGALCommandList & commandList,
xiiStringView sPassName,
xiiUInt32 uiPassIndex )
overridevirtual

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

Implements xiiRenderGraphProfiler.

◆ OnPassEnd()

void xiiRenderGraphTimestampProfiler::OnPassEnd ( xiiGALCommandList & commandList,
xiiStringView sPassName,
xiiUInt32 uiPassIndex )
overridevirtual

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

Implements xiiRenderGraphProfiler.

◆ SetGraphInstance()

void xiiRenderGraphTimestampProfiler::SetGraphInstance ( xiiUInt64 uiInstanceId)
overridevirtual

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

Reimplemented from xiiRenderGraphProfiler.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/RenderGraphProfiler.h
  • /home/runner/work/XII/XII/Source/Engine/GraphicsCore/Pipeline/Implementation/RenderGraphProfiler.cpp