Search Unity

WaitForPresentOnGfxThread takes up most cpu usage

Discussion in 'Android' started by Skunkynator, Jan 25, 2020.

  1. Skunkynator

    Skunkynator

    Joined:
    Jan 22, 2020
    Posts:
    6
    I've been experimenting with shaders on android the last couple of days, and i noticed that the project slows down for seemingly no reason

    on the profiler can be seen that GFX.WaitForPresentOnGfxThread takes up most of the time in the frames, but after looking at the GPU Ussage and Render Thread, i cant find a reason why it would go down to 15FPS except GPUProfiler.EndQueries
    Profiler:
    upload_2020-1-25_14-20-21.png

    it also seem that GPUProfiler.EndQueries is 2 frames behind

    Does anyone know a reason for this and/or a reason why WaitForPresentOnGfxThread and GPUProfiler.EndQueries takes that long
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    This means it's waiting for VSync.
    GPUProfiler.EndQueries takes that long because it needs the results from the GPU when the GPU finishes the rendering.

    Most likely your shaders are just too heavy :)
     
  3. Skunkynator

    Skunkynator

    Joined:
    Jan 22, 2020
    Posts:
    6
    is there a way to see how much time each shader individually takes up?
    im trying to figure out how to improve the perfomance of the heavier shaders
     
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    Probably, using the tools provided by your device's GPU vendor.