diff options
| author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-11-06 15:12:42 -0500 |
|---|---|---|
| committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-11-06 15:12:42 -0500 |
| commit | eb84bb298d2b95aec7b2ae12cbf25ac64f25379a (patch) | |
| tree | efd616a157df06ab661c6d56651853431ac6b08b /VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping | |
| download | unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.gz unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.bz2 unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.zip | |
move to self host
Diffstat (limited to 'VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping')
6 files changed, 114 insertions, 0 deletions
diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs new file mode 100644 index 00000000..3e4a1f1a --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEditor.Rendering; +using UnityEngine; +using VRC.SDKBase.Editor.BuildPipeline; + +public class StripAndroidAvatars : IPreprocessShaders, IVRCSDKBuildRequestedCallback, IPostprocessBuildWithReport +{ + private static VRCSDKRequestedBuildType? _buildType = null; + + public int callbackOrder => 0; + + public bool OnBuildRequested(VRCSDKRequestedBuildType requestedBuildType) + { + _buildType = requestedBuildType; + return true; + } + + public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> data) + { + if(_buildType != VRCSDKRequestedBuildType.Avatar) + { + return; + } + + if(EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android) + { + return; + } + + data.Clear(); + } + + public void OnPostprocessBuild(BuildReport report) + { + _buildType = null; + } +} diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs.meta b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs.meta new file mode 100644 index 00000000..cad09752 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripAndroidAvatars.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f05fc74d61cc0c448411f8b55c918ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs new file mode 100644 index 00000000..0b0cac3a --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs @@ -0,0 +1,29 @@ +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(); + } + } +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs.meta b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs.meta new file mode 100644 index 00000000..f40ffb5c --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/StripPostProcessing.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06d01ef00e2795244aa8b5cbe879b16e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef new file mode 100644 index 00000000..6a0bf26a --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef @@ -0,0 +1,16 @@ +{ + "name": "VRC.SDKBase.Editor.ShaderStripping", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [ + "VRCSDKBase-Editor.dll" + ], + "autoReferenced": true, + "defineConstraints": [] +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef.meta b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef.meta new file mode 100644 index 00000000..b49d7def --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/VRCSDK/Dependencies/VRChat/Editor/ShaderStripping/VRC.SDKBase.Editor.ShaderStripping.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 09158b5a87ea9554daafaef906ae927e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: |