Add some missing refcount releases in D3D12 driver

This commit is contained in:
baldurk
2018-12-04 19:27:12 +00:00
parent bc051afbe2
commit 6a9f74cddb
4 changed files with 28 additions and 7 deletions
+19 -3
View File
@@ -360,8 +360,23 @@ D3D12DebugManager::~D3D12DebugManager()
SAFE_RELEASE(uavClearHeap);
SAFE_RELEASE(samplerHeap);
SAFE_RELEASE(m_MeshVS);
SAFE_RELEASE(m_MeshGS);
SAFE_RELEASE(m_MeshPS);
SAFE_RELEASE(m_CBOnlyRootSig);
SAFE_RELEASE(m_ArrayMSAARootSig);
SAFE_RELEASE(m_FullscreenVS);
SAFE_RELEASE(m_IntMS2Array);
SAFE_RELEASE(m_FloatMS2Array);
SAFE_RELEASE(m_DepthMS2Array);
SAFE_RELEASE(m_IntArray2MS);
SAFE_RELEASE(m_FloatArray2MS);
SAFE_RELEASE(m_DepthArray2MS);
SAFE_RELEASE(m_ReadbackBuffer);
SAFE_RELEASE(m_RingConstantBuffer);
@@ -1249,9 +1264,9 @@ void D3D12Replay::GeneralMisc::Init(WrappedID3D12Device *device, D3D12DebugManag
RDCERR("Couldn't create m_OutlinePipe! HRESULT: %s", ToStr(hr).c_str());
}
RDCASSERT(CheckerboardPS);
RDCASSERT(FullscreenVS);
RDCASSERT(FixedColPS);
SAFE_RELEASE(CheckerboardPS);
SAFE_RELEASE(FullscreenVS);
SAFE_RELEASE(FixedColPS);
}
shaderCache->SetCaching(false);
@@ -1502,6 +1517,7 @@ void D3D12Replay::OverlayRendering::Init(WrappedID3D12Device *device, D3D12Debug
void D3D12Replay::OverlayRendering::Release()
{
SAFE_RELEASE(MeshVS);
SAFE_RELEASE(TriangleSizeGS);
SAFE_RELEASE(TriangleSizePS);
SAFE_RELEASE(QuadOverdrawWritePS);
+4 -3
View File
@@ -203,7 +203,7 @@ WrappedID3D12Device::WrappedID3D12Device(ID3D12Device *realDevice, D3D12InitPara
m_HeaderChunk = NULL;
m_Alloc = m_DataUploadAlloc = NULL;
m_List = m_DataUploadList = NULL;
m_DataUploadList = NULL;
m_GPUSyncFence = NULL;
m_GPUSyncHandle = NULL;
m_GPUSyncCounter = 0;
@@ -416,6 +416,8 @@ WrappedID3D12Device::~WrappedID3D12Device()
SAFE_DELETE(m_ResourceManager);
SAFE_RELEASE(m_pDevice3);
SAFE_RELEASE(m_pDevice2);
SAFE_RELEASE(m_pDevice1);
SAFE_RELEASE(m_pInfoQueue);
@@ -2320,8 +2322,7 @@ void WrappedID3D12Device::DestroyInternalResources()
ExecuteLists();
FlushLists(true);
for(size_t i = 0; i < m_InternalCmds.pendingcmds.size(); i++)
SAFE_RELEASE(m_InternalCmds.pendingcmds[i]);
SAFE_RELEASE(m_RTVHeap);
SAFE_DELETE(m_TextRenderer);
SAFE_DELETE(m_ShaderCache);
+1 -1
View File
@@ -291,7 +291,7 @@ private:
WrappedID3D12CommandQueue *m_Queue;
ID3D12CommandAllocator *m_Alloc = NULL, *m_DataUploadAlloc = NULL;
ID3D12GraphicsCommandList *m_List = NULL, *m_DataUploadList = NULL;
ID3D12GraphicsCommandList *m_DataUploadList = NULL;
ID3D12DescriptorHeap *m_RTVHeap = NULL;
ID3D12Fence *m_GPUSyncFence;
HANDLE m_GPUSyncHandle;
+4
View File
@@ -141,6 +141,8 @@ void D3D12Replay::Initialise()
memcpy(m_DriverInfo.version, descString.c_str(), descString.size());
RDCLOG("Running replay on %s / %s", ToStr(m_DriverInfo.vendor).c_str(), m_DriverInfo.version);
SAFE_RELEASE(pDXGIAdapter);
}
}
}
@@ -203,6 +205,8 @@ void D3D12Replay::DestroyResources()
SAFE_RELEASE(m_SOBuffer);
SAFE_RELEASE(m_SOStagingBuffer);
SAFE_RELEASE(m_SOPatchedIndexBuffer);
SAFE_RELEASE(m_SOQueryHeap);
SAFE_RELEASE(m_pFactory);