diff options
author | Lioncash <mathew1800@gmail.com> | 2019-02-12 22:46:37 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-02-12 22:46:39 +0100 |
commit | e25c464c02abc344e79174c5c4f5a9e6dab3c915 (patch) | |
tree | ea52270b40c5b05cf6b48e88a938937d4f60c434 /src/video_core | |
parent | Merge pull request #1904 from bunnei/better-fermi-copy (diff) | |
download | yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.gz yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.bz2 yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.lz yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.xz yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.zst yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index b81882d04..16cda568b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -169,20 +169,28 @@ struct SurfaceParams { } u32 MipBlockDepth(u32 mip_level) const { - if (mip_level == 0) + if (mip_level == 0) { return block_depth; - if (is_layered) + } + + if (is_layered) { return 1; - u32 depth = MipDepth(mip_level); + } + + const u32 mip_depth = MipDepth(mip_level); u32 bd = 32; - while (bd > 1 && depth * 2 <= bd) { + while (bd > 1 && mip_depth * 2 <= bd) { bd >>= 1; } + if (bd == 32) { - u32 bh = MipBlockHeight(mip_level); - if (bh >= 4) + const u32 bh = MipBlockHeight(mip_level); + + if (bh >= 4) { return 16; + } } + return bd; } |