mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 21:11:25 +12:00
- We waste a lot of time trying to manage that. We just swap out the buffer anyway as long as the client has enough RAM. - This was more of an issue in early days when corrupt allocation requests were common trying to take gigabytes in one draw.
33 lines
745 B
C++
33 lines
745 B
C++
#pragma once
|
|
|
|
#include <util/types.hpp>
|
|
|
|
#include <unordered_map>
|
|
|
|
namespace vk
|
|
{
|
|
class data_heap;
|
|
|
|
namespace data_heap_manager
|
|
{
|
|
using managed_heap_snapshot_t = std::unordered_map<const vk::data_heap*, s64>;
|
|
|
|
// Submit ring buffer for management
|
|
void register_ring_buffer(vk::data_heap& heap);
|
|
|
|
// Bulk registration
|
|
void register_ring_buffers(std::initializer_list<std::reference_wrapper<vk::data_heap>> heaps);
|
|
|
|
// Capture managed ring buffers snapshot at current time
|
|
managed_heap_snapshot_t get_heap_snapshot();
|
|
|
|
// Synchronize heap with snapshot
|
|
void restore_snapshot(const managed_heap_snapshot_t& snapshot);
|
|
|
|
// Reset all managed heap allocations
|
|
void reset_heap_allocations();
|
|
|
|
// Cleanup
|
|
void reset();
|
|
}
|
|
}
|