diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-30 01:10:58 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-30 01:10:58 +0200 |
commit | dd70e097ccb84b64983456759525d650d1ceab0a (patch) | |
tree | e9c95eb5cba196ccc32c30fae769e4be7def0614 /src/video_core/texture_cache/texture_cache.h | |
parent | texture_cache: Handle overlaps with multiple subresources (diff) | |
download | yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar.gz yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar.bz2 yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar.lz yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar.xz yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.tar.zst yuzu-dd70e097ccb84b64983456759525d650d1ceab0a.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 658264860..62206b906 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -660,6 +660,15 @@ private: std::size_t passed_tests = 0; bool modified = false; + u32 num_resources = 0; + for (auto& surface : overlaps) { + const SurfaceParams& src_params = surface->GetSurfaceParams(); + num_resources += src_params.depth * src_params.num_levels; + } + if (num_resources != params.depth * params.num_levels) { + LoadSurface(new_surface); + } + for (auto& surface : overlaps) { const SurfaceParams& src_params = surface->GetSurfaceParams(); const auto mipmap_layer{new_surface->GetLayerMipmap(surface->GetGpuAddr())}; |