From ca072b2d43261ccb36afe28872180149e060c87d Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 25 Jul 2016 14:39:57 +0200 Subject: [PATCH] Fix handling of D3D11 deferred contexts that got broken --- renderdoc/driver/d3d11/d3d11_context.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_context.cpp b/renderdoc/driver/d3d11/d3d11_context.cpp index 43c37d99b..ca68e8cba 100644 --- a/renderdoc/driver/d3d11/d3d11_context.cpp +++ b/renderdoc/driver/d3d11/d3d11_context.cpp @@ -901,19 +901,19 @@ void WrappedID3D11DeviceContext::RefreshDrawcallIDs(DrawcallTreeNode &node) void WrappedID3D11DeviceContext::AddDrawcall(const FetchDrawcall &d, bool hasEvents) { - if(GetType() == D3D11_DEVICE_CONTEXT_DEFERRED) - { - m_pDevice->GetImmediateContext()->AddDrawcall(d, hasEvents); - return; - } - - m_AddedDrawcall = true; - FetchDrawcall draw = d; if(draw.context == ResourceId()) draw.context = m_pDevice->GetResourceManager()->GetOriginalID(m_ResourceID); + if(GetType() == D3D11_DEVICE_CONTEXT_DEFERRED) + { + m_pDevice->GetImmediateContext()->AddDrawcall(draw, hasEvents); + return; + } + + m_AddedDrawcall = true; + WrappedID3D11DeviceContext *context = (WrappedID3D11DeviceContext *)m_pDevice->GetResourceManager()->GetLiveResource(draw.context);