1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d10] D3D10CreateDeviceAndSwapChain: Ignore swap chain if null

Like e4b91057ac74266671d806e535b76f0db6f409bc, this might fix some
issues with ReShade in D3D10 games.
This commit is contained in:
Philip Rebohle 2018-12-02 15:52:17 +01:00
parent e4b91057ac
commit 835d92b802

View File

@ -152,6 +152,9 @@ extern "C" {
InitReturnPtr(ppDevice);
InitReturnPtr(ppSwapChain);
if (ppSwapChain && !pSwapChainDesc)
return E_INVALIDARG;
// Try to create the device as usual
Com<ID3D10Device1> d3d10Device = nullptr;
HRESULT hr = D3D10CreateDevice1(pAdapter,
@ -162,9 +165,7 @@ extern "C" {
return hr;
// Create the swap chain if requested
if (pSwapChainDesc == nullptr)
return E_INVALIDARG;
if (ppSwapChain) {
Com<IDXGIDevice> dxgiDevice = nullptr;
Com<IDXGIAdapter> dxgiAdapter = nullptr;
Com<IDXGIFactory> dxgiFactory = nullptr;
@ -188,6 +189,7 @@ extern "C" {
Logger::err("D3D11CreateDeviceAndSwapChain: Failed to create swap chain");
return E_FAIL;
}
}
// Write back device pointer
if (ppDevice != nullptr) {