diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-08 16:32:30 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:12 +0200 |
commit | ba677ccb5a8ae0c889751fcdd40b0c9e818ad992 (patch) | |
tree | 79a5166a90d59fb0f00a88136697252fe42cb731 /src/video_core/texture_cache/texture_cache.h | |
parent | Fixes to mipmap's process and reconstruct process (diff) | |
download | yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar.gz yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar.bz2 yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar.lz yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar.xz yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.tar.zst yuzu-ba677ccb5a8ae0c889751fcdd40b0c9e818ad992.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 554b9a228..422bf3e58 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -61,6 +61,20 @@ public: } } + void FlushRegion(CacheAddr addr, std::size_t size) { + auto surfaces = GetSurfacesInRegion(addr, size); + if (surfaces.empty()) { + return; + } + std::sort(surfaces.begin(), surfaces.end(), + [](const TSurface& a, const TSurface& b) -> bool { + return a->GetModificationTick() < b->GetModificationTick(); + }); + for (const auto& surface : surfaces) { + FlushSurface(surface); + } + } + TView GetTextureSurface(const Tegra::Texture::FullTextureInfo& config, const VideoCommon::Shader::Sampler& entry) { const auto gpu_addr{config.tic.Address()}; |