Performance RegularPolygon vs Rectangle (Android)
I did a qucik test with a RegularPolygon vs Rectangle. The Polygon and Rectangle quads fill the same space (therefore the visible regular polygon is smaller) to make a fair comparison.
RegularPolygon left, Rectangle right.
The performance difference is quite big for my android low end test device (Xiaomi Mi A1):
RegularPolygon on screen:
Rectangle on screen:
Is this expected? I'm using a lot of regular polygons due to their support for gradients.
As for settings:
Tested with Vulkan and OpenGLES3
Linear Color Space
No PP, No AntiAliasing
Shapes: Half4 output, Medium Local AA, medium Quad Interpolation Quality
this is expected, regular polygons use more complex math in the fragment shader to support an arbitrary number of sides, and it gets more expensive due to the rounded corners too, while the rectangle can take lots shortcuts since it knows it will ever only have 4 sides