What is DXGI.WaitOnSwapChain ? (Profiling)

Hi, I encounter a waste of milliseconds because of GfxDeviceD3D12.WaitForLastPresent / DXGI. WaitOnSwapChain.

I can’t find out why this is happening,
Vsync is turned off and it is a standalone build profiling
my whole terrain and logics taken 1~2 ms but the HDRenderPipline takes 4~5 ms and DXGI.WaitOnSwapChain 5 ms
Screenshot 2024-07-11 125426.png

Unity 6000.9f1
changing the Optimize For in Burst AOT Settings to Performance didn’t help
QualitySettings.maxQueuedFrames is the default (value 2)
Checked my AMD card to make sure it’s not limiting FPS
My scene is quite empty Only empty terrain (4500 * 4500) and movement logic, I don’t think post-processing would be the cause of the issue here right?

Could Vync be turned on even if I disable it in Quality settings (I have only one Quality Asset)?
any tips would be appreciated!

Disabling all Post-Proccing and effects reduces the GfxDeviceD3D12.WaitForLastPresent to 2ms

Usually, this means that the CPU is waiting for the GPU. This is where the wait shows up. Take a GPU capture to find out what is taking that long to render.

I’d use PIX for that. Renderdoc can do some profiling as well, but it’s not very good at profiling.

You can also have a look at the built-in GPU profiler but I’d definitely recommend PIX.

2 Likes

Thank you! will check out