ezEngine Release 26.9
Loading...
Searching...
No Matches
ezRenderGraphPassBuilder Class Reference

#include <RenderGraphPassBuilder.h>

Public Member Functions

 ezRenderGraphPassBuilder (ezRenderGraphPassBuilder &&rhs) noexcept
 
void operator= (ezRenderGraphPassBuilder &&rhs) noexcept
 
Texture
ezRenderGraphPassBuilderReadTexture (ezRenderGraphTextureHandle hTexture, ezGALTextureRange range={}, ezBitflags< ezGALResourceState > access=ezGALResourceState::ShaderResource, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 
ezRenderGraphPassBuilderWriteTexture (ezRenderGraphTextureHandle hTexture, ezGALTextureRange range={}, ezBitflags< ezGALResourceState > access=ezGALResourceState::UnorderedAccess, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 Declare that this pass writes to a texture. stage is optional and should only be used in graphics passes when a later stage reads a texture so allow for more concurrent work on the GPU.
 
Buffer
ezRenderGraphPassBuilderReadBuffer (ezRenderGraphBufferHandle hBuffer, ezBitflags< ezGALResourceState > access=ezGALResourceState::ShaderResource, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 Declare that this pass reads a buffer. stage is optional and should only be used in graphics passes when a later stage reads a buffer so allow for more concurrent work on the GPU.
 
ezRenderGraphPassBuilderWriteBuffer (ezRenderGraphBufferHandle hBuffer, ezBitflags< ezGALResourceState > access=ezGALResourceState::UnorderedAccess, ezBitflags< ezGALShaderStageFlags > stage=ezGALShaderStageFlags::Auto)
 Declare that this pass writes to a buffer. stage is optional and should only be used in graphics passes when a later stage reads a buffer so allow for more concurrent work on the GPU.
 
Render Targets
ezRenderGraphPassBuilderAddColorTarget (ezRenderGraphTextureHandle hTexture, ezGALRenderTargetRange range={}, ezEnum< ezGALRenderTargetLoadOp > loadOp={}, ezEnum< ezGALRenderTargetStoreOp > storeOp={}, ezEnum< ezGALResourceFormat > overrideViewFormat=ezGALResourceFormat::Invalid, ezEnum< ezGALTextureType > overrideViewType=ezGALTextureType::Invalid)
 Adds a texture as a color render target. This will implicitly result in WriteTexture so there is no need to declare read / write operations for render targets.
 
ezRenderGraphPassBuilderSetClearColor (ezUInt8 uiIndex, const ezColor &color=ezColor(0, 0, 0, 0))
 Sets the clear color for the color target at the given index and switches the load op to Clear. SetColorTarget must have been called for this index first.
 
ezRenderGraphPassBuilderAddDepthStencilTarget (ezRenderGraphTextureHandle hTexture, ezGALRenderTargetRange range={}, ezEnum< ezGALRenderTargetLoadOp > depthLoadOp={}, ezEnum< ezGALRenderTargetStoreOp > depthStoreOp={}, ezEnum< ezGALRenderTargetLoadOp > stencilLoadOp={}, ezEnum< ezGALRenderTargetStoreOp > stencilStoreOp={}, bool bReadOnly=false)
 Bind a texture as the depth/stencil target. This will implicitly result in WriteTexture so there is no need to declare read / write operations for render targets.
 
ezRenderGraphPassBuilderSetClearDepth (float fDepthClear=1.0f)
 Sets the clear depth value and switches the depth load op to Clear. SetDepthStencilTarget must have been called first.
 
ezRenderGraphPassBuilderSetClearStencil (ezUInt8 uiStencilClear=0)
 Sets the clear stencil value and switches the stencil load op to Clear. SetDepthStencilTarget must have been called first.
 
Pass Configuration
ezRenderGraphPassBuilderHasSideEffects ()
 Marks this pass as having externally visible side effects (readback, etc.). Prevents the pass from being culled even if no other pass reads its outputs.
 
ezRenderGraphPassBuilderSetStereoscopic (bool bStereoscopic=true)
 Marks this pass as stereoscopic. Only valid for graphics passes.
 
ezRenderGraphPassBuilderSetExecuteCallback (ezRenderGraphExecuteFunction callback)
 

Friends

class ezRenderGraph
 

Detailed Description

Returned by the render graph when adding a pass. The caller declares all resource accesses through this builder, then sets an execution callback. Only one instance of this class can exist at any time for each graph.

For render passes, the render graph will call BeginRendering/EndRendering automatically based on SetColorTarget/SetDepthStencilTarget declarations. The execute callback only needs to bind shaders, resources, and draw.

Member Function Documentation

◆ ReadTexture()

Declare that this pass reads a texture. stage is optional and should only be used in graphics passes when a later stage reads a texture so allow for more concurrent work on the GPU.

For depth textures, the correct SRV state is ezGALResourceState::DepthStencilRead instead of ezGALResourceState::ShaderResource, but this function automatically switches this for your convenience.

◆ SetExecuteCallback()

ezRenderGraphPassBuilder & ezRenderGraphPassBuilder::SetExecuteCallback ( ezRenderGraphExecuteFunction  callback)

Set the callback invoked when this pass executes. For render passes, BeginRendering will already be active when the callback is invoked. As the execute callback is called at a later date, make sure to capture variables by value if using a lambda.


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