Handle duplicate root signatures coming back from D3D. Refs #325

This commit is contained in:
baldurk
2016-09-16 11:12:56 +02:00
parent cd19fa458c
commit 055f27f17e
@@ -531,6 +531,16 @@ HRESULT WrappedID3D12Device::CreateRootSignature(UINT nodeMask, const void *pBlo
{
SCOPED_LOCK(m_D3DLock);
// duplicate signatures can be returned, if Create is called with a previous equivalent blob
if(GetResourceManager()->HasWrapper(real))
{
real->Release();
ID3D12RootSignature *existing = (ID3D12RootSignature *)GetResourceManager()->GetWrapper(real);
existing->AddRef();
*ppvRootSignature = existing;
return ret;
}
WrappedID3D12RootSignature *wrapped = new WrappedID3D12RootSignature(real, this);
if(m_State >= WRITING)