summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-02-15 03:45:20 +0100
committerGitHub <noreply@github.com>2019-02-15 03:45:20 +0100
commit4327f430f1a4bb33024c13592f229db27bc884b0 (patch)
tree77ba686371f105fb0d7d63ac29e5b88da07bdf90
parentMerge pull request #2111 from ReinUsesLisp/fetch-fix (diff)
parentgl_rasterizer_cache: Remove unnecessary newline (diff)
downloadyuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar.gz
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar.bz2
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar.lz
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar.xz
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.tar.zst
yuzu-4327f430f1a4bb33024c13592f229db27bc884b0.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h20
1 files changed, 13 insertions, 7 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..89d733c50 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -36,7 +36,6 @@ using PixelFormat = VideoCore::Surface::PixelFormat;
using ComponentType = VideoCore::Surface::ComponentType;
struct SurfaceParams {
-
enum class SurfaceClass {
Uploaded,
RenderTarget,
@@ -169,20 +168,27 @@ 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;
}