Add ClearAll to rasterizer cache for fully wiping the cache on save/load
This commit is contained in:
@ -437,7 +437,9 @@ void System::Reset() {
|
||||
|
||||
template <class Archive>
|
||||
void System::serialize(Archive& ar, const unsigned int file_version) {
|
||||
Memory::RasterizerFlushAndInvalidateRegion(0, 0xFFFFFFFF);
|
||||
// flush on save, don't flush on load
|
||||
bool should_flush = !Archive::is_loading::value;
|
||||
Memory::RasterizerClearAll(should_flush);
|
||||
ar&* timing.get();
|
||||
ar&* cpu_core.get();
|
||||
ar&* service_manager.get();
|
||||
|
@ -556,6 +556,16 @@ void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
|
||||
VideoCore::g_renderer->Rasterizer()->FlushAndInvalidateRegion(start, size);
|
||||
}
|
||||
|
||||
void RasterizerClearAll(bool flush) {
|
||||
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
||||
// null here
|
||||
if (VideoCore::g_renderer == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
VideoCore::g_renderer->Rasterizer()->ClearAll(flush);
|
||||
}
|
||||
|
||||
void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode) {
|
||||
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
||||
// null here
|
||||
|
@ -283,6 +283,12 @@ enum class FlushMode {
|
||||
FlushAndInvalidate,
|
||||
};
|
||||
|
||||
/**
|
||||
* Flushes and invalidates all memory in the rasterizer cache and removes any leftover state
|
||||
* If flush is true, the rasterizer should flush any cached resources to RAM before clearing
|
||||
*/
|
||||
void RasterizerClearAll(bool flush);
|
||||
|
||||
/**
|
||||
* Flushes and invalidates any externally cached rasterizer resources touching the given virtual
|
||||
* address region.
|
||||
|
Reference in New Issue
Block a user