Search code examples
c++graphicsdirect3d12

Is fullscreen really better than windowed mode in a Direct3D 12 application?


I'm trying to learn Direct3D 12 to do some simple 3D graphics for fun.

I've heard that pure fullscreen is the way to go for maximum fps, but now that I'm testing it, fullscreen seems way, way worse than windowed mode.

For example, a static color on a WS_BORDER window (with fullscreen size), and Windowed set to TRUE in the DXGI_SWAP_CHAIN_FULLSCREEN_DESC, can be rendered (with triple-buffering) at about 5000 fps on my computer.

On the other hand, a static color on a WS_POPUP window, Windowed set to FALSE in the DXGI_SWAP_CHAIN_FULLSCREEN_DESC and also IDXGISwapChain3::SetFullscreenState(TRUE, nullptr) called, only renders (with triple-buffering) at about 3000 fps.

Should this be the case or am I missing something?


Solution

  • The story of "fullscreen" for Direct3D is a complex one, and from the other comments/answers in this thread continues be a confused one.

    For DirectX 12 on Windows 10, there is no FullScreen Exclusive mode (FSE). When you use SetFullscreenState with either of the modern DXGI_SWAP_EFFECT_FLIP_DISCARD or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL effect modes then use are really using emulated Fullscreen Exclusive mode (eFSE). DirectX 12 does not support using the the older 'blt-style' effects DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL.

    If you run with a borderless window that is maximized to cover the entire screen in "windowed mode", it's the same performance as using "eFSE".

    There are some 3rd party video card vendor APIs and scenarios that require you use "fullcreen mode" rather than "windowed mode", so in those cases there's a difference.

    The other issue is if you are trying to change the display mode vs. using the native resolution. The performance impacts here are the "pixel-fill' rate for the render target size. There are techniques for scaling performance by rendering to an 'offscreen' render target size and then scaling that up to the native resolution of a backbuffer vs. changing the display mode to try to reduce the size of the backbuffer.

    See The Care and Feeding of Modern Swap Chains and Demystifying Fullscreen Optimizations.