# ClearCachedData(Shader)

> Clears all internally-cached data that was generated for the given shader, such as errors and compilation info.

## Definition

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

```csharp
public static void ClearCachedData(Shader s)
```

### Parameters

**** (\[Shader]\(/engine/6000.0/script-reference/unityengine/shader)):&#x20;

### Remarks

This happens automatically on import for shader assets but should be called for programmatically-generated shaders to clear old data before calling [ShaderUtil.UpdateShaderAsset](/engine/6000.0/script-reference/unityeditor/shaderutil/updateshaderasset.md).
