mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
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:
parent
00b0311c86
commit
1da732bbf5
11 changed files with 128 additions and 54 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue