using System.Diagnostics.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; namespace UnityEditor.Rendering { /// /// Interface to be implemented for a type of shader that it's variants can be stripped /// /// The shader or /// The type of variant for the given type of shader can either be or public interface IVariantStripper : IStripper where TShader : UnityEngine.Object { /// /// Specifies if a variant can be stripped /// /// The /// /// The variant /// true if the variant is not used and can be stripped bool CanRemoveVariant([DisallowNull] TShader shader, [DisallowNull] TShaderVariant shaderVariant, ShaderCompilerData shaderCompilerData); } /// /// Interface to allow an to skip a shader variant for processing /// /// The shader or /// The type of variant for the given type of shader can either be or public interface IVariantStripperSkipper where TShader : UnityEngine.Object { /// /// Returns if the for the current is skipped for stripping /// /// The shader /// The variant /// true, if the shader can be skipped bool SkipShader([DisallowNull] TShader shader, [DisallowNull] TShaderVariant shaderVariant); } /// /// Interface to allow an to have a callback before and after the processing of variants /// /// The shader or /// The type of variant for the given type of shader can either be or public interface IVariantStripperScope where TShader : UnityEngine.Object { /// /// Callback that will be executed before parsing variants /// /// The shader void BeforeShaderStripping(TShader shader); /// /// Callback that will be executed after parsing variants /// /// The shader void AfterShaderStripping(TShader shader); } #region Shader Helpers /// /// Helper interface to create a targeting /// public interface IShaderVariantStripper : IVariantStripper { } /// /// Helper interface to create a targeting /// public interface IShaderVariantStripperSkipper : IVariantStripperSkipper { } /// /// Helper interface to create a targeting /// public interface IShaderVariantStripperScope : IVariantStripperScope { } #endregion #region Compute Shader Helpers /// /// Helper interface to create a targeting /// public interface IComputeShaderVariantStripper : IVariantStripper { } /// /// Helper interface to create a targeting /// public interface IComputeShaderVariantStripperSkipper : IVariantStripperSkipper { } /// /// Helper interface to create a targeting /// public interface IComputeShaderVariantStripperScope : IVariantStripperScope { } #endregion }