Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Disable Deep Profile causes Gfx.WaitForPresentOnGfxThread spikes

Discussion in 'Editor & General Support' started by jakesee, Sep 22, 2023.

  1. jakesee

    jakesee

    Joined:
    Jan 7, 2020
    Posts:
    81
    Hi, I am new to the profiling window in Unity and trying to understand how to read the information.

    I have a scene with a static land mesh with NavMeshSurface and 20 NavMeshAgents just wandering around. The NavMeshAgents have animated low poly meshes (less than 200 triangles each) imported from Blender. They are all from the same prefab, hence identical.

    When Deep Profile is turned OFF, I get these periodic square bumps. The timeline for this frame shows I have a long running Gfx.WaitForPresentOnGfxThread and Semaphore.WaitForSignal slowing down the player to 15 FPS, but I cannot figure out what it is waiting for. There is nothing in the Render Thread or anything else.

    upload_2023-9-22_12-33-44.png

    When Deep Profile is turned ON the spikes never happen. I only get these Editor Loop spikes, and other than that it is a stable 60 FPS.

    upload_2023-9-22_12-39-50.png

    It seems counter intuitive that deep profiling causes the game to run more smoothly. How do I dive deeper to find out what is causing the spikes? Also, if the Editor stuff are also getting profiled, that how do I get accurate picture of how the game is performing when standalone?

    Thanks.
     
  2. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    Last edited: Oct 11, 2023
  3. jakesee

    jakesee

    Joined:
    Jan 7, 2020
    Posts:
    81
    After turning off v-sync, the shape, timing and frequency of the spikes are different now. I build and run a development build autoconnect to profiler and find that in my specific profiling scenario, I am getting DXGI.WaitOnSwapChain spikes. However, I am pretty sure in the Editor, the spike is due to sometime else.