mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-03 14:50:40 +00:00
d3d12: Fix memleak
This commit is contained in:
parent
c6a5e905bc
commit
d29b82566e
2 changed files with 9 additions and 4 deletions
|
@ -414,7 +414,7 @@ D3D12GSRender::D3D12GSRender()
|
||||||
LOG_WARNING(RSX, "Modified %x, starting again", texadrr);
|
LOG_WARNING(RSX, "Modified %x, starting again", texadrr);
|
||||||
ID3D12Resource *texToErase = m_texturesCache[texadrr];
|
ID3D12Resource *texToErase = m_texturesCache[texadrr];
|
||||||
m_texturesCache.erase(texadrr);
|
m_texturesCache.erase(texadrr);
|
||||||
m_Textoclean.push_back(texToErase);
|
m_texToClean.push_back(texToErase);
|
||||||
|
|
||||||
vm::page_protect(protectedRangeStart, protectedRangeSize, 0, vm::page_writable, 0);
|
vm::page_protect(protectedRangeStart, protectedRangeSize, 0, vm::page_writable, 0);
|
||||||
m_protectedTextures.erase(currentIt);
|
m_protectedTextures.erase(currentIt);
|
||||||
|
@ -613,6 +613,10 @@ D3D12GSRender::~D3D12GSRender()
|
||||||
m_rtts.Release();
|
m_rtts.Release();
|
||||||
for (unsigned i = 0; i < 17; i++)
|
for (unsigned i = 0; i < 17; i++)
|
||||||
m_rootSignatures[i]->Release();
|
m_rootSignatures[i]->Release();
|
||||||
|
for (auto tmp : m_texToClean)
|
||||||
|
tmp->Release();
|
||||||
|
for (auto tmp : m_texturesCache)
|
||||||
|
tmp.second->Release();
|
||||||
m_swapChain->Release();
|
m_swapChain->Release();
|
||||||
m_outputScalingPass.Release();
|
m_outputScalingPass.Release();
|
||||||
m_device->Release();
|
m_device->Release();
|
||||||
|
@ -1063,8 +1067,8 @@ void D3D12GSRender::Flip()
|
||||||
};
|
};
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(mut);
|
std::lock_guard<std::mutex> lock(mut);
|
||||||
std::vector<ID3D12Resource *> textoclean = m_Textoclean;
|
std::vector<ID3D12Resource *> textoclean = m_texToClean;
|
||||||
m_Textoclean.clear();
|
m_texToClean.clear();
|
||||||
|
|
||||||
m_GC.pushWork([&, cleaningFunction, textoclean]()
|
m_GC.pushWork([&, cleaningFunction, textoclean]()
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,7 +209,8 @@ private:
|
||||||
*/
|
*/
|
||||||
std::mutex mut;
|
std::mutex mut;
|
||||||
std::list <std::tuple<u32, u32, u32> > m_protectedTextures; // Texaddress, start of protected range, size of protected range
|
std::list <std::tuple<u32, u32, u32> > m_protectedTextures; // Texaddress, start of protected range, size of protected range
|
||||||
std::vector<ID3D12Resource *> m_Textoclean;
|
std::vector<ID3D12Resource *> m_texToClean;
|
||||||
|
|
||||||
GarbageCollectionThread m_GC;
|
GarbageCollectionThread m_GC;
|
||||||
// Copy of RTT to be used as texture
|
// Copy of RTT to be used as texture
|
||||||
std::unordered_map<u32, ID3D12Resource* > m_texturesRTTs;
|
std::unordered_map<u32, ID3D12Resource* > m_texturesRTTs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue