Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Texture size and Profiler.GetRuntimeMemorySize (Android)

Discussion in 'Editor & General Support' started by gwiazdorrr, Feb 22, 2016.

  1. gwiazdorrr

    gwiazdorrr

    Joined:
    Sep 29, 2014
    Posts:
    102
    Hi guys, there's been a change in Unity somewhere between 5.2.2f1 and 5.3.2p2 with how texture sizes are reported by the profiler. Maybe someone can shed some light on it.

    Let's take 4096x4096 RGB texture, no mipmaps - with 4bpp compression provided by ETC1 its expected size would be ~8 MB.

    However, in 5.2.2f1 (and all prior versions, as far as I remember) both Profiler window and Profiler.GetRuntimeMemorySize reported the size to be ~16 MB. Same pattern followed with 2k, 1k, 512 etc. textures -- their runtime size was always the double of what you'd expect.

    That's no more the case with Unity 5.3.2p2. The runtime size is now 8 MB for 4k textures, 2 MB for 2k textures etc., matching expectations.

    Can someone please explain the nature of this change? I've never understood why texture runtime sizes were being doubled in the past, since Android devices don't have separate VRAM, so theoretically there's no need for duplication. I've just got used to it and now I'm puzzled.