gl_rasterizer: Skip zero addr/sized regions on flush/invalidate.

master
bunnei 2019-02-27 21:21:31 +07:00
parent 2392e146b0
commit 032e4c4ca3
1 changed files with 6 additions and 0 deletions

@ -749,11 +749,17 @@ void RasterizerOpenGL::FlushAll() {}
void RasterizerOpenGL::FlushRegion(CacheAddr addr, u64 size) { void RasterizerOpenGL::FlushRegion(CacheAddr addr, u64 size) {
MICROPROFILE_SCOPE(OpenGL_CacheManagement); MICROPROFILE_SCOPE(OpenGL_CacheManagement);
if (!addr || !size) {
return;
}
res_cache.FlushRegion(addr, size); res_cache.FlushRegion(addr, size);
} }
void RasterizerOpenGL::InvalidateRegion(CacheAddr addr, u64 size) { void RasterizerOpenGL::InvalidateRegion(CacheAddr addr, u64 size) {
MICROPROFILE_SCOPE(OpenGL_CacheManagement); MICROPROFILE_SCOPE(OpenGL_CacheManagement);
if (!addr || !size) {
return;
}
res_cache.InvalidateRegion(addr, size); res_cache.InvalidateRegion(addr, size);
shader_cache.InvalidateRegion(addr, size); shader_cache.InvalidateRegion(addr, size);
global_cache.InvalidateRegion(addr, size); global_cache.InvalidateRegion(addr, size);