diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7881ba03b68..de2aa97bfca 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -259,6 +259,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue with resolution dependence for physically based depth of field. - Fixed the shader graph files that was still dirty after the first save (case 1342039). - Fixed cases in which object and camera motion vectors would cancel out, but didn't. +- Fixed HDRP material upgrade failing when there is a texture inside the builtin resources assigned in the material (case 1339865). ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Editor/Core/TextureCombiner/TextureCombiner.cs b/com.unity.render-pipelines.high-definition/Editor/Core/TextureCombiner/TextureCombiner.cs index 0377c33f18f..3afd04fc641 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Core/TextureCombiner/TextureCombiner.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Core/TextureCombiner/TextureCombiner.cs @@ -246,7 +246,7 @@ public Texture2D Combine(string savePath) //cleanup "raw" textures foreach (KeyValuePair prop in m_RawTextures) { - if (AssetDatabase.Contains(prop.Value)) + if (prop.Key != prop.Value && AssetDatabase.Contains(prop.Value)) AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(prop.Value)); } @@ -262,13 +262,12 @@ private Texture GetRawTexture(Texture original, bool sRGBFallback = false) if (m_RawTextures == null) m_RawTextures = new Dictionary(); if (!m_RawTextures.ContainsKey(original)) { - if (AssetDatabase.Contains(original)) - { - string path = AssetDatabase.GetAssetPath(original); - string rawPath = "Assets/raw_" + Path.GetFileName(path); - - AssetDatabase.CopyAsset(path, rawPath); + string path = AssetDatabase.GetAssetPath(original); + string rawPath = "Assets/raw_" + Path.GetFileName(path); + bool isBuiltinResource = path.Contains("unity_builtin"); + if (!isBuiltinResource && AssetDatabase.Contains(original) && AssetDatabase.CopyAsset(path, rawPath)) + { AssetDatabase.ImportAsset(rawPath); TextureImporter rawImporter = (TextureImporter)AssetImporter.GetAtPath(rawPath);