summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/texture_cache/surface_base.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h
index 1bed82898..5f79bb0aa 100644
--- a/src/video_core/texture_cache/surface_base.h
+++ b/src/video_core/texture_cache/surface_base.h
@@ -254,16 +254,14 @@ public:
254 if (!layer_mipmap) { 254 if (!layer_mipmap) {
255 return {}; 255 return {};
256 } 256 }
257 const u32 end_layer{layer_mipmap->first}; 257 const auto [end_layer, end_mipmap] = *layer_mipmap;
258 const u32 end_mipmap{layer_mipmap->second};
259 if (layer != end_layer) { 258 if (layer != end_layer) {
260 if (mipmap == 0 && end_mipmap == 0) { 259 if (mipmap == 0 && end_mipmap == 0) {
261 return GetView(ViewParams(view_params.target, layer, end_layer - layer + 1, 0, 1)); 260 return GetView(ViewParams(view_params.target, layer, end_layer - layer, 0, 1));
262 } 261 }
263 return {}; 262 return {};
264 } else { 263 } else {
265 return GetView( 264 return GetView(ViewParams(view_params.target, layer, 1, mipmap, end_mipmap - mipmap));
266 ViewParams(view_params.target, layer, 1, mipmap, end_mipmap - mipmap + 1));
267 } 265 }
268 } 266 }
269 267
@@ -278,8 +276,7 @@ public:
278 if (!layer_mipmap) { 276 if (!layer_mipmap) {
279 return {}; 277 return {};
280 } 278 }
281 const u32 layer{layer_mipmap->first}; 279 const auto [layer, mipmap] = *layer_mipmap;
282 const u32 mipmap{layer_mipmap->second};
283 if (GetMipmapSize(mipmap) != candidate_size) { 280 if (GetMipmapSize(mipmap) != candidate_size) {
284 return EmplaceIrregularView(view_params, view_addr, candidate_size, mipmap, layer); 281 return EmplaceIrregularView(view_params, view_addr, candidate_size, mipmap, layer);
285 } 282 }