I'm using a Macbook with the Metal backend. I'm using the HDRP in Unity 6.2.
Due to an error in my code, my script is creating a small GraphicsBuffer every single frame.
I noticed that this causes the editor to freeze if I hide the editor window for a minute or so. The freeze doesn't happen if the window is visible (it doesn't have to be focused).
The hang happens on this line:
var array = dataBuffer.LockBufferForWrite<uint>(0, 4);
I'm guessing that, because the editor is completely hidden, a huge queue of uploads is piling up. I tried switching from LateUpdate to subscribing to RenderPipelineManager.beginCameraRendering, but this didn't help (and I can see my code is still running once per frame, even with the editor hidden).
Obviously, I'm going to fix the bug, but I'm curious if:
- This is why the freeze is happening
- I can do anything to detect and prevent this