summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-08-13 04:19:08 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-08-13 04:19:08 +0000
commit446d3555fa5928b14e948d6957a579fdceb37633 (patch)
tree13c8b77df7dfa3052b28d561ae30ee7bde4e455b /Graphics/GraphicsEngine
parentFixed issue with reflecting Uniform Texel Buffers in Vulkan backend (diff)
downloadDiligentCore-446d3555fa5928b14e948d6957a579fdceb37633.tar.gz
DiligentCore-446d3555fa5928b14e948d6957a579fdceb37633.zip
D3D11 backend: enabled multiple swap chain support
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h2
-rw-r--r--Graphics/GraphicsEngine/include/SwapChainBase.h2
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h11
3 files changed, 11 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index 74226452..5e5b2e4f 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -161,7 +161,7 @@ public:
virtual void SetSwapChain( ISwapChain* pSwapChain )override final { m_pSwapChain = pSwapChain; }
/// Returns the swap chain
- ISwapChain *GetSwapChain() { return m_pSwapChain; }
+ ISwapChain* GetSwapChain() { return m_pSwapChain; }
/// Returns true if currently bound frame buffer is the default frame buffer
inline bool IsDefaultFBBound(){ return m_IsDefaultFramebufferBound; }
diff --git a/Graphics/GraphicsEngine/include/SwapChainBase.h b/Graphics/GraphicsEngine/include/SwapChainBase.h
index 4f15147f..8b9aa86f 100644
--- a/Graphics/GraphicsEngine/include/SwapChainBase.h
+++ b/Graphics/GraphicsEngine/include/SwapChainBase.h
@@ -83,7 +83,7 @@ protected:
{
m_SwapChainDesc.Width = NewWidth;
m_SwapChainDesc.Height = NewHeight;
- LOG_INFO_MESSAGE("Changing display resolution to ", m_SwapChainDesc.Width, "x", m_SwapChainDesc.Height);
+ LOG_INFO_MESSAGE("Resizing the swap chain to ", m_SwapChainDesc.Width, "x", m_SwapChainDesc.Height);
return true;
}
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index 63cfe7cf..de16811a 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -1219,6 +1219,11 @@ namespace Diligent
/// Default stencil value, which is used as optimized stencil clear value in D3D12
Uint8 DefaultStencilValue = 0;
+ /// Indicates if this is a primary swap chain. The back buffer and depth-stencil
+ /// buffer of the primary swap are set by SetRenderTargets(0, nullptr, nullptr)
+ /// call. There must be only one primary swap chain.
+ bool IsPrimary = true;
+
SwapChainDesc()noexcept{}
/// Constructor intializes the structure members with default values
@@ -1229,7 +1234,8 @@ namespace Diligent
Uint32 _SamplesCount = SwapChainDesc{}.SamplesCount,
Uint32 _BufferCount = SwapChainDesc{}.BufferCount,
Float32 _DefaultDepthValue = SwapChainDesc{}.DefaultDepthValue,
- Uint8 _DefaultStencilValue = SwapChainDesc{}.DefaultStencilValue) :
+ Uint8 _DefaultStencilValue = SwapChainDesc{}.DefaultStencilValue,
+ bool _IsPrimary = SwapChainDesc{}.IsPrimary) :
Width (_Width),
Height (_Height),
ColorBufferFormat (_ColorBufferFormat),
@@ -1237,7 +1243,8 @@ namespace Diligent
SamplesCount (_SamplesCount),
BufferCount (_BufferCount),
DefaultDepthValue (_DefaultDepthValue),
- DefaultStencilValue(_DefaultStencilValue)
+ DefaultStencilValue (_DefaultStencilValue),
+ IsPrimary (_IsPrimary)
{}
};