diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-14 03:35:32 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:12 +0200 |
commit | 4530511ee4dfc92ddbfed7f91978f332be517c90 (patch) | |
tree | 79a1845ecbf918642c9255d5a66681d2b511f6bb /src/video_core/texture_cache/texture_cache.h | |
parent | texture_cache: Implement Guard mechanism (diff) | |
download | yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.gz yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.bz2 yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.lz yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.xz yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.tar.zst yuzu-4530511ee4dfc92ddbfed7f91978f332be517c90.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 2ad6210dd..38b56475f 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -295,6 +295,9 @@ private: RecycleStrategy PickStrategy(std::vector<TSurface>& overlaps, const SurfaceParams& params, const GPUVAddr gpu_addr, const bool untopological) { + if (Settings::values.use_accurate_gpu_emulation) { + return RecycleStrategy::Flush; + } // 3D Textures decision if (params.block_depth > 1 || params.target == SurfaceTarget::Texture3D) { return RecycleStrategy::Flush; @@ -319,10 +322,7 @@ private: for (auto surface : overlaps) { Unregister(surface); } - RecycleStrategy strategy = !Settings::values.use_accurate_gpu_emulation - ? PickStrategy(overlaps, params, gpu_addr, untopological) - : RecycleStrategy::Flush; - switch (strategy) { + switch (PickStrategy(overlaps, params, gpu_addr, untopological)) { case RecycleStrategy::Ignore: { return InitializeSurface(gpu_addr, params, preserve_contents); } @@ -453,6 +453,13 @@ private: if (overlaps.size() == 1) { TSurface current_surface = overlaps[0]; if (!current_surface->IsInside(gpu_addr, gpu_addr + candidate_size)) { + if (current_surface->GetGpuAddr() == gpu_addr) { + std::optional<std::pair<TSurface, TView>> view = + ReconstructSurface(overlaps, params, gpu_addr, host_ptr); + if (view.has_value()) { + return *view; + } + } return RecycleSurface(overlaps, params, gpu_addr, preserve_contents, false); } std::optional<TView> view = |