Search Unity

DrawMeshInstanced causes huge lags if two windows are running (bug?)

Discussion in 'General Graphics' started by Elfinnik159, Mar 19, 2020.

  1. Elfinnik159

    Elfinnik159

    Joined:
    Feb 24, 2013
    Posts:
    145
    I use DrawMeshInstanced to render my characters in DOTS. What I'm doing now is just calling DrawMeshInstanced in Update, every frame.
    The problem appears if more than one build is running. In this case, all builds that are out of focus begin to lag very much. I looked in the profiler: this is WaitFor TargetFPS. It reaches a huge size. Moreover, it doesn’t matter if DrawMeshInstanced is called in all builds - lags appear even when it is called in only one build that is in focus.
    upload_2020-3-19_19-12-13.png upload_2020-3-19_19-12-25.png
    Is this a bug (then I can create a ticket) or is there a setting that removes this problem?
    Even if VSync is turned off, the problem persists.
    Code (CSharp):
    1.                     Graphics.DrawMeshInstanced(mesh, 0, material, rMatrices);
    2.  
    Unity 2019.3.0f6 WIndows 10

    Thanks.