DispatchIndirect(string, GraphicsBuffer, uint, Camera)
Dispatches this RayTracingShader.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public void DispatchIndirect(string rayGenFunctionName, GraphicsBuffer argsBuffer, uint argsOffset = 0, Camera camera = null)
Parameters
The name of the ray generation shader.
Buffer containing dispatch dimensions.
The byte offset into the buffer where the dispatch dimensions start.
If you pass this parameter, Unity sets up built-in shader variables related to that camera.
Remarks
This method is similar to RayTracingShader.Dispatch but the GPU retrieves the dispatch dimensions from . The typical use case is generating arbitrary amount of data using a ComputeShader and then dispatching that data, without requiring a readback to the CPU to retrieve the data size.
argsBufferThe buffer with arguments, , must contain three integer numbers at given values representing the dispatch dimensions: width, height and depth.
argsBufferargsOffsetAdditional Resources: SystemInfo.supportsIndirectDispatchRays, GraphicsBuffer.CopyCount.