D3D: Use Direct3D 11.1 where supported
This commit is contained in:
parent
0622979d3b
commit
c9d649d27c
|
@ -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<ID3D11Device1>(&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)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <d3d11.h>
|
||||
#include <d3d11_1.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <dxgi1_2.h>
|
||||
#include <vector>
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue