summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-02-12 16:46:37 -0500
committerGravatar Lioncash2019-02-12 16:46:39 -0500
commite25c464c02abc344e79174c5c4f5a9e6dab3c915 (patch)
treeea52270b40c5b05cf6b48e88a938937d4f60c434
parentMerge pull request #1904 from bunnei/better-fermi-copy (diff)
downloadyuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.gz
yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.tar.xz
yuzu-e25c464c02abc344e79174c5c4f5a9e6dab3c915.zip
gl_rasterizer_cache: Get rid of variable shadowing
Avoids shadowing the members of the struct itself, which results in a -Wshadow warning.
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h20
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 {
169 } 169 }
170 170
171 u32 MipBlockDepth(u32 mip_level) const { 171 u32 MipBlockDepth(u32 mip_level) const {
172 if (mip_level == 0) 172 if (mip_level == 0) {
173 return block_depth; 173 return block_depth;
174 if (is_layered) 174 }
175
176 if (is_layered) {
175 return 1; 177 return 1;
176 u32 depth = MipDepth(mip_level); 178 }
179
180 const u32 mip_depth = MipDepth(mip_level);
177 u32 bd = 32; 181 u32 bd = 32;
178 while (bd > 1 && depth * 2 <= bd) { 182 while (bd > 1 && mip_depth * 2 <= bd) {
179 bd >>= 1; 183 bd >>= 1;
180 } 184 }
185
181 if (bd == 32) { 186 if (bd == 32) {
182 u32 bh = MipBlockHeight(mip_level); 187 const u32 bh = MipBlockHeight(mip_level);
183 if (bh >= 4) 188
189 if (bh >= 4) {
184 return 16; 190 return 16;
191 }
185 } 192 }
193
186 return bd; 194 return bd;
187 } 195 }
188 196