Skip to content

Commit 4a5c68b

Browse files
FrancescoC-unitysebastienlagarde
authored andcommitted
Fix issue causing not all baked reflection probes to be deleted #441
1 parent e457eba commit 4a5c68b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7979
- Fixed cookie texture not updated when changing an import settings (srgb for example).
8080
- Fix error when removing DecalProjector from component contextual menu (case 1243960)
8181
- Fixed issue with post process when running in RGBA16 and an object with additive blending is in the scene.
82+
- Fixed issue that caused not all baked reflection to be deleted upon clicking "Clear Baked Data" in the lighting menu (case 1136080)
8283

8384
### Changed
8485
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.

com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,13 @@ void DeleteCubemapAssets(bool deleteUnusedOnly)
471471
// Or we delete all assets
472472
|| !deleteUnusedOnly)
473473
{
474+
// If the buffer is full we empty it and then push again the element we were trying to
475+
// push but failed.
474476
if (!buffer.TryPush(files[fileI]))
477+
{
475478
DeleteAllAssetsIn(ref buffer);
479+
buffer.TryPush(files[fileI]);
480+
}
476481
}
477482
}
478483
}
@@ -489,6 +494,9 @@ static void DeleteAllAssetsIn(ref CoreUnsafeUtils.FixedBufferStringQueue queue)
489494
while (queue.TryPop(out string path))
490495
AssetDatabase.DeleteAsset(path);
491496
AssetDatabase.StopAssetEditing();
497+
498+
// Clear the queue so that can be filled again.
499+
queue.Clear();
492500
}
493501

494502
internal static void Checkout(string targetFile)

0 commit comments

Comments
 (0)