Immediate mode with ImmediateModeShapeDrawer & high memory allocation?

Avatar

I'm not entirely sure if this is a bug in how I use Shapes or a bug in Shapes itself, or if I'm just dumb and this is expected, but I'm drawing a few (~20) healthbars, each with its own `ImmediateModeShapeDrawer`, and getting around a 200ms GC pause around 2x per second. Looking at the profiler with call stack collection enabled at `GC.Alloc` points to shapes, and when I comment out my immediate mode drawing code all the GC pauses disappear.


Here's a few examples of the call stacks (not sure how to best report it, screenshots since Unity can't seem to copy from there)

Image 826

Image 827

Image 828

The code itself is basically the `IMPanelSample` with some modifications, full code here https://gist.github.com/darthdeus/00374a19cda7c418400b94e414e213ff but it only draws rectangles and no text.

Reporting a bug? please specify Unity version:
2022.3.22f1 (HDRP 14)
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
HDRP