Search Unity

Feature Request API: How to know if native texture memory is located on the GPU?

Discussion in 'Profiler Previews' started by Peter77, Jan 10, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,590
    The short answer is that you sadly can't.

    There is no unified way to query the hardware to tell you whether an Asset (Texture/Mesh...) is on the VRAM or RAM. Some Platforms/Vendors/Devices might come with API for this but even the presence for these APIs is not a given. So right now, it is just not implemented at all for Unity. Also, the current MemoryProfiler API doesn't capture if an Asset is Read/Write enabled.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,086
    OK cool, thanks for the info!
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    1,590
    You're welcome :)
    And just to say this, we don't like that we can't tell you whether it is on the vram or not either. we'd like to be able to add this at some point for at least some platforms but... With it being such a scattershot right now, we can't promise anything.
     
    Peter77 likes this.
unityunity