fix dx11 hardware bug (old fix by @WitchGod)

This commit is contained in:
Callow 2022-07-13 10:38:27 +03:00
parent 8f48ff5c19
commit 6fd7a2e2ef

View File

@ -82,10 +82,10 @@ static IDXGISwapChainPresent findDirect11Present()
ID3D11DeviceContext* pContext = nullptr; ID3D11DeviceContext* pContext = nullptr;
ID3D11Device* pDevice = nullptr; ID3D11Device* pDevice = nullptr;
if (/*FAILED(D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_WARP, NULL, NULL, &featureLevel, 1, if (FAILED(D3D11CreateDeviceAndSwapChain(nullptr, D3D_DRIVER_TYPE_WARP, nullptr, 0, nullptr, 1, D3D11_SDK_VERSION,
D3D11_SDK_VERSION, &swapChainDesc, &pSwapChain, &pDevice, NULL, &pContext)) &&*/ &swapChainDesc, &pSwapChain, &pDevice, &featureLevel, &pContext)) &&
FAILED(D3D11CreateDeviceAndSwapChain(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, FAILED(D3D11CreateDeviceAndSwapChain(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION,
&swapChainDesc, &pSwapChain, &pDevice, &featureLevel, nullptr))) &swapChainDesc, &pSwapChain, &pDevice, &featureLevel, &pContext)))
{ {
DestroyWindow(swapChainDesc.OutputWindow); DestroyWindow(swapChainDesc.OutputWindow);
UnregisterClass(wc.lpszClassName, GetModuleHandle(nullptr)); UnregisterClass(wc.lpszClassName, GetModuleHandle(nullptr));