public sealed class RenderGraphA frame, declared before it happens.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Passes state what they read and write; the graph culls what nothing needs, gives non-overlapping resources the same memory, places the barriers, derives the attachment load and store actions, and then runs the passes that survived.
This is not optional garnish ([05](../../docs/plan/05-graphics-rhi.md)). With six backends, hand-maintaining barrier correctness across deferred shading, shadows, SSAO, SSR, TAA, bloom and depth of field is not achievable — and a barrier that is merely too broad costs performance silently while one that is too narrow is a race that reproduces on one vendor's driver and not another's. Hand-written barriers stay available through Barrier for the hot paths that want them.
The graph is rebuilt every frame and that is deliberate: a frame's passes depend on what is visible, and a cached graph would be a cache invalidated by everything. Rebuilding is cheap because the physical resources are not — TransientResourcePool holds those across frames.
Fields and properties (9)
public TransientResourcePool PoolThe pool its transient resources come from.
public int PassCountHow many passes were declared.
public int SurvivingPassCountHow many passes survived culling. Meaningless before Compile.
public int ResourceCountHow many virtual resources were declared.
public int BarrierCountHow many barriers the last Execute emitted.
public QueueScheduling SchedulingWhether the frame is spread over the device's queues, or all on the graphics one.
public RenderGraphSchedule? ScheduleWhich queue each pass runs on. Meaningless before Compile.
public IReadOnlyList<string> WarningsWarnings the graph found while compiling — frames that run and quietly waste work.
public IGpuScopeSink? ProfilerWhere each pass's cost is reported, or to measure nothing.
Methods (17)
public RenderGraph(IGraphicsDevice device)Creates a graph and the pool its transients come from.
public RenderGraph(IGraphicsDevice device, TransientResourcePool pool)Creates a graph over an existing pool.
public GraphTexture CreateTexture(in TextureDescription description)Declares a texture the graph will provide.
public GraphBuffer CreateBuffer(in BufferDescription description)Declares a buffer the graph will provide.
public GraphTexture ImportTexture(TextureHandle handle, TextureViewHandle view, in TextureDescription description, ResourceState entryState = Undefined, ResourceState exitState = Undefined)Brings a texture the graph does not own into it.
public GraphBuffer ImportBuffer(BufferHandle handle, in BufferDescription description, ResourceState entryState = Undefined, ResourceState exitState = Undefined)Brings a buffer the graph does not own into it.
public void AddPass(string name, Action<RenderGraphPassBuilder> setup)Adds a pass.
public void Compile()Works out what runs, what shares memory, and where the barriers go.
public void Execute(ICommandList commandList)Runs it, all on one queue.
public void Execute(IRenderGraphQueues queues)Runs it, one command list per segment of the schedule.
public void Reset()Forgets the frame, keeping the physical resources.
public string ToGraphviz()The compiled graph as Graphviz DOT.
public void DisposePool()Releases the pool, when the graph made one.
public TextureHandle TextureOf(GraphTexture texture)The physical texture a virtual one was given.
public TextureViewHandle ViewOf(GraphTexture texture)The default view of the physical texture a virtual one was given.
public BufferHandle BufferOf(GraphBuffer buffer)The physical buffer a virtual one was given.
public TextureDescription DescribeTexture(GraphTexture texture)The description a texture was declared or imported with.
Used by (149, showing 40)
- TriangleGameHelloTriangle
- VideoGameVideoPlayback
- AppGraphicsVixen.App.Hosting
- AutoExposureRendererVixen.Rendering.PostFx
- AutoExposureTestsVixen.Rendering.PostFx.Tests
- BentNormalAmbientImageTestsVixen.Graphics.Golden.Tests
- BloomRendererVixen.Rendering.PostFx
- BloomTestsVixen.Rendering.PostFx.Tests
- BufferReadbackRendererVixen.Rendering
- BufferTransferDeviceTestsVixen.Graphics.Golden.Tests
- BufferTransferTestsVixen.Rendering.Tests
- BufferUploadRendererVixen.Rendering
- ClusterCullingDeviceTestsVixen.Graphics.Golden.Tests
- ClusterCullingRendererVixen.Rendering
- ClusteredLightingTestsVixen.Rendering.Tests
- CompositorAssetTestsVixen.Rendering.Tests
- CompositorFrameVixen.Rendering
- CompositorLifetimeTestsVixen.Rendering.Tests
- ComputeRendererVixen.Rendering
- DebugDrawImageTestsVixen.Graphics.Golden.Tests
- DebugOverlayRendererVixen.Engine.Renderer
- DepthPrepassTestsVixen.Rendering.Tests
- DepthResolveImageTestsVixen.Graphics.Golden.Tests
- DepthResolveTestsVixen.Graphics.RenderGraph.Tests
- DescriptorBindingTestsVixen.Rendering.Tests
- DistanceFieldAoImageTestsVixen.Graphics.Golden.Tests
- DitherImageTestsVixen.Graphics.Golden.Tests
- EditorGizmoFacingDeviceTestsVixen.Graphics.Golden.Tests
- FixtureVixen.Graphics.Golden.Tests
- FixtureTextureViewTestsVixen.Graphics.Golden.Tests
- ForwardFrameTestsVixen.Rendering.Tests
- FrameVixen.Rendering.Tests
- FrameResizeTestsVixen.Rendering.PostFx.Tests
- FramesVixen.Rendering.Tests
- FullScreenRendererVixen.Rendering
- GlobalDistanceFieldRendererVixen.Rendering
- GoldenImageTestsVixen.Graphics.Golden.Tests
- GpuCullingRendererVixen.Rendering
- GpuVisibilityGroupTestsVixen.Rendering.Tests
- GraphicsCompositorVixen.Rendering