Search Unity

Disabling Multithreaded Rendering

Discussion in 'Windows' started by kraihd, Sep 25, 2019.

  1. kraihd

    kraihd

    Joined:
    Sep 10, 2015
    Posts:
    19
    At the Windows player settings, it seems that we have no option for multithreaded rendering.
    Which is this feature always enabled or disabled?
    If enabled, what is the way to toggle it off for save frame latency?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,540
    It's enabled by default. It also does not affect frame latency as Unity waits until render thread is done before starting the next frame. You can reduce latency by setting QualitySettings.maxQueuedFrames to 1 (default is 2).

    Note that there also is a known issue relating to severe latency when VSync is enabled on 2019.1 and 2019.2 on Windows Standalone player. We have a fix for that and it's currently being reviewed.

    And to answer your original question: you can disable multithreaded rendering by using "-force-gfx-direct" command line argument.
     
    kraihd likes this.
  3. kraihd

    kraihd

    Joined:
    Sep 10, 2015
    Posts:
    19
    Thanks for helpful information!
     
  4. kraihd

    kraihd

    Joined:
    Sep 10, 2015
    Posts:
    19
    I recorded screen with two same Unity processes which receive key input while unfocused, and made sure that "-force-gfx-direct" saves just one frame.

    More information:

    - maxQueuedFrame 2 vs 1 vs 0
    - The second gets ahead of the first.
    - Even the last often gets ahead of the second.

    - "-force-gfx-direct" or not
    - The former always gets just one frame ahead of the latter.
     
    Last edited: Sep 27, 2019