diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs index 73cbcbdb5c5..8a8f0088e9f 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderBuildPreprocessor.cs @@ -378,8 +378,9 @@ private static void GetEveryShaderFeatureAndUpdateURPAssets(List // Update the Prefiltering settings for this URP asset urpAsset.UpdateShaderKeywordPrefiltering(ref spd); - // Mark the asset dirty so it can be serialized once the build is finished + // Save the asset before build EditorUtility.SetDirty(urpAsset); + AssetDatabase.SaveAssetIfDirty(urpAsset); } } } @@ -436,8 +437,9 @@ ref ssaoRendererFeatures // Update the Prefiltering settings for this URP asset urpAsset.UpdateShaderKeywordPrefiltering(ref spd); - // Mark the asset dirty so it can be serialized once the build is finished + // Save the asset before build EditorUtility.SetDirty(urpAsset); + AssetDatabase.SaveAssetIfDirty(urpAsset); // Clean up ssaoRendererFeatures.Clear();