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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

[OSX] Gfx.WaitForPresent 20ms even without render camera on iMac PRO.

Discussion in '2018.3 Beta' started by Foriero, Dec 10, 2018.

  1. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
    Hi,

    I'm not sure if it is bug BUT I have completely empty scene. Camera set to Solid Color, Orthographics AND camera script DISABLED. Which means there is not render camera at all in the scene BUT still Gfx.WaitForPresent is kicking in with 20ms spikes and I have iMac PRO. Is that normal or is it bug?

    Thank you, Marek.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,021
    When looking at the CPU profiler, Gfx.WaitForPresent simply means that you are waiting for GPU to complete. Enable the GPU profiler and look at what is actually using the resources. This could just be vsync stepping in.
     
    Peter77 likes this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,313
    Gfx.WaitForPresent and VR.WaitForGPU is really well explained in this Unite talk, starting at around 19:40:
     
    WildStyle69 and LeonhardP like this.
  4. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
    Yes I do understand that except our moving camera stutter whenever that 10-20ms kick is there. Im ok waiting for gpu as far as the camera movement is smooth. But it is not.
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,021
    If you think you encountered a bug, please submit a bug report with a minimal repro.
     
  6. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
    I will hunt it down. BTW we even disable GC. And nothing is moving in the scene. We don't have lights. We move just camera.
     
  7. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
  8. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,021
  9. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
    (Case 1108469)

    Seems like when I turn on antialiasing 2x even if the camera is not using it then we get the stutters. But not sure completely.
     
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575
    No, even without antialiasing it does not work. We don't allocate anything, everything static, even if I try to make that TMP not UI and just TMP text component in the world, the result is the same, here and there stuttering which is not acceptable for music app. Any idea what can be cause of the stuttering effect? M.
     
  11. oleyb

    oleyb

    Joined:
    Nov 8, 2012
    Posts:
    15
    I'm running into this issue on an iOS app. The app is running smoothly 50-60fps for a little while, then It starts to stutter every few seconds, and when connecting the phone to the profiler, I see that when each of the stutters occurs it is linked to a huge spike of Gfx.WaitForPresent.

    Here's a shot of my profiler:
    Screen Shot 2018-12-10 at 6.29.57 PM.png
     
  12. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    575