Struct CommandBufferHelpers
This struct contains some static helper functions that can be used when you want to convert between Commandbuffer and RasterCommandBuffer/ComputeCommandBuffer/UnsafeCommandBuffer
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public struct CommandBufferHelpers
Methods
GetComputeCommandBuffer(CommandBuffer)
Get a ComputeCommandBuffer given an standard CommandBuffer.
Declaration
public static ComputeCommandBuffer GetComputeCommandBuffer(CommandBuffer baseBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | baseBuffer | The CommandBuffer the RasterCommandBuffer should record it's commands to. |
Returns
| Type | Description |
|---|---|
| ComputeCommandBuffer | A ComputeCommandBuffer that will record its commands to the given buffer. |
GetNativeCommandBuffer(UnsafeCommandBuffer)
Get the actual unity engine CommandBuffer backing a UnsafeCommandBuffer. This strips the last remnants of render graph safety from the UnsafeCommandBuffer you are fully on your own now to ensure any and all render graph safety. Please carefully consider if you really need this.
Declaration
public static CommandBuffer GetNativeCommandBuffer(UnsafeCommandBuffer baseBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| UnsafeCommandBuffer | baseBuffer | The UnsafeCommandBuffer you want to get the engine commandbuffer from. |
Returns
| Type | Description |
|---|---|
| CommandBuffer | A CommandBuffer that will record its commands to the given buffer. |
GetRasterCommandBuffer(CommandBuffer)
Get a RasterCommandBuffer given an standard CommandBuffer.
Declaration
public static RasterCommandBuffer GetRasterCommandBuffer(CommandBuffer baseBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | baseBuffer | The CommandBuffer the RasterCommandBuffer should record it's commands to. |
Returns
| Type | Description |
|---|---|
| RasterCommandBuffer | A RasterCommandBuffer that will record its commands to the given buffer. |
GetUnsafeCommandBuffer(CommandBuffer)
Get an UnsafeCommandBuffer given an standard CommandBuffer.
Declaration
public static UnsafeCommandBuffer GetUnsafeCommandBuffer(CommandBuffer baseBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | baseBuffer | The CommandBuffer the UnsafeCommandBuffer should record its commands to. |
Returns
| Type | Description |
|---|---|
| UnsafeCommandBuffer | A UnsafeCommandBuffer that will record its commands to the given buffer. |
VFXManager_ProcessCameraCommand(Camera, UnsafeCommandBuffer, VFXCameraXRSettings, CullingResults)
Wrapper for VFXManager.ProcessCameraCommand that works with UnsafeCommandBuffer.
Declaration
public static void VFXManager_ProcessCameraCommand(Camera cam, UnsafeCommandBuffer cmd, VFXCameraXRSettings camXRSettings, CullingResults results)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | cam | The Camera to process the VFX commands for. |
| UnsafeCommandBuffer | cmd | The CommandBuffer to push commands to (can be null). |
| VFXCameraXRSettings | camXRSettings | The XR settings that the Visual Effect Graph uses to process the Camera commands. |
| CullingResults | results | The culling results to use. |