From e25c464c02abc344e79174c5c4f5a9e6dab3c915 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 12 Feb 2019 16:46:37 -0500 Subject: gl_rasterizer_cache: Get rid of variable shadowing Avoids shadowing the members of the struct itself, which results in a -Wshadow warning. --- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/video_core') 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; } -- cgit v1.2.3 From 054e39647c485e46e442cc9c9baa7f1d7c386326 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 12 Feb 2019 16:48:30 -0500 Subject: gl_rasterizer_cache: Remove unnecessary newline --- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 16cda568b..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, @@ -185,7 +184,6 @@ struct SurfaceParams { if (bd == 32) { const u32 bh = MipBlockHeight(mip_level); - if (bh >= 4) { return 16; } -- cgit v1.2.3