Skip to content

Commit

Permalink
Possible fix for launch crashes.
Browse files Browse the repository at this point in the history
CreateSwapChain seemed to be returning some sort of bogus error, malformed.  If I simply ignore that error and return S_OK, I no longer get a crash.
  • Loading branch information
bo3b committed Apr 2, 2014
1 parent 456696c commit 7a40ff1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dependencies/d3dx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
calls=1

; Log Input key actions
input=1
input=0

; Log NVAPI convergence modifications
convergence=1
convergence=0
; Log NVAPI separation modifications
separation=1
separation=0

; Super verbose massive log
debug=1
debug=0

; Unbuffered logging to avoid missing anything at file end
unbuffered=1
unbuffered=0

;------------------------------------------------------------------------------------------------------
; Chain load other wrapper DLLs instead of system DLLs.
Expand Down
13 changes: 13 additions & 0 deletions DirectXGI/Direct3DXGIFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@ STDMETHODIMP D3D11Wrapper::IDXGIFactory::CreateSwapChain(THIS_
D3D11Base::IDXGISwapChain *origSwapChain;
IUnknown *realDevice = ReplaceDevice(pDevice);
HRESULT hr = m_pFactory->CreateSwapChain(realDevice, pDesc, &origSwapChain);

// Todo: double check this fix.
// From debugging, it seems that this call is returning a half-error. The error code
// is 0x087A0001, not the proper DXGI_ERROR_INVALID_CALL=0x887A0001 that we'd expect.
// This is quite unusual.
// If I simply ignore that error, then I can no longer reproduce the crash.

if (hr == 0x087A0001)
{
if (LogFile) fprintf(LogFile, "--------CreateSwapChain returned fake error: %X\n", hr);
hr = S_OK;
}

if (hr == S_OK)
{
*ppSwapChain = D3D11Wrapper::IDXGISwapChain::GetDirectSwapChain(origSwapChain);
Expand Down

0 comments on commit 7a40ff1

Please sign in to comment.