diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-05-21 17:24:20 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:33 +0200 |
commit | bdf9faab331cd79ca5c5e51c2369fc801e8cecea (patch) | |
tree | 09b45767f5e9a72319db7b3184dc9b70120d4ea2 /src/video_core/texture_cache/texture_cache.h | |
parent | texture_cache: return null surface on invalid address (diff) | |
download | yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.gz yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.bz2 yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.lz yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.xz yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.tar.zst yuzu-bdf9faab331cd79ca5c5e51c2369fc801e8cecea.zip |
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 24c87127d..ab4e094ea 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -220,6 +220,7 @@ protected: SetEmptyColorBuffer(i); } SetEmptyDepthBuffer(); + staging_cache.SetSize(2); } ~TextureCache() = default; @@ -244,6 +245,8 @@ protected: gpu_addr); return; } + bool continuouty = memory_manager->IsBlockContinuous(gpu_addr, size); + surface->MarkAsContinuous(continuouty); surface->SetCacheAddr(cache_ptr); surface->SetCpuAddr(*cpu_addr); RegisterInnerCache(surface); @@ -611,9 +614,9 @@ private: } void LoadSurface(const TSurface& surface) { - staging_buffer.resize(surface->GetHostSizeInBytes()); - surface->LoadBuffer(*memory_manager, staging_buffer); - surface->UploadTexture(staging_buffer); + staging_cache.GetBuffer(0).resize(surface->GetHostSizeInBytes()); + surface->LoadBuffer(*memory_manager, staging_cache); + surface->UploadTexture(staging_cache.GetBuffer(0)); surface->MarkAsModified(false, Tick()); } @@ -621,9 +624,9 @@ private: if (!surface->IsModified()) { return; } - staging_buffer.resize(surface->GetHostSizeInBytes()); - surface->DownloadTexture(staging_buffer); - surface->FlushBuffer(*memory_manager, staging_buffer); + staging_cache.GetBuffer(0).resize(surface->GetHostSizeInBytes()); + surface->DownloadTexture(staging_cache.GetBuffer(0)); + surface->FlushBuffer(*memory_manager, staging_cache); surface->MarkAsModified(false, Tick()); } @@ -723,7 +726,7 @@ private: render_targets; FramebufferTargetInfo depth_buffer; - std::vector<u8> staging_buffer; + StagingCache staging_cache; std::recursive_mutex mutex; }; |