diff options
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index d8c8390bb..6629c59ed 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -238,7 +238,7 @@ public: surface->MarkAsRenderTarget(false, NO_RT); const auto& cr_params = surface->GetSurfaceParams(); if (!cr_params.is_tiled) { - FlushSurface(surface); + AsyncFlushSurface(surface); } } render_targets[index].target = surface_view.first; @@ -317,6 +317,26 @@ public: return ++ticks; } + void CommitAsyncFlushes() { + commited_flushes.push_back(uncommited_flushes); + uncommited_flushes.reset(); + } + + void PopAsyncFlushes() { + if (commited_flushes.empty()) { + return; + } + auto& flush_list = commited_flushes.front(); + if (!flush_list) { + commited_flushes.pop_front(); + return; + } + for (TSurface& surface : *flush_list) { + FlushSurface(surface); + } + commited_flushes.pop_front(); + } + protected: explicit TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, bool is_astc_supported) @@ -1152,6 +1172,13 @@ private: TView view; }; + void AsyncFlushSurface(TSurface& surface) { + if (!uncommited_flushes) { + uncommited_flushes = std::make_shared<std::list<TSurface>>(); + } + uncommited_flushes->push_back(surface); + } + VideoCore::RasterizerInterface& rasterizer; FormatLookupTable format_lookup_table; @@ -1198,6 +1225,9 @@ private: std::list<TSurface> marked_for_unregister; + std::shared_ptr<std::list<TSurface>> uncommited_flushes{}; + std::list<std::shared_ptr<std::list<TSurface>>> commited_flushes; + StagingCache staging_cache; std::recursive_mutex mutex; }; |
