diff options
author | bunnei <bunneidev@gmail.com> | 2020-06-27 01:02:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 01:02:39 +0200 |
commit | 3579db425e3f7af8bf1283dc7fc35593f80a50aa (patch) | |
tree | a5c17c834634f408034bffbc8eec8e235276641b | |
parent | Merge pull request #4111 from ReinUsesLisp/preserve-contents-vk (diff) | |
parent | TextureCache: Fix case where layer goes off bound. (diff) | |
download | yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar.gz yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar.bz2 yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar.lz yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar.xz yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.tar.zst yuzu-3579db425e3f7af8bf1283dc7fc35593f80a50aa.zip |
-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); |