Too Many Batch and SetPass Call counts while using ScrollViews

Hi all,

I’m trying to create a simple scene with a scroll view. The problem is, when I add the scroll view to the scene, it causes excessive batch and setpass call counts.

There are 4 buttons in the scrollview content and they all use same sprite. The sprite has packing tag and in Editor settings, Sprite Packer Mode is set to Always Enabled.

When there is only the scrollview in the scene, there are 6 SetPass calls and 9 Batches:

If I add a button above the scrollview, SetPass call becomes 8 and Batches becomes 11. If I disable Mask component of Viewport, SetPass Call count decreases to 1 but Batch count is still high:

Can you please explain:

  • Why this single scroll view causes 6 SetPass calls and 9 Batches when I’m using packed sprite?
  • Why adding a button above and below of the scroll view increases both SetPass call and Batch count?

If you get to the bottome, I guess this more or less says a bit about it (i sounds like a mea culpa from the Unity guys for a bad optimized part of the the UI system)