From 671ceacb591f21ba2aa565c81c358072ed90655a Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 28 May 2020 08:40:24 +0100 Subject: [PATCH] Fix structured export crash on D3D11 --- renderdoc/driver/d3d11/d3d11_context.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index f4c229acc..df762ba96 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -90,14 +90,19 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device *real NullCBCounts[i] = 4096; } - m_Type = m_pRealContext->GetType(); - D3D11_FEATURE_DATA_D3D11_OPTIONS features; RDCEraseEl(features); HRESULT hr = S_OK; if(m_pRealContext) + { hr = m_pDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &features, sizeof(features)); + m_Type = m_pRealContext->GetType(); + } + else + { + m_Type = D3D11_DEVICE_CONTEXT_IMMEDIATE; + } m_SetCBuffer1 = false; if(SUCCEEDED(hr))