if (*ppSwapChain)
{
// Handled by one of the plugins
hr = S_OK;
}
results in a major difference from the native implementation of this function. You can't assume that, just because the output ptr is non-null, you already handled creation of the swap chain. Use your own internal pointer and initialize it to zero, because previously, it was entirely valid to call CreateSwapChainForHwnd without bothering to initialize our output ptr to null. Now, doing so causes a silent failure to create a swap chain if the sl interposer is loaded.
In other words,
IDXGISwapChain1* swapChain;
auto result = factory->CreateSwapChainForHwnd(..., &swapChain);
works fine with standard D3D11, causes silent, non-deterministic failure (which results in later crashes) with SL interposer. For SL we have to ensure that swapChain is initialized to nullptr to get it to work.
dxgi.cpp:195
results in a major difference from the native implementation of this function. You can't assume that, just because the output ptr is non-null, you already handled creation of the swap chain. Use your own internal pointer and initialize it to zero, because previously, it was entirely valid to call CreateSwapChainForHwnd without bothering to initialize our output ptr to null. Now, doing so causes a silent failure to create a swap chain if the sl interposer is loaded.
In other words,
works fine with standard D3D11, causes silent, non-deterministic failure (which results in later crashes) with SL interposer. For SL we have to ensure that swapChain is initialized to nullptr to get it to work.