Search Issue Tracker
Fixed in 8.1.0
Votes
0
Found in [Package]
8.0.0
Issue ID
1211754
Regression
No
[URP] Some tests fail due to Destroy being called at the wrong time
In IL2CPP, effects that rely on TextureCurve.Finalize in Universal Render Pipeline throw errors due to Destroy being called at the wrong time.
Reproduction Steps:
1. Clone the SRP repo: https://github.com/Unity-Technologies/ScriptableRenderPipeline
2. Open the project in TestProjects/UniversalGraphicsTest
3. Open Build Settings and disable all scenes except for 081_GradingColorCurvesLDR and 083_GradingLiftGammaGainLDR (these are the minimum required, but all scenes between 076-093 can trigger this failure)
4. Open Player Settings and change Scripting Backend to IL2CPP
5. Go to Window > General > Test Runner
6. Press "Play Mode" and then "Run all in player"
7. Wait for the build to complete, run on target, and then fail with the following error:
UnityException: Destroy can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at UnityEngine.Rendering.TextureCurve.Finalize () [0x00000] in <00000000000000000000000000000000>:0
System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)
Reproducible in versions 2020.1.0a18, 2020.1.0a22.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Add comment