D3DBase: Use the correct version of CreateDXGIFactory.

This commit is contained in:
Jules Blok 2017-09-03 13:55:07 +02:00
parent 99d61906cc
commit 8906b26ea5
2 changed files with 8 additions and 5 deletions

View File

@ -66,9 +66,12 @@ HRESULT LoadDXGI()
--dxgi_dll_ref; --dxgi_dll_ref;
return E_FAIL; return E_FAIL;
} }
PCreateDXGIFactory = (CREATEDXGIFACTORY)GetProcAddress(hDXGIDll, "CreateDXGIFactory");
// Even though we use IDXGIFactory2 we use CreateDXGIFactory1 to create it to maintain
// compatibility with Windows 7
PCreateDXGIFactory = (CREATEDXGIFACTORY)GetProcAddress(hDXGIDll, "CreateDXGIFactory1");
if (PCreateDXGIFactory == nullptr) if (PCreateDXGIFactory == nullptr)
MessageBoxA(nullptr, "GetProcAddress failed for CreateDXGIFactory!", "Critical error", MessageBoxA(nullptr, "GetProcAddress failed for CreateDXGIFactory1!", "Critical error",
MB_OK | MB_ICONERROR); MB_OK | MB_ICONERROR);
return S_OK; return S_OK;
@ -264,7 +267,7 @@ HRESULT Create(HWND wnd)
} }
IDXGIFactory2* factory; IDXGIFactory2* factory;
hr = PCreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory); hr = PCreateDXGIFactory(__uuidof(IDXGIFactory2), (void**)&factory);
if (FAILED(hr)) if (FAILED(hr))
MessageBox(wnd, _T("Failed to create IDXGIFactory object"), _T("Dolphin Direct3D 11 backend"), MessageBox(wnd, _T("Failed to create IDXGIFactory object"), _T("Dolphin Direct3D 11 backend"),
MB_OK | MB_ICONERROR); MB_OK | MB_ICONERROR);

View File

@ -82,9 +82,9 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsDynamicSamplerIndexing = false; g_Config.backend_info.bSupportsDynamicSamplerIndexing = false;
g_Config.backend_info.bSupportsBPTCTextures = false; g_Config.backend_info.bSupportsBPTCTextures = false;
IDXGIFactory* factory; IDXGIFactory2* factory;
IDXGIAdapter* ad; IDXGIAdapter* ad;
hr = DX11::PCreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory); hr = DX11::PCreateDXGIFactory(__uuidof(IDXGIFactory2), (void**)&factory);
if (FAILED(hr)) if (FAILED(hr))
PanicAlert("Failed to create IDXGIFactory object"); PanicAlert("Failed to create IDXGIFactory object");