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

HUGE performance difference between OpenGLCore and DirectX

Discussion in '2D Experimental Preview' started by AlexVillalba, Jun 3, 2021.

  1. AlexVillalba

    AlexVillalba

    Joined:
    Feb 7, 2017
    Posts:
    346
    I'm using v2020.3.4 with URP 10.4.0 2D Renderer, and vsync off.
    If I choose OpenGLCore in the Project Settings, I get 20 FPS, for example. If I choose DirectX, I get 40 FPS, the double.
    I've check the profiler and the main difference is that when using OpenGL, there is an entry in the CPU Usage called "Gfx.WaitForPresentOnGfxThread". I remark: vsync is off. This entry appears every N frames, consuming 21 ms.

    Here you can see the profile when using DirectX:
    CaptureDirectX.PNG
    And here when using OpenGLCore, at the frame where the suspicious entry appears:
    CaptureOpenGLCore.PNG

    Is this an expected behaviour or a known issue? Why does it happen?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,336
    Gfx.WaitForPresentOnGfxThread means that the CPU is idling waiting for the GPU to finish rendering the frame. You can turn on the GPU profiler here:

    upload_2021-6-22_14-59-28.png

    That gives you a GPU profiler, so you might be able to check what's actually taking up the extra time on OpenGL.
     
  3. AlexVillalba

    AlexVillalba

    Joined:
    Feb 7, 2017
    Posts:
    346
    Thanks for the advice, it was not so useful though:

    OpenGLCore
    OpenGlCore.PNG

    DirectX
    DirectX.PNG

    (GPU Usage, with Deep Profiling too)