Search Unity

Profiler is showing VSync even when it is disabled in the settings

Discussion in 'General Graphics' started by tanmaykulkarni, Apr 28, 2021.

  1. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Heyy, I saw the profiler to analyze the scene and I found that the VSync activities are consuming a lot of resources, then I checked my quality settings and saw it is Disabled. How do I fix this?

    Here's a image of my settings: Screenshot (229).png

    Profiler:
    Screenshot (228).png
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,448
    Hi,
    The game view has its own VSync toggle in the resolution/aspect ratio menu.
     
  3. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    That's already turned off
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,448
    Do you have any code in your project that sets QualitySettings-vSyncCount to something other than 0?
    Also, which Unity Version is this happening with, and is this, as I've assumed, happening while profiling Playmode or (also) when profiling on device and if so, which platform? Also, what target platform did you set in your Build Dialog?
     
  5. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Hii, no I didnt had any script changing VSync. It was maybe a bug. The profiler was showing VSync since 2 days, now, on third day it automatically erased from profiler. Should I report a bug?
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,448
    if it's no longer there, I guess there is little use in a bug report. Maybe something got stuck in the pipes somewhere? Might be worth a bug report if it comes back.
     
  7. BagoDev

    BagoDev

    Joined:
    Jan 2, 2017
    Posts:
    21
    Think I ran into this today on 2020.3.11f1.

    Was working on my server project that does no rendering, and when in Editor was noticing v-sync in profile. It was pushing to 60 FPS steady which led me to think it was the Application.targetFrameRate = 60 setting I had configured in code on Awake() of the main application. I had vSyncCount set to 0 in code, all of my profiles have 0 v-sync counts, and the game view had v-sync off, but it was still showing. I assumed based off this that targetFrameRate is set to override the sync count and gets labeled under v-sync in profiler (not sure if that is intended or if its still technically v-sync).

    It is important to note that if you set targetFrameRate at all, simply commenting the line will not remove this v-sync from showing in the profile as it looks like targetFrameRate is saved between compiles. You either have to explicitly set targetFrameRate to 0 or remove the targetFrameRate, recompile, and completely restart the editor to see the change in v-sync in the profiler. This could lead to some confusion if anyone is trying to track down whats causing the v-sync to show in the profiler beyond obvious settings.

    @tanmaykulkarni were you using Application.targetFrameRate anywhere in code?
     
  8. tanmaykulkarni

    tanmaykulkarni

    Joined:
    Nov 5, 2019
    Posts:
    104
    Heyy, that issue is fixed now. It was a simple bug. I just restarted my system several time and the vsync section had disappeared.
    Thanks for replying!