# SetShaderChunkSizeInMBForPlatform(BuildTarget, int)

> Sets the default size for compressed shader variant chunks on the build target.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void SetShaderChunkSizeInMBForPlatform(BuildTarget buildTarget, int sizeInMegabytes)
```

### Parameters

**** (\[BuildTarget]\(/engine/6000.0/script-reference/unityeditor/buildtarget)): The build target to set the shader chunk size for.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The chunk size in megabytes.

### Remarks

Unity stores multiple [shader variants](/engine/6000.0/manual/materials-and-shaders/shaders/shader-troubleshooting/shader-reducing/shader-variants/shader-variants.md) in compressed chunks. You can use `SetDefaultShaderChunkSizeInMBForPlatform` to set the maximum size of each chunk.

This parameter overrides [PlayerSettings.SetDefaultShaderChunkSizeInMB](/engine/6000.0/script-reference/unityeditor/playersettings/setdefaultshaderchunksizeinmb.md) on the build target.

You can use this parameter with [PlayerSettings.SetShaderChunkCountForPlatform](/engine/6000.0/script-reference/unityeditor/playersettings/setshaderchunkcountforplatform.md) to limit the amount of memory Unity uses for shader variants.

Additional Resources: [PlayerSettings.GetShaderChunkSizeInMBForPlatform](/engine/6000.0/script-reference/unityeditor/playersettings/getshaderchunksizeinmbforplatform.md).
