diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-28 03:35:15 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-08-31 19:07:27 +0200 |
commit | d647d9550c838fdfb16ad053f3ff243de3e15482 (patch) | |
tree | 8bde428c4c670d134dd13b849044e4369566d8f9 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | gl_rasterizer: Fix issues with the rasterizer cache. (diff) | |
download | yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar.gz yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar.bz2 yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar.lz yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar.xz yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.tar.zst yuzu-d647d9550c838fdfb16ad053f3ff243de3e15482.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e70e22ba2..cab6cf53e 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -279,10 +279,9 @@ static constexpr auto RangeFromInterval(Map& map, const Interval& interval) { return boost::make_iterator_range(map.equal_range(interval)); } -void RasterizerOpenGL::UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, int delta) { - const u64 page_start{addr >> Tegra::MemoryManager::PAGE_BITS}; - const u64 page_end{(addr + size + Tegra::MemoryManager::PAGE_SIZE - 1) >> - Tegra::MemoryManager::PAGE_BITS}; +void RasterizerOpenGL::UpdatePagesCachedCount(VAddr addr, u64 size, int delta) { + const u64 page_start{addr >> Memory::PAGE_BITS}; + const u64 page_end{(addr + size + Memory::PAGE_SIZE - 1) >> Memory::PAGE_BITS}; // Interval maps will erase segments if count reaches 0, so if delta is negative we have to // subtract after iterating @@ -294,10 +293,8 @@ void RasterizerOpenGL::UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, in const auto interval = pair.first & pages_interval; const int count = pair.second; - const Tegra::GPUVAddr interval_start_addr = boost::icl::first(interval) - << Tegra::MemoryManager::PAGE_BITS; - const Tegra::GPUVAddr interval_end_addr = boost::icl::last_next(interval) - << Tegra::MemoryManager::PAGE_BITS; + const VAddr interval_start_addr = boost::icl::first(interval) << Memory::PAGE_BITS; + const VAddr interval_end_addr = boost::icl::last_next(interval) << Memory::PAGE_BITS; const u64 interval_size = interval_end_addr - interval_start_addr; if (delta > 0 && count == delta) @@ -578,17 +575,17 @@ void RasterizerOpenGL::FlushAll() { MICROPROFILE_SCOPE(OpenGL_CacheManagement); } -void RasterizerOpenGL::FlushRegion(Tegra::GPUVAddr addr, u64 size) { +void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) { MICROPROFILE_SCOPE(OpenGL_CacheManagement); } -void RasterizerOpenGL::InvalidateRegion(Tegra::GPUVAddr addr, u64 size) { +void RasterizerOpenGL::InvalidateRegion(VAddr addr, u64 size) { MICROPROFILE_SCOPE(OpenGL_CacheManagement); res_cache.InvalidateRegion(addr, size); shader_cache.InvalidateRegion(addr, size); } -void RasterizerOpenGL::FlushAndInvalidateRegion(Tegra::GPUVAddr addr, u64 size) { +void RasterizerOpenGL::FlushAndInvalidateRegion(VAddr addr, u64 size) { MICROPROFILE_SCOPE(OpenGL_CacheManagement); InvalidateRegion(addr, size); } |