diff --git a/renderdoc/driver/d3d11/d3d11_resources.cpp b/renderdoc/driver/d3d11/d3d11_resources.cpp index 35fc54bd0..5024de949 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.cpp +++ b/renderdoc/driver/d3d11/d3d11_resources.cpp @@ -146,6 +146,31 @@ void WrappedShader::ShaderEntry::BuildReflection() } } +void WrappedShader::ReloadShaderDebugInformation() +{ + SCOPED_LOCK(m_ShaderListLock); + for(auto it = m_ShaderList.begin(); it != m_ShaderList.end(); ++it) + { + if(ResourceIDGen::IsReplayOnlyID(it->first)) + continue; + it->second->Reload(); + } +} + +void WrappedShader::ShaderEntry::Reload() +{ + m_Built = false; + *m_Details = ShaderReflection(); + m_Access.clear(); + if(m_Bytecode.empty() && m_DXBCFile) + { + m_Bytecode = m_DXBCFile->GetInitialShaderBob(); + if(m_Bytecode.empty()) + m_Bytecode = m_DXBCFile->GetShaderBlob(); + } + SAFE_DELETE(m_DXBCFile); +} + UINT GetSubresourceCount(ID3D11Resource *res) { D3D11_RESOURCE_DIMENSION dim; diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index 13b1b27c7..c16e426b7 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -1025,6 +1025,7 @@ public: private: void BuildReflection(); + void Reload(); ResourceId m_ID; @@ -1096,6 +1097,8 @@ public: return m_ShaderList[m_ID]->GetDescriptorAccess(); } + static void ReloadShaderDebugInformation(); + static void GetReflections(rdcarray &refls) { SCOPED_LOCK(m_ShaderListLock);