summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-07-25 03:08:47 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-07-25 03:08:47 +0000
commit557b97489d5d5780fae4fb5fa7897950e2d01b1f (patch)
treedc5035280b32214ed7085a9a1df5f9f7b197cb3b /Graphics/GraphicsEngineD3DBase
parentVulkan backend: added SPIRV legalization when compiling from HLSL (diff)
downloadDiligentCore-557b97489d5d5780fae4fb5fa7897950e2d01b1f.tar.gz
DiligentCore-557b97489d5d5780fae4fb5fa7897950e2d01b1f.zip
Fixed issue with DXGI swap chain not supporting DXGI_SCALING_NONE on Windows 7
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
index c4cfa0b9..1afdd1d6 100644
--- a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
+++ b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.h
@@ -23,6 +23,7 @@
#pragma once
+#include <VersionHelpers.h>
#include "SwapChainBase.h"
/// \file
@@ -111,7 +112,8 @@ namespace Diligent
// ;
swapChainDesc.BufferCount = m_SwapChainDesc.BufferCount;
- swapChainDesc.Scaling = DXGI_SCALING_NONE;
+ // DXGI_SCALING_NONE is not supported in Windows 7
+ swapChainDesc.Scaling = IsWindows8OrGreater() ? DXGI_SCALING_NONE : DXGI_SCALING_STRETCH;
// DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL is the flip presentation model, where the contents of the back
// buffer is preserved after the call to Present. This flag cannot be used with multisampling.
@@ -135,9 +137,9 @@ namespace Diligent
DXGI_SWAP_CHAIN_FULLSCREEN_DESC FullScreenDesc = {};
FullScreenDesc.Windowed = m_FSDesc.Fullscreen ? FALSE : TRUE;
- FullScreenDesc.RefreshRate.Numerator = m_FSDesc.RefreshRateNumerator;
+ FullScreenDesc.RefreshRate.Numerator = m_FSDesc.RefreshRateNumerator;
FullScreenDesc.RefreshRate.Denominator = m_FSDesc.RefreshRateDenominator;
- FullScreenDesc.Scaling = static_cast<DXGI_MODE_SCALING>(m_FSDesc.Scaling);
+ FullScreenDesc.Scaling = static_cast<DXGI_MODE_SCALING>(m_FSDesc.Scaling);
FullScreenDesc.ScanlineOrdering = static_cast<DXGI_MODE_SCANLINE_ORDER>(m_FSDesc.ScanlineOrder);
hr = factory->CreateSwapChainForHwnd(pD3D11DeviceOrD3D12CmdQueue, hWnd, &swapChainDesc, &FullScreenDesc, nullptr, &pSwapChain1);
CHECK_D3D_RESULT_THROW(hr, "Failed to create Swap Chain");