Search Issue Tracker
Fixed in 2017.3.0f3
Fixed in 5.6.X, 2018.1.X
Won't Fix in 2017.1.X, 2017.2.X
Votes
0
Found in
5.6.1f1
Issue ID
926629
Regression
No
All canvases in the Scene is being Rebuilt
There are large CPU spikes related to UI. While trying to track down the symptoms, User has found out that Canvas.BuildBatch encompasses *every* active canvas in the scene and subsequently slows SendWillRenderCanvases.
The problem is that all canvases are being rebuilt rather than only ones in the relevant hierarchy.
The event which causes this appears to be the addition of a GameObject to a ScrollRect's viewport. It's expected in that case that only canvas ancestors of that node are rebuilt, not all canvas in the scene. The codebase does *not* call Canvas.ForceUpdateCanvases().
Steps to reproduce:
1. Open User's attached project ("Test-ScrollandAnotherCanvas.zip")
2. Open Profiler
3. Enter Play mode
4. Wait for objects to stop appearing in scroll list
5. Pause Play mode
6. Look for Canvas.BuildBatch in profiler
7. Check Show Related Object
Result: Check that Overlay is being re-build
Reproduced with: 2017.2.0b3, 2017.1.0f3, 5.6.2p3.
Note: Sometimes it is easy to reproduce when the list is already filled, but sometimes not. So to reproduce it easily, move the scroll list when the items are being created.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Scene view is not outputting HDR when the "Use HDR Display Output" option is enabled, DX12 is selected as the Graphics API, and URP/HDRP is in use
- Sprite Atlas results in suboptimal packing even when "Allow Rotation" is enabled
- References placed in a UnityEvent change to the same reference when multi-selecting their GameObjects
- "ShadowCaster2D" Component doesn't work when the "Casting Source" is set to "Polygon Collider 2D"
- Warning “CommandBuffer: built-in render texture type 3 not found while executing (SetRenderTarget depth buffer)“ is present when opening a specific URP project
Add comment