Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c27d45b

Browse files
authoredFeb 25, 2021
Re-apply fix for 1262826 that got lost in translation during the move to the Graphics repository (#3648)
1 parent 8d10375 commit c27d45b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed
 

‎com.unity.postprocessing/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
- Support for the PlayStation 5 platform has been added.
1111
- Support for the XboxSeries platform has been added.
1212

13+
### Fixed
14+
- Fix for issue thrown upon unloading a scene from an AssetBundle (case 1262826)
15+
1316
## [3.0.3] - 2021-02-19
1417

1518
- bump version to 3.0.3 to not conflict with unrelease 3.0.2

‎com.unity.postprocessing/PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,10 @@ void SetupContext(PostProcessRenderContext context)
856856
{
857857
// Juggling required when a scene with post processing is loaded from an asset bundle
858858
// See #1148230
859-
if (m_OldResources != m_Resources)
859+
// Additional !RuntimeUtilities.isValidResources() to fix #1262826
860+
// The static member s_Resources is unset by addressable. The code is ill formed as it
861+
// is not made to handle multiple scene.
862+
if (m_OldResources != m_Resources || !RuntimeUtilities.isValidResources())
860863
{
861864
RuntimeUtilities.UpdateResources(m_Resources);
862865
m_OldResources = m_Resources;

‎com.unity.postprocessing/PostProcessing/Runtime/Utils/RuntimeUtilities.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ public static PropertySheet copyFromTexArraySheet
381381
}
382382
}
383383

384+
internal static bool isValidResources()
385+
{
386+
return s_Resources != null;
387+
}
388+
384389
internal static void UpdateResources(PostProcessResources resources)
385390
{
386391
Destroy(s_CopyMaterial);

0 commit comments

Comments
 (0)
Please sign in to comment.