avatar/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs
2022-09-27 20:47:45 -07:00

29 lines
767 B
C#

using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
namespace VRC.SDKBase.Editor.ShaderStripping
{
public class StripPostProcessing : IPreprocessShaders
{
public int callbackOrder => 0;
public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> data)
{
if(EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android)
{
return;
}
string shaderName = shader.name;
if(string.IsNullOrEmpty(shaderName) || !shaderName.Contains("PostProcessing"))
{
return;
}
data.Clear();
}
}
}