Search Unity

Why the game screen is basically static but the freeze is serious

Discussion in 'General Graphics' started by sparkkhuang, Jul 22, 2021.

  1. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    My game is stable at 60 frames most of the time, but there will be a freeze for nearly one second every 4-5 seconds. The real machine debugging found the following situation.

    1111111.png 222222.png 333333.png

    I think my GPU is not stressed, it seems that the CPU is not processing any tasks, nor is there a large amount of memory recovery and allocation problems,but CPU is overburdened.So what caused the WaitForTargetFPS to appear?How can I avoid this from happening?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Nothing you're seeing in that view of the profiler is showing the GPU. That's all CPU. "Rendering" is the CPU rendering thread. Just further details on the specifics of the "Rendering" already shown in the CPU Usage chart.

    In the top left click on "Profiler Modules" and select "GPU". That'll give you actual GPU timing info.
     
  3. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    444444444.png
    Thank you, is this it?
     
  4. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    The sample frame correspondingly shows a static interface, and no other business logic is running. Can't understand why this is the case? Already turn off VSync from the Quality Settings in the editor.And it runs on Switch.
     
    Last edited: Jul 22, 2021
  5. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    unity 2019.4.26f1
     
  6. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You have a problem on your scripts
    Check that which script has a process every 4-5 seconds
     
  7. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    I have checked it and haven't found it yet. By the way, what is your reason for making this judgment?
     
  8. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    You must upload a full profiler cpu screen shot
    your screen shot was for player loop only
     
  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,451
    Nope. Based on that GPU profiler module screenshot, it's pretty clearly a GPU bottleneck. You might want to try RenderDoc or a platform/GPU manufacturer profiler to dive deeper into why that present took so long.
     
  10. sparkkhuang

    sparkkhuang

    Joined:
    Apr 9, 2021
    Posts:
    9
    It seems that there are really no tools for testing on the Switch platform. Is there any recommendation?
     
  11. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    If you're doing Switch dev you should have access to their dev portal and tools.
     
    MartinTilo likes this.