Search Unity

Question Disabled vsync appearing in profiler after build

Discussion in 'Editor & General Support' started by airplaneboy, Oct 24, 2022.

  1. airplaneboy

    airplaneboy

    Joined:
    Oct 3, 2020
    Posts:
    9
    I'm having issues with performance after building a game. In play mode everything seems normal but after build the vsync starts spiking up. Fyi vsync is disabled both for bu Profiler when I'm in play mode.png Profiler when connected to the build.png Profiler during transition from build to play mode.png more info from profiler.png Profiler when I'm in play mode.png Profiler when connected to the build.png Profiler during transition from build to play mode.png more info from profiler.png ild and editor
     
  2. antonk-unity

    antonk-unity

    Unity Technologies

    Joined:
    Oct 4, 2016
    Posts:
    50
    Hey. Could you check that you aren't setting `Application.targetFrameRate`? "WaitForTargetFPS" is visible on one of screenshots and appears when `targetFrameRate` is set. It falls into the same category as v-sync, so if you have it set, it'll show up in v-sync category.

    Unity - Scripting API: Application.targetFrameRate (unity3d.com)
     
  3. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    I get this too on mac builds.

    v-sync is disabled after building using 2020 LTS and 2021 LTS

    Graphics card will spin up to max power.
     
  4. airplaneboy

    airplaneboy

    Joined:
    Oct 3, 2020
    Posts:
    9
    Hi, sorry for the late reply but I thought I was going to get a notification if someone replied. And no, I did not set Application.TartgetFrameRate. Although, I tried using it as fix for this issue, but it didn't work so I removed it.
     
  5. airplaneboy

    airplaneboy

    Joined:
    Oct 3, 2020
    Posts:
    9
    But what if that's what I want. I'm shipping to mobile and i'm suffering from low FPS.
     
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,128
    You can't disable vsync on mobile devices. It's forced on by the operating system.
     
    Last edited: Nov 3, 2022
  7. airplaneboy

    airplaneboy

    Joined:
    Oct 3, 2020
    Posts:
    9
    It's happening on both mobile and PC build. The screenshots are from the PC
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    In the PC screenshot it's just being miscategorized. DXGI.WaitOnSwapChain means it means it's waiting for the GPU to finish drawing. Check your GPU usage in the task manager :).
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,128
    I just finished trying to replicate the problem on my end with the what I was able to see in your screenshots and my performance is about what I would expect. What's your hardware configuration? Are you on recent drivers?

    upload_2022-11-4_15-15-59.png
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674