From c9d649d27cf3fcd0110647eb093113408e8e3a4f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 3 Sep 2017 16:33:47 +1000 Subject: [PATCH] D3D: Use Direct3D 11.1 where supported --- Source/Core/VideoBackends/D3D/D3DBase.cpp | 6 ++++++ Source/Core/VideoBackends/D3D/D3DBase.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index e4b16a36fb..e15f4e392e 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -33,6 +33,7 @@ int d3d_dll_ref = 0; namespace D3D { ID3D11Device* device = nullptr; +ID3D11Device1* device1 = nullptr; ID3D11DeviceContext* context = nullptr; static IDXGISwapChain1* swapchain = nullptr; static ID3D11Debug* debug = nullptr; @@ -377,6 +378,10 @@ HRESULT Create(HWND wnd) return E_FAIL; } + hr = device->QueryInterface(&device1); + if (FAILED(hr)) + WARN_LOG(VIDEO, "Missing Direct3D 11.1 support. Logical operations will not be supported."); + // prevent DXGI from responding to Alt+Enter, unfortunately DXGI_MWA_NO_ALT_ENTER // does not work so we disable all monitoring of window messages. However this // may make it more difficult for DXGI to handle display mode changes. @@ -439,6 +444,7 @@ void Close() context->Flush(); // immediately destroy device objects SAFE_RELEASE(context); + SAFE_RELEASE(device1); ULONG references = device->Release(); #if defined(_DEBUG) || defined(DEBUGFAST) diff --git a/Source/Core/VideoBackends/D3D/D3DBase.h b/Source/Core/VideoBackends/D3D/D3DBase.h index 224395a016..e1328494df 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.h +++ b/Source/Core/VideoBackends/D3D/D3DBase.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -56,6 +57,7 @@ HRESULT Create(HWND wnd); void Close(); extern ID3D11Device* device; +extern ID3D11Device1* device1; extern ID3D11DeviceContext* context; extern HWND hWnd; extern bool bFrameInProgress;