# DispatchIndirect(string, GraphicsBuffer, uint, Camera)

> Dispatches this RayTracingShader.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.5/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void DispatchIndirect(string rayGenFunctionName, GraphicsBuffer argsBuffer, uint argsOffset = 0, Camera camera = null)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the ray generation shader.**** (\[GraphicsBuffer]\(/engine/6000.5/script-reference/unityengine/graphicsbuffer)): Buffer containing dispatch dimensions.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): The byte offset into the buffer where the dispatch dimensions start.**** (\[Camera]\(/engine/6000.5/script-reference/unityengine/camera)): If you pass this parameter, Unity sets up built-in shader variables related to that camera.

### Remarks

This method is similar to [RayTracingShader.Dispatch](/engine/6000.5/script-reference/unityengine/rendering/raytracingshader/dispatch.md) but the GPU retrieves the dispatch dimensions from `argsBuffer`. The typical use case is generating arbitrary amount of data using a [ComputeShader](/engine/6000.5/script-reference/unityengine/computeshader.md) and then dispatching that data, without requiring a readback to the CPU to retrieve the data size.

The buffer with arguments, `argsBuffer`, must contain three integer numbers at given `argsOffset` values representing the dispatch dimensions: width, height and depth.

Additional Resources: [SystemInfo.supportsIndirectDispatchRays](/engine/6000.5/script-reference/unityengine/systeminfo/supportsindirectdispatchrays.md), [GraphicsBuffer.CopyCount](/engine/6000.5/script-reference/unityengine/graphicsbuffer/copycount.md).
