Search Unity

Question VSync is showing up in the profiler when it is disabled completely!

Discussion in 'General Graphics' started by tanmaykulkarni, Jan 22, 2022.

  1. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Hello dudes, I am unable to figure out why is VSync showing up in the profiler when I have disabled it completely. I am profiling my project on an android device - OnePlus Nord.

    1. I have turned off VSync in every quality setting of the project.
    2. My scripts don't enable VSync in runtime nor do they call Application.targetFrameRate.

    The TimeUpdate.WaitforlastpresentationandUpdateTime is just eating up my FPS.

    Here's a screenshot of the profiler:
    Screenshot (55).png

    Do android devices force VSync or I am doing any mistakes?
    Please help!
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,451
  3. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    It is not. It’s a symptom of a problem someplace else. It either means you’re taking too long on the CPU to get the 16.6ms frame time to hit 60fps, or the GPU is doing to much to make the frame time, or both. Either way it means you have to wait for the next Vsync to continue.

    In this case it might be both. But you’ll want to start profiling the GPU.

    And the reason mobile does this is for battery life. That “waitfor” means the CPU & GPU are sitting idle during that time using less power.
     
    tanmaykulkarni and MartinTilo like this.
  5. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Android devices don't support GPU profiling mostly
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    You need the profiler specific to the SOC/GPU.

    Arm Streamline for Mali
    Snapdragon Profiler for Adreno
    PowerVR Tools for PowerVR

    Or the latest beta versions of Android GPU Inspector claims to be able to profile any of those Android GPUs.
     
  7. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,451
    Well, Vulkan isn't supported and neither ar Graphics Jobs but GLES is technically supported but currently broken due to this bug. We are getting close to having a fix for that though, also see this thread.

    @bgolus beat me to it but yeah: In the meantime, the manufacturers of all mobile GPUs each have their own GPU Profilers that you can use, in this case the Snapdragon Profiler.
     
  8. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,451
    Beyond that bug fix, we'll circle back to implementing GPU profiling in the Profiler window on all platforms after our current effort to getting the Memory Profiler package to 1.0.
    Right now you can at least get GPU timings via FrameTimingManager and ProfilerRecorders in the newer versions of the Editor