Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

swapChain.ResizeTarget & refresh rate #258

Closed
CoderBob opened this issue Jan 25, 2014 · 2 comments
Closed

swapChain.ResizeTarget & refresh rate #258

CoderBob opened this issue Jan 25, 2014 · 2 comments

Comments

@CoderBob
Copy link

swapChain.ContainingOutput.GetClosestMatchingMode(device, modeDesc, out modeDesc);

swapChain.ResizeTarget(ref modeDesc);

When going to fullscreen mode, I make sure I use a ModeDescription that is supported by my monitor (in this case 60020/1000). The problem is though, that the ResizeTarget method does not change the refresh rate of the swapchain, (which remains stuck at 60/1) and I get the following warning:

DXGI Warning: IDXGISwapChain::Present: Fullscreen presentation inefficiencies incurred due to application not using IDXGISwapChain::ResizeBuffers appropriately, specifying a DXGI_MODE_DESC not available in IDXGIOutput::GetDisplayModeList, or not using DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH. DXGI_SWAP_CHAIN_DESC::BufferDesc = { 1280, 1024, { 60, 1 }, R8G8B8A8_UNORM, 0, 0 }; DXGI_SWAP_CHAIN_DESC::SampleDesc = { 1, 0 }; DXGI_SWAP_CHAIN_DESC::Flags = 0x2;

@xoofx
Copy link
Member

xoofx commented Jan 26, 2014

This is a usage problem and unlikely an issue with SharpDX, so we can't really dig into this. You need to be careful with full screen modes, you have probably followed "DXGI Best Practices" but make sure to double check everything. In SharpDX, there is a working code for switching to fullscreen in the Toolkit SwapChainPresenter.IsFullscreen property.

@xoofx xoofx closed this as completed Jan 26, 2014
@CoderBob
Copy link
Author

Yes, I am following the DXGI recommendations, and my code is effectively identical to the sample you linked to. Calling the method ResizeTarget is supposed to set the refresh rate of the swapChain and it doesn't. Unless there is a specific reason as to why a swapChain has an immutable refresh rate, then this is a bug (though perhaps on the DirectX side rather than sharpdx)

p.s. Creating the swapchain with a modeDesc.RefreshRate = (0,0), AND calling twice swapChain.ResizeBuffers (once before SetFullscreen, and once right after) removes the warning.
Yet the swapChain refresh rate is still stuck at the original value (0,0)!

(p.s. this is on Windows 7)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants