Hello, I’ve started digging into our game’s memory profile and and seeing a mystery I’m hoping to get some insight into. Our game uses the 2D lighting + shadow system and the Max Shadow Render Textures is set to 1.
Looking at the code in ShadowRendering.cs:48, I would expect this to correctly allocate a single shadow texture named “ShadowTex_0”. However, snapshotting our player with the Memory Profiler reveals that many such textures are actually being allocated, all with the same name.
It happens to be 16 in this screenshot, but it keeps increasing as the game executes, and they really chew through our memory budget. Putting a Log statement in ShadowRendering.cs as the texture(s) get allocated only prints once, which I would expect.
Can someone at Unity give me some insight into where these other textures are coming from? Thanks -