Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Unity creates metal buffers used inside the SkinnedMeshRenderer every frame on iOS?

Discussion in 'iOS and tvOS' started by Alan-Liu, Jul 20, 2023.

  1. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    345
    When I profiled our game on iOS, I noticed BufferMetal::AllocNewVersionedBuffer was taking more time than expected. So I made a simple test to check the behaviour.

    In the test, I created 20 SkinnedMeshRenderers in the scene:
    upload_2023-7-20_19-22-33.png

    Here is the screenshot of Instrument Time Profiler:
    upload_2023-7-20_19-24-47.png

    As you can see, BufferMetal::AllocNewVersionedBuffer was taking 11.2% cpu time. I expected there is no buffer created in this situation, but apparently I'm wrong. It seems Unity was creaing buffers continuously, perhaps every frame?

    The profiling results in Unity 2020.3.48 and 2021.3.28 are the same.

    Is this behaviour expected or bug?
     

    Attached Files:

    Last edited: Jul 20, 2023
    TeorikDeli likes this.
  2. joao_maia_u3d

    joao_maia_u3d

    Unity Technologies

    Joined:
    Dec 15, 2021
    Posts:
    3
    Hi! I can confirm that this is happening. I created a bug report about this so that we can track this issue. Thank you for creating the post and for providing a repro project :).
     
    Alan-Liu likes this.
  3. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    345
    Thanks for the reply. I also submitted a bug report yesterday: IN-48874.
     
  4. joao_maia_u3d

    joao_maia_u3d

    Unity Technologies

    Joined:
    Dec 15, 2021
    Posts:
    3
    That's good to know. Thank you!