XII Release 0.1.0
Loading...
Searching...
No Matches
xiiRenderGraphBuilder Class Reference

#include <RenderGraph.h>

Public Member Functions

xiiRenderGraphTextureHandle DeclareTexture (xiiStringView sName, const xiiGALTextureCreationDescription &description)
xiiRenderGraphTextureHandle DeclareTexture (xiiStringView sName, const xiiGALTextureCreationDescription &description, xiiBitflags< xiiRenderGraphResourceFlags > flags)
 Declares a texture with explicit lifetime flags. Exactly one of Transient or Persistent must be set.
xiiRenderGraphTextureHandle ImportTexture (xiiStringView sName, xiiSharedPtr< xiiGALTexture > pTexture, xiiBitflags< xiiGALResourceStateFlags > currentState)
 Imports an externally-owned texture as a read-only graph resource.
xiiRenderGraphTextureHandle ReadTexture (xiiRenderGraphTextureHandle hTexture, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphTextureHandle ReadTexture (xiiStringView sName, xiiBitflags< xiiGALResourceStateFlags > requiredState)
 Read a previously declared/imported texture by name. This is less efficient than using the handle directly, so prefer to store the handle if you need to read the same resource multiple times.
xiiRenderGraphTextureHandle WriteTexture (xiiRenderGraphTextureHandle hTexture, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphTextureHandle ReadWriteTexture (xiiRenderGraphTextureHandle hTexture, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphTextureHandle WriteTexture (xiiStringView sName, const xiiGALTextureCreationDescription &description, xiiBitflags< xiiGALResourceStateFlags > requiredState)
 Declares a new transient texture resource owned by the graph and registers the first write in one call.
void ExportTexture (xiiRenderGraphTextureHandle hTexture, xiiBitflags< xiiGALResourceStateFlags > finalState)
 Marks a texture version as a graph output and optionally transitions it to the consumer's state.
xiiRenderGraphBufferHandle DeclareBuffer (xiiStringView sName, const xiiGALBufferCreationDescription &description)
xiiRenderGraphBufferHandle DeclareBuffer (xiiStringView sName, const xiiGALBufferCreationDescription &description, xiiBitflags< xiiRenderGraphResourceFlags > flags)
 Declares a buffer with explicit lifetime flags. Exactly one of Transient or Persistent must be set.
xiiRenderGraphBufferHandle ImportBuffer (xiiStringView sName, xiiSharedPtr< xiiGALBuffer > pBuffer, xiiBitflags< xiiGALResourceStateFlags > currentState)
 Imports an externally-owned buffer as a read-only graph resource.
xiiRenderGraphBufferHandle ReadBuffer (xiiRenderGraphBufferHandle hBuffer, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphBufferHandle ReadBuffer (xiiStringView sName, xiiBitflags< xiiGALResourceStateFlags > requiredState)
 Read a previously declared/imported buffer by name. This is less efficient than using the handle directly, so prefer to store the handle if you need to read the same resource multiple times.
xiiRenderGraphBufferHandle WriteBuffer (xiiRenderGraphBufferHandle hBuffer, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphBufferHandle ReadWriteBuffer (xiiRenderGraphBufferHandle hBuffer, xiiBitflags< xiiGALResourceStateFlags > requiredState)
xiiRenderGraphBufferHandle WriteBuffer (xiiStringView sName, const xiiGALBufferCreationDescription &description, xiiBitflags< xiiGALResourceStateFlags > requiredState)
 Declares a new transient buffer resource owned by the graph and registers the first write in one call.
void ExportBuffer (xiiRenderGraphBufferHandle hBuffer, xiiBitflags< xiiGALResourceStateFlags > finalState)
 Marks a buffer version as a graph output and optionally transitions it to the consumer's state.
void SetPassSideEffects (bool bHasSideEffects)
xiiResult WaitForFence (xiiSharedPtr< xiiGALFence > fence, xiiUInt64 value)
void SetPassAllowMerge (bool bAllowMerge)
void SetPassRenderPassManaged (bool bManaged=true)
void SetPassPreparation (xiiDelegate< void(xiiRenderGraphPassContext &)> preparation)

Friends

class xiiRenderGraph

Detailed Description

Declarative API used inside a pass's setup callback to declare resource usage.

Each call to Read* or Write* records a dependency edge in the graph's dependency table and advances the resource version on writes. The builder may only be used within the setup callback passed to xiiRenderGraph::AddPass().

Member Function Documentation

◆ DeclareBuffer()

xiiRenderGraphBufferHandle xiiRenderGraphBuilder::DeclareBuffer ( xiiStringView sName,
const xiiGALBufferCreationDescription & description )
nodiscard

Declares a new transient buffer resource owned by the graph. Returns a handle pointing to version 0 (unwritten). Normally followed immediately by WriteBuffer() to register the first write.

◆ DeclareTexture()

xiiRenderGraphTextureHandle xiiRenderGraphBuilder::DeclareTexture ( xiiStringView sName,
const xiiGALTextureCreationDescription & description )
nodiscard

Declares a new transient texture resource owned by the graph. Returns a handle pointing to version 0 (unwritten). Normally followed immediately by WriteTexture() to register the first write.

◆ ReadBuffer()

xiiRenderGraphBufferHandle xiiRenderGraphBuilder::ReadBuffer ( xiiRenderGraphBufferHandle hBuffer,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a read dependency on the given buffer at its current version. Creates a dependency edge: this pass depends on the last writer.

◆ ReadTexture()

xiiRenderGraphTextureHandle xiiRenderGraphBuilder::ReadTexture ( xiiRenderGraphTextureHandle hTexture,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a read dependency on the given texture at its current version. Creates a dependency edge: this pass depends on the last writer.

◆ ReadWriteBuffer()

xiiRenderGraphBufferHandle xiiRenderGraphBuilder::ReadWriteBuffer ( xiiRenderGraphBufferHandle hBuffer,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a read-modify-write dependency on a buffer. Use this for atomics, append counters, and partial UAV updates that depend on contents produced by the parent version.

◆ ReadWriteTexture()

xiiRenderGraphTextureHandle xiiRenderGraphBuilder::ReadWriteTexture ( xiiRenderGraphTextureHandle hTexture,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a partial or read-modify-write texture update. Unlike WriteTexture(), this retains the producer of the parent version and orders the update after every parent-version reader.

◆ SetPassAllowMerge()

void xiiRenderGraphBuilder::SetPassAllowMerge ( bool bAllowMerge)

Controls whether this pass participates in render-pass merge groups. Default is true. Set to false if the pass must stand alone (e.g. readback).

◆ SetPassPreparation()

void xiiRenderGraphBuilder::SetPassPreparation ( xiiDelegate< void(xiiRenderGraphPassContext &)> preparation)

Records resource uploads before a managed native render pass begins. Uses this pass's declared resources; must restore their declared states before returning.

◆ SetPassRenderPassManaged()

void xiiRenderGraphBuilder::SetPassRenderPassManaged ( bool bManaged = true)

Lets the render graph create and begin the native render pass and framebuffer from declared RenderTarget / DepthRead / DepthWrite texture writes. The default is false so existing passes that call BeginRenderPass themselves remain source compatible.

◆ SetPassSideEffects()

void xiiRenderGraphBuilder::SetPassSideEffects ( bool bHasSideEffects)

Marks this pass as having side effects that prevent it from being culled. Call this for passes that write to swap-chain images, initiate readbacks, etc.

◆ WaitForFence()

xiiResult xiiRenderGraphBuilder::WaitForFence ( xiiSharedPtr< xiiGALFence > fence,
xiiUInt64 value )

Device-side readiness for resources produced outside this graph, including previous-frame history. The wait precedes submission barriers on this pass's queue. The graph owns the fence until execution; this never blocks the CPU.

◆ WriteBuffer()

xiiRenderGraphBufferHandle xiiRenderGraphBuilder::WriteBuffer ( xiiRenderGraphBufferHandle hBuffer,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a write to the given buffer, bumping its version. Returns the new versioned handle - store this, not the input handle.

◆ WriteTexture()

xiiRenderGraphTextureHandle xiiRenderGraphBuilder::WriteTexture ( xiiRenderGraphTextureHandle hTexture,
xiiBitflags< xiiGALResourceStateFlags > requiredState )
nodiscard

Declares a write to the given texture, bumping its version. Returns the new versioned handle - store this, not the input handle.


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