# CompilePass(Material, int, bool)

> Request the Editor to compile the Shader Variant needed for the specific pass of the given Material.

## Definition

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

```csharp
public static void CompilePass(Material material, int pass, bool forceSync = false)
```

### Parameters

**** (\[Material]\(/engine/6000.5/script-reference/unityengine/material)): Target Material.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the target Shader pass.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Forces the script execution to wait until the compilation has finished. Optional.

### Remarks

Additional Resources: [ShaderUtil.IsPassCompiled](/engine/6000.5/script-reference/unityeditor/shaderutil/ispasscompiled.md), [ShaderUtil.allowAsyncCompilation](/engine/6000.5/script-reference/unityeditor/shaderutil/allowasynccompilation.md), [ShaderUtil.anythingCompiling](/engine/6000.5/script-reference/unityeditor/shaderutil/anythingcompiling.md), [ShaderUtil.SetAsyncCompilation](/engine/6000.5/script-reference/unityeditor/shaderutil/setasynccompilation.md), [ShaderUtil.RestoreAsyncCompilation](/engine/6000.5/script-reference/unityeditor/shaderutil/restoreasynccompilation.md).
