Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  6. Unity 2017.2 beta is now available for download.
    Dismiss Notice

GFX.WaitForPresent (yes, another one...)

Discussion in 'Android' started by droolz, Jan 27, 2016.

  1. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    29
    Hey All,

    So I've been pouring over the forums to try and understand what potentially 'Gfx.WaitForPresent' actually means / represents, and I'm still not entirely clear. See the screenshot below:
    profiler.png
    This is taken from a Samsung S6 ADB connection to profiler (ie build and run). Project has VSync set to off.

    As you can see, the gpu is doing very little (find it hard to believe that it's actually that fast), but the cpu has varying degrees of 'Gfx.waitforpresent' going on. It does however correlate with when there's a lot going on on screen : the more characters there are, the higher the GFx.waitforpresent and the lower the framerate. What I want to know is what's hidden inside this 'black box'? Is this just a limitation of a the profiler? Are there any explanations anywhere that don't just say 'it's vsysnc'?

    Many thanks for any help,

    Jules
     
  2. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    424
    Man that's a recurring problem
     
  3. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    424
    Ah ah
     
  4. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    174
    You should only see Gfx.WaitForPresent when you are using the threaded renderer.
    It means that the main thread is waiting for the render thread to finish the previous frame (in terms of API calls, *not* synchronizing with the GPU).
    So you are either CPU limited on the render thread (too many or too expensive or stalling API calls, not likely) or some API call (typically SwapBuffers or Clear) is blocked by the driver because the GPU is the bottleneck (more likely).
     
  5. Mafutta

    Mafutta

    Joined:
    Sep 30, 2014
    Posts:
    24
    Ok, so I did a standalone Linux built using Unity 5.6.0b10 and also see Gfx.WaitForPresent. Note: I don't have a GPU. See attached profiler. Any ideas as to what I should/can do about it?
     

    Attached Files:

  6. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    555
    Ahhh. Thanks for that info.