Merge pull request #6014 from Armada651/fix-factory

D3DBase: Use the correct version of CreateDXGIFactory.
This commit is contained in:
Stenzek 2017-09-03 22:48:44 +10:00 committed by GitHub
commit 75435aea6f
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");