mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-12-02 19:24:27 +01:00
gl_rasterizer_cache: Only flush when use_accurate_framebuffers is enabled.
This commit is contained in:
parent
5f79ba04bd
commit
949d7832fa
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
|
#include "core/settings.h"
|
||||||
#include "video_core/rasterizer_interface.h"
|
#include "video_core/rasterizer_interface.h"
|
||||||
#include "video_core/renderer_base.h"
|
#include "video_core/renderer_base.h"
|
||||||
|
|
||||||
@ -87,7 +88,12 @@ protected:
|
|||||||
void Unregister(const T& object) {
|
void Unregister(const T& object) {
|
||||||
auto& rasterizer = Core::System::GetInstance().Renderer().Rasterizer();
|
auto& rasterizer = Core::System::GetInstance().Renderer().Rasterizer();
|
||||||
rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1);
|
rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1);
|
||||||
|
|
||||||
|
if (Settings::values.use_accurate_framebuffers) {
|
||||||
|
// Only flush if use_accurate_framebuffers is enabled, as it incurs a performance hit
|
||||||
object->Flush();
|
object->Flush();
|
||||||
|
}
|
||||||
|
|
||||||
object_cache.subtract({GetInterval(object), ObjectSet{object}});
|
object_cache.subtract({GetInterval(object), ObjectSet{object}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,7 +637,12 @@ void RasterizerOpenGL::FlushAll() {}
|
|||||||
|
|
||||||
void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {
|
void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) {
|
||||||
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
||||||
|
|
||||||
|
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);
|
res_cache.FlushRegion(addr, size);
|
||||||
|
}
|
||||||
|
|
||||||
shader_cache.FlushRegion(addr, size);
|
shader_cache.FlushRegion(addr, size);
|
||||||
buffer_cache.FlushRegion(addr, size);
|
buffer_cache.FlushRegion(addr, size);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user