rsx/gl/vk: Invalidate texture regions when memory is unmapped

- Free GPU resources immediately if mappings change to avoid leaking VRAM
This commit is contained in:
kd-11 2017-08-08 00:54:40 +03:00
parent 00b0311c86
commit 1da732bbf5
11 changed files with 128 additions and 54 deletions

View file

@ -6,6 +6,7 @@
#include "Utilities/VirtualMemory.h"
#include "Emu/CPU/CPUThread.h"
#include "Emu/Cell/lv2/sys_memory.h"
#include "Emu/RSX/GSRender.h"
#ifdef _WIN32
#include <Windows.h>
@ -656,6 +657,7 @@ namespace vm
if (found != m_map.end())
{
const u32 size = found->second;
const auto rsxthr = fxm::get<GSRender>();
// Remove entry
m_map.erase(found);
@ -663,6 +665,9 @@ namespace vm
// Unmap "real" memory pages
_page_unmap(addr, size);
// Notify rsx to invalidate range
if (rsxthr != nullptr) rsxthr->on_notify_memory_unmapped(addr, size);
// Write supplementary info if necessary
if (sup_out) *sup_out = m_sup[addr];