Hello,
I’m experiencing a really bad performance with HDRP, since forever.
Now I really need to get this working.
I managed to optimize my meshes and materials (all Substances, HDRP/Lit), the scene renders with just 22 passes.
Using the SRPBatcherProfiler, my scene renders in ~8 ms, but the main loop takes ~51ms / 19 FPS. (first attached image)
Stripping everything from the scene, what remaisn is just Physical Sky and Fog, render takes ~0.12ms and the main loop ~26ms / 38 FPS. (second attached image)
There’s nothing else happening on the CPU, just a rotating cube (I’ve seen a few reports that the CPU needs some distraction, so just in case…)
A few lucky frames takes 7.8ms. That should be the normal!
Some takes 100ms! (without the usual Editor spikes)
This is completely nuts and unnaceptable.
Profiling, it’s clear that Gfx.WaitForPresentOnGfxThread is what’s causing it to take so long. I’ve seen many many threads about this, this thread just wait for the GPU do so something but no one can tell WHAT it is waiting for. The current profiler, which is awesome, also shows all the render thread and jobs, and we can confirm that it takes around the same time by the SRP BatcherProfiler. So what the hell, the GPU job is done!
There’s nothing else running in parallel, no Chrome, no Video player, no external display, and VSync is disabled on Quality setting.
Sometimes the render jobs leaks to the next frame, that would be a good excuse for the Gfx.Wait thread, but it does not unlock when it ends.
When the Gfx.Wait thread ends, there’s some tiny jobon the Render thread, is that what it was waiting for? Zooming in, it’s AsyncUploadManager.AsyncResourceUpload. What is that? (third attached image)
Whatever the Gfx.Wait thread is waiting, we should be able to see on the profiler!
For my surprise, I was unable to activate the GPU profiler, because IT DOES NOT WORK ON METAL.
Seriously? Metal is the default on macOS for what, 3 years now?
A Release build performs slightly better. Since there’s no EditorLoop, I bet Gfx.Wait is still there.
Sending the build to a friend with a top Mac Pro, it never gets over 40FPS.
Inside a 1920x1080 window!
iMac (Retina 4K, 21.5-inch, 2017) 32GB RAM
macOS 10.15.6
Unity 2020.1.8f1
HDRP 8.2.0


