# SetGlobalConstantBuffer

> Add a command to bind a global constant buffer.

## Definition

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

## SetGlobalConstantBuffer(ComputeBuffer, int, int, int)

Add a command to bind a global constant buffer.

```csharp
public void SetGlobalConstantBuffer(ComputeBuffer buffer, int nameID, int offset, int size)
```

### Parameters

**** (\[ComputeBuffer]\(/engine/6000.6/script-reference/unityengine/computebuffer)): The buffer to bind.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the constant buffer retrieved by [Shader.PropertyToID](/engine/6000.6/script-reference/unityengine/shader/propertytoid.md).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset from the start of the buffer in bytes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size in bytes of the area to bind.

### Remarks

See [Shader.SetGlobalConstantBuffer](/engine/6000.6/script-reference/unityengine/shader/setglobalconstantbuffer.md) for usage.

## SetGlobalConstantBuffer(ComputeBuffer, string, int, int)

Add a command to bind a global constant buffer.

```csharp
public void SetGlobalConstantBuffer(ComputeBuffer buffer, string name, int offset, int size)
```

### Parameters

**** (\[ComputeBuffer]\(/engine/6000.6/script-reference/unityengine/computebuffer)): The buffer to bind.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the constant buffer to override.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset from the start of the buffer in bytes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size in bytes of the area to bind.

### Remarks

See [Shader.SetGlobalConstantBuffer](/engine/6000.6/script-reference/unityengine/shader/setglobalconstantbuffer.md) for usage.

## SetGlobalConstantBuffer(GraphicsBuffer, int, int, int)

Add a command to bind a global constant buffer.

```csharp
public void SetGlobalConstantBuffer(GraphicsBuffer buffer, int nameID, int offset, int size)
```

### Parameters

**** (\[GraphicsBuffer]\(/engine/6000.6/script-reference/unityengine/graphicsbuffer)): The buffer to bind.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the constant buffer retrieved by [Shader.PropertyToID](/engine/6000.6/script-reference/unityengine/shader/propertytoid.md).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset from the start of the buffer in bytes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size in bytes of the area to bind.

### Remarks

See [Shader.SetGlobalConstantBuffer](/engine/6000.6/script-reference/unityengine/shader/setglobalconstantbuffer.md) for usage.

## SetGlobalConstantBuffer(GraphicsBuffer, string, int, int)

Add a command to bind a global constant buffer.

```csharp
public void SetGlobalConstantBuffer(GraphicsBuffer buffer, string name, int offset, int size)
```

### Parameters

**** (\[GraphicsBuffer]\(/engine/6000.6/script-reference/unityengine/graphicsbuffer)): The buffer to bind.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the constant buffer to override.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset from the start of the buffer in bytes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size in bytes of the area to bind.

### Remarks

See [Shader.SetGlobalConstantBuffer](/engine/6000.6/script-reference/unityengine/shader/setglobalconstantbuffer.md) for usage.
