0
\$\begingroup\$

I'm preparing a Standalone Unity game for Windows and Mac.

There is a checkbox in Player Settings called "Use DXGI Flip Model Swapchain for D3D11", which seems disabled by default.

Needless to say, I don't understand this setting at all. The Unity documentation has this:

Flip model ensures the best performance. Disable this to fallback to Windows 7-style BltBlt model. This setting affects only D3D11 graphics API on Windows 8.1 or greater.

Note that even if the flip model is enabled, the BltBlt model will be used in exclusive fullscreen mode to reduce input latency.

It doesn't exactly tell me what this is (I literally don't know what most of that means) - but it almost seems like there is no reason not to have it enabled.

Can someone explain the pros and cons of this setting? Under what scenarios would I want to enable/disable it?

Since disabling it fallbacks to the Windows-7 style, it almost gives the impression that enabling this might make the game less compatible on Windows 7?

\$\endgroup\$
2
  • \$\begingroup\$ "I literally don't know what most of that means" — did you try researching the terms they're using to learn more? \$\endgroup\$
    – DMGregory
    Dec 5 '19 at 12:49
  • \$\begingroup\$ Well yeah and it didn't help that's why this question is here. For example, how can you tell whether a Unity project "requires HWND-level interop between graphics components" or not? Or how do you know if "the IDXGIFactory5::CheckFeatureSupport API is available, and reports support for DXGI_FEATURE_PRESENT_ALLOW_TEARING" in Unity? The article that is meant to explain this term, adds new terms, and so on so forth. Not helpful. It would make more sense to read specifically about Unity use cases, of which there is almost no documentation for them if you google that. Hence this question. \$\endgroup\$
    – Oxide
    Dec 5 '19 at 14:45
1
\$\begingroup\$

The only reason this would conceivably not be enabled-by-default is because the swapchain image format has specific requirements for flip model. You may not do MSAA resolve as part of the buffer swap, you must also adhere to the desktop's colorspace.

It is a performance enhancement for rendering in windowed mode that allows you to draw directly into the DWM's backbuffer instead of causing the DWM to copy your application's frontbuffer when it repaints all windows.

Windows 7 technically introduced the feature, but only for D3D9Ex and the modern DXGI-based APIs (D3D10/11/12, DWrite, D2D) saw flip model introduced in Windows 8. Always enable this, it makes a big difference for framepacing and Unity needs all the help it can get in that department.

\$\endgroup\$
0
\$\begingroup\$

This option enables the use of DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_DISCARD as compared to DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL. On Windows 7, it's always going to use the older BitBlt style. This only impacts which one it uses on Windows 8.1 or Windows 10. See Microsoft Docs

Generally, it's recommended you use DXGI_SWAP_EFFECT_FLIP_* when possible because it's better behavior all around. See this blog post for a detailed discussion.

For DirectX 12 on Windows 10, you have to use DXGI_SWAP_EFFECT_FLIP_*. This is also required to use DXGI_FEATURE_PRESENT_ALLOW_TEARING.

\$\endgroup\$
3
  • \$\begingroup\$ Ehrm.. really, you should amend all your docs to reflect the fact W7 with the platform update *do* support DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL. \$\endgroup\$
    – mirh
    May 5 '20 at 18:07
  • \$\begingroup\$ To my knowledge DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL is not supported prior to Windows 8. Which platform update are you seeing it working? \$\endgroup\$ May 5 '20 at 19:23
  • \$\begingroup\$ KB2670838 of course. Or at least, I didn't test it myself (like many others that just read the docs and buggered off), but some did get results. \$\endgroup\$
    – mirh
    May 6 '20 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.