Init copyheap after checking for errors

* This doesn't actually fix any problems, but a couple of crash reports
  exposed the fact that we try to use the result of CreateDescriptorHeap
  before checking for errors - this leads to a crash and hides the real
  problem.
This commit is contained in:
baldurk
2017-01-04 16:56:12 +00:00
parent 52cbc802a1
commit 78706d3d01
+2 -2
View File
@@ -957,14 +957,14 @@ bool D3D12ResourceManager::Serialise_InitialState(ResourceId resid, ID3D12Device
HRESULT hr = m_Device->GetReal()->CreateDescriptorHeap(&desc, __uuidof(ID3D12DescriptorHeap),
(void **)&copyheap);
copyheap = new WrappedID3D12DescriptorHeap(copyheap, m_Device, desc);
if(FAILED(hr))
{
RDCERR("Failed to create CPU descriptor heap for initial state: 0x%08x", hr);
return false;
}
copyheap = new WrappedID3D12DescriptorHeap(copyheap, m_Device, desc);
D3D12_CPU_DESCRIPTOR_HANDLE handle = copyheap->GetCPUDescriptorHandleForHeapStart();
UINT increment = m_Device->GetDescriptorHandleIncrementSize(desc.Type);