VisualElement with background repeat generates too many mesh vertices

Hi,

We’ve noticed that visual element generates too many vertices and potentially get the limit error if it has a repeating background image. Number of vertices will increase with visual element size.

  1. Just background image, no background-size, background-repeat styles.

  2. background-size, background-repeat styles set.

Is it expected?

USS & Code

.mt-test-bg {
   background-color: black;
   background-size: auto;
   background-repeat: repeat;
   background-image: resource("UI/header-logo-mobile-white");
}
            var ve = new VisualElement();
            ve.style.backgroundColor = Color.blue;
            ve.style.width = 1000;
            ve.style.height = 1000;
            ve.AddToClassList("mt-test-bg");
            uiDocument.rootVisualElement.Add(ve);

We are aware of this issue. The current approach also has some background bleeding issues on the edges of the repetitions. We’ll look into it.