Fix a couple of CPU memory leaks in D3D12

This commit is contained in:
baldurk
2018-12-04 23:53:41 +00:00
parent 217b584d15
commit aad7551e4b
3 changed files with 9 additions and 5 deletions
@@ -238,6 +238,8 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
WrappedID3D12CommandQueue::~WrappedID3D12CommandQueue()
{
SAFE_DELETE(m_FrameReader);
if(m_QueueRecord)
m_QueueRecord->Delete(m_pDevice->GetResourceManager());
m_pDevice->GetResourceManager()->ReleaseCurrentResource(GetResourceID());
+5 -4
View File
@@ -152,6 +152,7 @@ class WrappedID3D12CommandSignature;
struct BakedCmdListInfo
{
~BakedCmdListInfo() { SAFE_DELETE(draw); }
void ShiftForRemoved(uint32_t shiftDrawID, uint32_t shiftEID, size_t idx);
struct ExecuteData
@@ -193,10 +194,10 @@ struct BakedCmdListInfo
uint32_t beginChunk = 0;
uint32_t endChunk = 0;
D3D12DrawcallTreeNode *draw; // the root draw to copy from when submitting
uint32_t eventCount; // how many events are in this cmd list, for quick skipping
uint32_t curEventID; // current event ID while reading or executing
uint32_t drawCount; // similar to above
D3D12DrawcallTreeNode *draw = NULL; // the root draw to copy from when submitting
uint32_t eventCount; // how many events are in this cmd list, for quick skipping
uint32_t curEventID; // current event ID while reading or executing
uint32_t drawCount; // similar to above
};
class WrappedID3D12Device;
+2 -1
View File
@@ -568,7 +568,8 @@ public:
static void RegisterD3DDeviceCallback(D3DDeviceCallback callback)
{
m_D3DCallbacks.push_back(callback);
if(std::find(m_D3DCallbacks.begin(), m_D3DCallbacks.end(), callback) == m_D3DCallbacks.end())
m_D3DCallbacks.push_back(callback);
}
static ID3DDevice *GetD3DDevice(IUnknown *dev)