Search Issue Tracker
Unknown (hidden) 2020.3.X, 2022.1.X
Fixed in 2021.3.14f1, 2022.2.0b7, 2023.1.0a6
[UIR] UIToolkit accumulating total extra vertices and draw calls when objects made Hidden/Visible
1. Open the attached user's project "UIToolkit.zip"
2. Enter Play Mode
3. Enable the Stats window in Game View and check the amount of initially loaded vertices
4. Press the left mouse click to enable hidden objects and check the number of vertices in the Stats window
5. Repeat step 4 several times and observe the Stats window
Expected result: vertex count and buffer usage goes back to the initial state which were the same when entering Play Mode
Actual result: vertex count and buffer usage does not go back to the initial state (See attached Results.png)
Reproduces on: 2021.3.4f1, 2022.1.1f1, 2022.2.0a15
Could not test on 2019.4.39f1, 2020.3.34f1 due to various missing assembly definitions when downgrading
-If you toggle the elements to VisualElement.style.visibility = StyleKeyword.Null (make them visible again), and then back to Hidden again, the vertex count and buffer usage remains inflated and will not go back to the original state levels.
Jun 16, 2022 11:59
Please note that this problem also occurs with both toggling between:
1) VisualElement.style.display = StyleKeyword.Null and VisualElement.style.display = DisplayStyle.None.
2) VisualElement.style.visibility = StyleKeyword.Null and VisualElement.style.visibility = Visibility.Hidden
The severity of the problem with screencaps showing the dramatic accumulations of vertices, draw calls, and batches is demonstrated here:
I appreciate any help you can provide with offering a solution. Due to this issue, Unity is accumulating millions of vertices to display just very few objects on screen, which is making normal performance unfortunately impossible.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- GameObject doesn't execute animation the way it's supposed to until any GameObject in the Hierarchy is selected when in the Play Mode
- PropertyField does not properly render its field when changing it back from a valid Asset to "None"
- "ArgumentException: Input Button Enable Debug Button 1 is not set" is thrown when "Enable Debug Button 1" is deleted
- Duplicate invocations when Enabling InputActions during handling an input action
- "Assertion failed on expression" exceptions are thrown when using IJobParallelForTransformExtensions.RunReadOnly
Resolution Note (2022.1.X):
No longer supporting 2022.1.
Resolution Note (fix version 2021.3.14f1):
Fixed in 2021.3.14f1
Resolution Note (2020.3.X):
Not observable in 2020.3.39f1 because the Rendering profiler module never shows editor statistics.