Search Unity

  1. First round of sessions for Unite Berlin announced, includes talks on Nested Prefabs, ECS, connected games & many more. Detailed info here.
    Dismiss Notice
  2. Famed game designer and creator of The Sims, SimCIty, and Spore is looking for a 3D artist to join their team. Join the challenge.
    Dismiss Notice
  3. Unity 2017.4 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. We've opened a new World Building sub-forum to faciltate all your world building discussions! Drop in and ask any ProBuilder, ProGrids, or PolyBrush questions.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

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

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

  1. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    32
    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:
    452
    Man that's a recurring problem
     
  3. xCyborg

    xCyborg

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

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    179
    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:
    704
    Ahhh. Thanks for that info.