summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-05 05:58:45 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-05 05:58:45 +0000
commit2f7704623cc3c0bedb8ab9f527cbc03b081998e7 (patch)
treec7b95ec4d7c106a3455af05946c7cd0b74f29641 /Graphics
parentAdded more renderpass-related checks (diff)
parentFixed IDXGISwapChain2 issue on Windows 7 (closed https://github.com/DiligentG... (diff)
downloadDiligentCore-2f7704623cc3c0bedb8ab9f527cbc03b081998e7.tar.gz
DiligentCore-2f7704623cc3c0bedb8ab9f527cbc03b081998e7.zip
Merge branch 'master'
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.hpp4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp2
-rw-r--r--Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp2
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.hpp16
4 files changed, 14 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.hpp
index 0c36c5d3..209d5d4c 100644
--- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.hpp
@@ -37,10 +37,10 @@ namespace Diligent
{
/// Swap chain implementation in Direct3D11 backend.
-class SwapChainD3D11Impl final : public SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain2>
+class SwapChainD3D11Impl final : public SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>
{
public:
- using TSwapChainBase = SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain2>;
+ using TSwapChainBase = SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>;
SwapChainD3D11Impl(IReferenceCounters* pRefCounters,
const SwapChainDesc& SCDesc,
diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
index d413ac5f..c8c26d80 100644
--- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
@@ -59,7 +59,7 @@ static CComPtr<IDXGIAdapter1> DXGIAdapterFromD3D11Device(ID3D11Device* pd3d11Dev
if (SUCCEEDED(hr))
{
CComPtr<IDXGIAdapter1> pDXGIAdapter1;
- pDXGIAdapter->QueryInterface(__uuidof(pDXGIAdapter1), reinterpret_cast<void**>(static_cast<IDXGIAdapter1**>(&pDXGIAdapter1)));
+ pDXGIAdapter.QueryInterface(&pDXGIAdapter1);
return pDXGIAdapter1;
}
else
diff --git a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp
index 1b61a393..74a69136 100644
--- a/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/EngineFactoryD3D12.cpp
@@ -295,7 +295,7 @@ void EngineFactoryD3D12Impl::CreateDeviceAndContextsD3D12(const EngineD3D12Creat
if (EngineCI.EnableDebugLayer)
{
CComPtr<ID3D12InfoQueue> pInfoQueue;
- hr = d3d12Device->QueryInterface(__uuidof(pInfoQueue), reinterpret_cast<void**>(static_cast<ID3D12InfoQueue**>(&pInfoQueue)));
+ hr = d3d12Device.QueryInterface(&pInfoQueue);
if (SUCCEEDED(hr))
{
// Suppress whole categories of messages
diff --git a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.hpp b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.hpp
index 0389f583..701361d1 100644
--- a/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.hpp
+++ b/Graphics/GraphicsEngineD3DBase/include/SwapChainD3DBase.hpp
@@ -205,7 +205,7 @@ protected:
// false if an application is not manifested for Windows 8.1 or Windows 10, even if the current
// operating system version is Windows 8.1 or Windows 10.
CComPtr<IDXGIFactory3> pDXGIFactory3;
- if (SUCCEEDED(pDXGIFactory->QueryInterface(__uuidof(pDXGIFactory3), reinterpret_cast<void**>(static_cast<IDXGIFactory3**>(&pDXGIFactory3)))))
+ if (SUCCEEDED(pDXGIFactory.QueryInterface(&pDXGIFactory3)))
{
swapChainDesc.Flags |= DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT;
}
@@ -254,16 +254,20 @@ protected:
#endif
- hr = pSwapChain1->QueryInterface(__uuidof(m_pSwapChain), reinterpret_cast<void**>(static_cast<DXGISwapChainType**>(&m_pSwapChain)));
+ hr = pSwapChain1.QueryInterface(&m_pSwapChain);
CHECK_D3D_RESULT_THROW(hr, "Failed to query the required swap chain interface");
if ((swapChainDesc.Flags & DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT) != 0)
{
- // IMPORTANT: SetMaximumFrameLatency must be called BEFORE GetFrameLatencyWaitableObject!
- m_pSwapChain->SetMaximumFrameLatency(m_MaxFrameLatency);
+ CComPtr<IDXGISwapChain2> pSwapChain2;
+ if (SUCCEEDED(pSwapChain1.QueryInterface(&pSwapChain2)))
+ {
+ // IMPORTANT: SetMaximumFrameLatency must be called BEFORE GetFrameLatencyWaitableObject!
+ pSwapChain2->SetMaximumFrameLatency(m_MaxFrameLatency);
- m_FrameLatencyWaitableObject = m_pSwapChain->GetFrameLatencyWaitableObject();
- VERIFY(m_FrameLatencyWaitableObject != NULL, "Waitable object must not be null");
+ m_FrameLatencyWaitableObject = pSwapChain2->GetFrameLatencyWaitableObject();
+ VERIFY(m_FrameLatencyWaitableObject != NULL, "Waitable object must not be null");
+ }
}
else
{