From 4286588ac16da448093054a3478a8796cdf59dfc Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 23 Oct 2017 13:49:16 +0100 Subject: [PATCH] D3D11 context state is cleared before executing a command list. * Not doing this could taint the state and even cause invalid read-write conflicts to change bindings vs. what should happen, if a RT is left bound when it shouldn't, and then an SRV is bound as NULL because it would conflict. --- renderdoc/driver/d3d11/d3d11_context_wrap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 91a700059..b77347395 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -4854,6 +4854,11 @@ bool WrappedID3D11DeviceContext::Serialise_ExecuteCommandList(ID3D11CommandList { SAFE_DELETE(m_DeferredSavedState); m_DeferredSavedState = new D3D11RenderState(this); + + // From the Docs: + // "Immediate context state is cleared before and after a command list is executed. A command + // list has no concept of inheritance." + ClearState(); } if(m_State == READING)