gl_rasterizer_cache: Only flush when use_accurate_framebuffers is enabled.

This commit is contained in:
bunnei 2018-10-14 16:09:01 -04:00
parent 5f79ba04bd
commit 949d7832fa
2 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include "common/common_types.h"
#include "core/core.h"
#include "core/settings.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/renderer_base.h"
@ -87,7 +88,12 @@ protected:
void Unregister(const T& object) {
auto& rasterizer = Core::System::GetInstance().Renderer().Rasterizer();
rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1);
object->Flush();
if (Settings::values.use_accurate_framebuffers) {
// Only flush if use_accurate_framebuffers is enabled, as it incurs a performance hit
object->Flush();
}
object_cache.subtract({GetInterval(object), ObjectSet{object}});
}

View File

@ -637,7 +637,12 @@ void RasterizerOpenGL::FlushAll() {}
void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
res_cache.FlushRegion(addr, size);
if (Settings::values.use_accurate_framebuffers) {
// Only flush if use_accurate_framebuffers is enabled, as it incurs a performance hit
res_cache.FlushRegion(addr, size);
}
shader_cache.FlushRegion(addr, size);
buffer_cache.FlushRegion(addr, size);
}