Browse Source
Merge pull request #4144 from FernandoS27/tt-fix
TextureCache: Fix case where layer goes off bound.
pull/15/merge
bunnei
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
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 relative_address{static_cast<GPUVAddr>(candidate_gpu_addr - gpu_addr)}; |
|
|
const auto layer{static_cast<u32>(relative_address / layer_size)}; |
|
|
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 GPUVAddr mipmap_address = relative_address - layer_size * layer; |
|
|
const auto mipmap_it = |
|
|
const auto mipmap_it = |
|
|
Common::BinaryFind(mipmap_offsets.begin(), mipmap_offsets.end(), mipmap_address); |
|
|
Common::BinaryFind(mipmap_offsets.begin(), mipmap_offsets.end(), mipmap_address); |
|
|
|