Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

EndGraphicsJobs waits on signal for longer than frame duration?

Discussion in 'Graphics Experimental Previews' started by ShadowLairGames, Jan 15, 2020.

  1. ShadowLairGames

    ShadowLairGames

    Joined:
    Jan 17, 2019
    Posts:
    45
    Hello,

    I'm profiling my game trying to reach 60fps, and I ran into some weird behavior with what seems to be the Graphics Jobs.

    In the attached profiler snapshot you can see EndGraphicsJobs taking a considerable frame duration from what would otherwise be a 100+ fps frame.
    This is hanging on WaitForSignal, which is presumably waiting for vsync, which is reasonable.
    The problem is, as can be seen in the snapshot, the frame time ends up crossing the 60fps line, sometimes by a considerable amount too.
    In practice, this leaves me at a constant 52fps and doesn't reach 60.

    upload_2020-1-15_21-19-18.png

    What's even weirder is that this doesn't always happen and just seems to randomly have periods where this wait occurs and some where it doesn't. And when it doesn't, there's no wait sample that pushes up to the 16ms threshold despite vsync being set to 1 in the project settings.
    Regardless of whether it is active or not, I'm still only seeing 52fps in practice in the game, which I can't quite explain.
    The attached sample shows this. The game is in an idle state throughout the entire snapshot above, but at some point the waiting samples just stop appearing, despite nothing happening in the game.

    This is running on a built Switch player in 2019.3.0f3 with Multhithreaded Rendering and Graphics Jobs enabled.

    It feels like I have a bad setting set somewhere, but I can't really tell what it is and would very much appreciate the help in literally unlocking my game to 60fps :)
     
  2. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    107
    Maybe the GPU is taking longer than 16ms, so everything has to wait for that? The GPU profiler view or the timeline view in the CPU profiler might be more revealing.