diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-22 17:29:55 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-22 17:37:40 +0200 |
commit | 544b15e8e415d56b415189717805a88b2e5dc06f (patch) | |
tree | 9bc5db83f4ec4c13d73ab293fb6371d2687d0e98 /src/video_core/texture_cache/surface_base.cpp | |
parent | Merge pull request #4110 from ReinUsesLisp/direct-upload-sets (diff) | |
download | yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar.gz yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar.bz2 yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar.lz yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar.xz yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.tar.zst yuzu-544b15e8e415d56b415189717805a88b2e5dc06f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/surface_base.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp index 94d3a6ae5..0caf3b4f0 100644 --- a/src/video_core/texture_cache/surface_base.cpp +++ b/src/video_core/texture_cache/surface_base.cpp @@ -120,6 +120,9 @@ std::optional<std::pair<u32, u32>> SurfaceBaseImpl::GetLayerMipmap( } const auto relative_address{static_cast<GPUVAddr>(candidate_gpu_addr - gpu_addr)}; const auto layer{static_cast<u32>(relative_address / layer_size)}; + if (layer >= params.depth) { + return {}; + } const GPUVAddr mipmap_address = relative_address - layer_size * layer; const auto mipmap_it = Common::BinaryFind(mipmap_offsets.begin(), mipmap_offsets.end(), mipmap_address); |