Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncapped full-screen frame rate by bypassing DWM #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chsigg
Copy link
Owner

@chsigg chsigg commented Oct 2, 2015

Disabling vsync in DX12 is non-trivial, but possible. The D3D12Fullscreen sample doesn't allow uncapped frame rates because even the full-screen uses DWM. Fullscreen mode is basically just a maximized window without border.

To enable full-screen mode without DWM, I added DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH. This requires the swapchain buffers need to be resized after toggling between windowed and full-screen mode. I moved this functionality from OnSizeChanged() to a separate ResizeBuffers() function. This allows uncapped frame rates in full-screen on the primary monitor.
To avoid unnecessary flicker when switching to full-screen manually ('space' instead of alt-enter), the window is resized to the target resolution before the mode switch. The target resolution is currently the maximum output resolution (I couldn't find any method to get physical resolution on high-DPI screen).

Relevant discussion: https://directx12forum.azurewebsites.net/index.php?topic=4131.15

@chsigg chsigg closed this Oct 2, 2015
@chsigg chsigg reopened this Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant