summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache/texture_cache.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-02-17 23:10:23 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-22 17:36:10 +0200
commit487379c593bcaf3787ede187c5d44f7923b54dc9 (patch)
treeb66c5c541a55be6d4b76b78c07be11731a7cb400 /src/video_core/texture_cache/texture_cache.h
parentTextureCache: Flush linear textures after finishing rendering. (diff)
downloadyuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.gz
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.bz2
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.lz
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.xz
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.zst
yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/texture_cache/texture_cache.h32
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;
};