Class RenderGraph¶
Namespace: Apogee.Rendering.Graph
Assembly: Apogee.Rendering.dll
One frame's rendering as a graph. Passes declare how they use images and buffers;
public sealed class RenderGraph
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks¶
Images are tracked per mip level and array layer: a pass that declares a
Constructors¶
RenderGraph(GraphicsDevice, TransientPool)¶
A graph that can be compiled and executed.
public RenderGraph(GraphicsDevice device, TransientPool pool)
Parameters¶
device GraphicsDevice
pool TransientPool
RenderGraph()¶
A graph that can only be compiled: for tools, and for testing the planner without a GPU.
public RenderGraph()
Properties¶
Plan¶
The compiled plan, once
public GraphPlan? Plan { get; }
Property Value¶
Methods¶
AddPass(string, PassType, Action<PassBuilder>)¶
Adds a pass. setup runs now and declares the pass's resources and its execute callback; the callback runs during
public void AddPass(string name, PassType type, Action<PassBuilder> setup)
Parameters¶
name string
type PassType
setup Action<PassBuilder>
Compile()¶
Works out which passes run, what is allocated and where the barriers go. Throws
public GraphPlan Compile()
Returns¶
CreateBuffer(string, ulong, BufferUsage)¶
public BufferHandle CreateBuffer(string name, ulong size, BufferUsage usage)
Parameters¶
name string
size ulong
usage BufferUsage
Returns¶
CreateImage(string, in ImageDescription)¶
An image the graph allocates and frees: its contents exist only inside the frame.
public ImageHandle CreateImage(string name, in ImageDescription description)
Parameters¶
name string
description ImageDescription
Returns¶
Execute(Frame)¶
Records the graph into the frame's command buffer.
public void Execute(Frame frame)
Parameters¶
frame Frame
ImportBackbuffer(in Backbuffer)¶
The window's image: it starts undefined, ends ready to present, and is an output, so what draws into it always runs.
public ImageHandle ImportBackbuffer(in Backbuffer backbuffer)
Parameters¶
backbuffer Backbuffer
Returns¶
ImportBuffer(string, GpuBuffer, BufferState, BufferState, bool)¶
public BufferHandle ImportBuffer(string name, GpuBuffer buffer, BufferState initial, BufferState final, bool output = false)
Parameters¶
name string
buffer GpuBuffer
initial BufferState
final BufferState
output bool
Returns¶
ImportImage(string, GpuImage, ImageState, ImageState, bool, uint)¶
An image that exists outside the graph. It is in initial when the graph starts and is left in final.
With output the passes that write it always run.
public ImageHandle ImportImage(string name, GpuImage image, ImageState initial, ImageState final, bool output = false, uint sampledIndex = 0)
Parameters¶
name string
image GpuImage
initial ImageState
final ImageState
output bool
sampledIndex uint
The image's bindless index, if the passes read it by index.