Search Issue Tracker

Active

Under Consideration for 2021.3.X, 2022.1.X

Fixed in 2022.2.0b7, 2023.1.0a6

Votes

1

Found in

2020.3.37f1

2021.3.3f1

2022.1.4f1

2022.2.0a16

2023.1.0a1

Issue ID

UUM-2725

Regression

No

[UIR] UIToolkit accumulating total extra vertices and draw calls when objects made Hidden/Visible

--

-

Reproduction steps:
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

Notes:
-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.

Comments (1)

  1. mikejm_

    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:

    https://forum.unity.com/threads/ui-toolkit-accumulating-extra-vertices-and-buffer-usage-to-render-when-objects-made-hidden-visible.1273028/

    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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.