I noticed that IDXGISwapChain::Present
takes about ~3.5ms (while having stripped all my own command recording and execution from the render loop).
![](https://uploads.gamedev.net/forums/monthly_2021_01/7d730a86b2d34d82b8da679a1b432494.Screenshot-(1).jpg)
According to PIX, this seems to be related to internal command recording and execution in DXGI itself.
![](https://uploads.gamedev.net/forums/monthly_2021_01/141940e71e0247f191585ed7bb4ce1e9.Screenshot-(2).jpg)
Any ideas what might cause this? As a reference, the vanilla ImGui D3D12/x64 example (without VSync) with Debug configuration runs ≤ 1ms on the same machine.
- DXGI and D3D12 debug modes are off.
- D3D12 validation layer is off.
- Swap chain descriptor (I already tried changing format, flags, etc.):
DXGI_SWAP_CHAIN_DESC1
{
...
.Format = DXGI_FORMAT_R10G10B10A2_UNORM,
.Stereo = FALSE,
.SampleDesc = { .Count = 1u, .Quality = 0u },
.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT,
.BufferCount = 3u,
.Scaling = DXGI_SCALING_STRETCH,
.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD,
.AlphaMode = DXGI_ALPHA_MODE_IGNORE,
.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH | DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING
}