Struct RenderGraphBuilder
Use this struct to set up a new Render Pass.
Implements
Inherited Members
Namespace: UnityEngine.Rendering.RenderGraphModule
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule", null)]
[Obsolete("RenderGraphBuilder is deprecated, use IComputeRenderGraphBuilder/IRasterRenderGraphBuilder/IUnsafeRenderGraphBuilder instead.")]
public struct RenderGraphBuilder : IDisposable
Methods
AllowPassCulling(bool)
Allow or not pass culling By default all passes can be culled out if the render graph detects it's not actually used. In some cases, a pass may not write or read any texture but rather do something with side effects (like setting a global texture parameter for example). This function can be used to tell the system that it should not cull this pass.
Declaration
public void AllowPassCulling(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value | True to allow pass culling. |
AllowRendererListCulling(bool)
Allow or not pass culling based on renderer list results By default all passes can be culled out if the render graph detects they are using a renderer list that is empty (does not draw any geometry) In some cases, a pass may not write or read any texture but rather do something with side effects (like setting a global texture parameter for example). This function can be used to tell the system that it should not cull this pass.
Declaration
public void AllowRendererListCulling(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value | True to allow pass culling. |
CreateTransientBuffer(in BufferDesc)
Create a new Render Graph Graphics Buffer resource. This Graphics Buffer will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.
Declaration
public BufferHandle CreateTransientBuffer(in BufferDesc desc)
Parameters
| Type | Name | Description |
|---|---|---|
| BufferDesc | desc | Graphics Buffer descriptor. |
Returns
| Type | Description |
|---|---|
| BufferHandle | A new transient GraphicsBufferHandle. |
CreateTransientBuffer(in BufferHandle)
Create a new Render Graph Graphics Buffer resource using the descriptor from another Graphics Buffer. This Graphics Buffer will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.
Declaration
public BufferHandle CreateTransientBuffer(in BufferHandle graphicsbuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| BufferHandle | graphicsbuffer | Graphics Buffer from which the descriptor should be used. |
Returns
| Type | Description |
|---|---|
| BufferHandle | A new transient GraphicsBufferHandle. |
CreateTransientTexture(in TextureDesc)
Create a new Render Graph Texture resource. This texture will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.
Declaration
public TextureHandle CreateTransientTexture(in TextureDesc desc)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureDesc | desc | Texture descriptor. |
Returns
| Type | Description |
|---|---|
| TextureHandle | A new transient TextureHandle. |
CreateTransientTexture(in TextureHandle)
Create a new Render Graph Texture resource using the descriptor from another texture. This texture will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.
Declaration
public TextureHandle CreateTransientTexture(in TextureHandle texture)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | texture | Texture from which the descriptor should be used. |
Returns
| Type | Description |
|---|---|
| TextureHandle | A new transient TextureHandle. |
DependsOn(in RendererListHandle)
Used to indicate that a pass depends on an external renderer list (that is not directly used in this pass).
Declaration
public RendererListHandle DependsOn(in RendererListHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| RendererListHandle | input | The renderer list handle this pass depends on. |
Returns
| Type | Description |
|---|---|
| RendererListHandle |
Dispose()
Dispose the RenderGraphBuilder instance.
Declaration
public void Dispose()
EnableAsyncCompute(bool)
Enable asynchronous compute for this pass.
Declaration
public void EnableAsyncCompute(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value | Set to true to enable asynchronous compute. |
EnableFoveatedRasterization(bool)
Enable foveated rendering for this pass.
Declaration
public void EnableFoveatedRasterization(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value | True to enable foveated rendering. |
ReadBuffer(in BufferHandle)
Specify a Graphics Buffer resource to read from during the pass.
Declaration
public BufferHandle ReadBuffer(in BufferHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| BufferHandle | input | The Graphics Buffer resource to read from during the pass. |
Returns
| Type | Description |
|---|---|
| BufferHandle | An updated resource handle to the input resource. |
ReadRayTracingAccelerationStructure(in RayTracingAccelerationStructureHandle)
Specify a RayTracingAccelerationStructure resource to use during the pass.
Declaration
public RayTracingAccelerationStructureHandle ReadRayTracingAccelerationStructure(in RayTracingAccelerationStructureHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| RayTracingAccelerationStructureHandle | input | The RayTracingAccelerationStructure resource to use during the pass. |
Returns
| Type | Description |
|---|---|
| RayTracingAccelerationStructureHandle | An updated resource handle to the input resource. |
ReadTexture(in TextureHandle)
Specify a Texture resource to read from during the pass.
Declaration
public TextureHandle ReadTexture(in TextureHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to read from during the pass. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |
ReadWriteTexture(in TextureHandle)
Specify a Texture resource to read and write to during the pass.
Declaration
public TextureHandle ReadWriteTexture(in TextureHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to read and write to during the pass. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |
SetRenderFunc<PassData>(BaseRenderFunc<PassData, RenderGraphContext>)
Specify the render function to use for this pass. A call to this is mandatory for the pass to be valid.
Declaration
public void SetRenderFunc<PassData>(BaseRenderFunc<PassData, RenderGraphContext> renderFunc) where PassData : class, new()
Parameters
| Type | Name | Description |
|---|---|---|
| BaseRenderFunc<PassData, RenderGraphContext> | renderFunc | Render function for the pass. |
Type Parameters
| Name | Description |
|---|---|
| PassData | The Type of the class that provides data to the Render Pass. |
UseColorBuffer(in TextureHandle, int)
Specify that the pass will use a Texture resource as a color render target. This has the same effect as WriteTexture and also automatically sets the Texture to use as a render target.
Declaration
public TextureHandle UseColorBuffer(in TextureHandle input, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to use as a color render target. |
| int | index | Index for multiple render target usage. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |
UseDepthBuffer(in TextureHandle, DepthAccess)
Specify that the pass will use a Texture resource as a depth buffer.
Declaration
public TextureHandle UseDepthBuffer(in TextureHandle input, DepthAccess flags)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to use as a depth buffer during the pass. |
| DepthAccess | flags | Specify the access level for the depth buffer. This allows you to say whether you will read from or write to the depth buffer, or do both. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |
UseRendererList(in RendererListHandle)
Specify a Renderer List resource to use during the pass.
Declaration
public RendererListHandle UseRendererList(in RendererListHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| RendererListHandle | input | The Renderer List resource to use during the pass. |
Returns
| Type | Description |
|---|---|
| RendererListHandle | An updated resource handle to the input resource. |
WriteBuffer(in BufferHandle)
Specify a Graphics Buffer resource to write to during the pass.
Declaration
public BufferHandle WriteBuffer(in BufferHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| BufferHandle | input | The Graphics Buffer resource to write to during the pass. |
Returns
| Type | Description |
|---|---|
| BufferHandle | An updated resource handle to the input resource. |
WriteRayTracingAccelerationStructure(in RayTracingAccelerationStructureHandle)
Specify a RayTracingAccelerationStructure resource to build during the pass.
Declaration
public RayTracingAccelerationStructureHandle WriteRayTracingAccelerationStructure(in RayTracingAccelerationStructureHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| RayTracingAccelerationStructureHandle | input | The RayTracingAccelerationStructure resource to build during the pass. |
Returns
| Type | Description |
|---|---|
| RayTracingAccelerationStructureHandle | An updated resource handle to the input resource. |
WriteTexture(in TextureHandle)
Specify a Texture resource to write to during the pass.
Declaration
public TextureHandle WriteTexture(in TextureHandle input)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to write to during the pass. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |