diff options
| author | 2020-02-17 18:10:23 -0400 | |
|---|---|---|
| committer | 2020-04-22 11:36:10 -0400 | |
| commit | 487379c593bcaf3787ede187c5d44f7923b54dc9 (patch) | |
| tree | b66c5c541a55be6d4b76b78c07be11731a7cb400 /src/video_core/texture_cache | |
| parent | TextureCache: Flush linear textures after finishing rendering. (diff) | |
| download | yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.gz yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.tar.xz yuzu-487379c593bcaf3787ede187c5d44f7923b54dc9.zip | |
OpenGL: Implement Fencing backend.
Diffstat (limited to 'src/video_core/texture_cache')
| -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: | |||
| 238 | surface->MarkAsRenderTarget(false, NO_RT); | 238 | surface->MarkAsRenderTarget(false, NO_RT); |
| 239 | const auto& cr_params = surface->GetSurfaceParams(); | 239 | const auto& cr_params = surface->GetSurfaceParams(); |
| 240 | if (!cr_params.is_tiled) { | 240 | if (!cr_params.is_tiled) { |
| 241 | FlushSurface(surface); | 241 | AsyncFlushSurface(surface); |
| 242 | } | 242 | } |
| 243 | } | 243 | } |
| 244 | render_targets[index].target = surface_view.first; | 244 | render_targets[index].target = surface_view.first; |
| @@ -317,6 +317,26 @@ public: | |||
| 317 | return ++ticks; | 317 | return ++ticks; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | void CommitAsyncFlushes() { | ||
| 321 | commited_flushes.push_back(uncommited_flushes); | ||
| 322 | uncommited_flushes.reset(); | ||
| 323 | } | ||
| 324 | |||
| 325 | void PopAsyncFlushes() { | ||
| 326 | if (commited_flushes.empty()) { | ||
| 327 | return; | ||
| 328 | } | ||
| 329 | auto& flush_list = commited_flushes.front(); | ||
| 330 | if (!flush_list) { | ||
| 331 | commited_flushes.pop_front(); | ||
| 332 | return; | ||
| 333 | } | ||
| 334 | for (TSurface& surface : *flush_list) { | ||
| 335 | FlushSurface(surface); | ||
| 336 | } | ||
| 337 | commited_flushes.pop_front(); | ||
| 338 | } | ||
| 339 | |||
| 320 | protected: | 340 | protected: |
| 321 | explicit TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, | 341 | explicit TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
| 322 | bool is_astc_supported) | 342 | bool is_astc_supported) |
| @@ -1152,6 +1172,13 @@ private: | |||
| 1152 | TView view; | 1172 | TView view; |
| 1153 | }; | 1173 | }; |
| 1154 | 1174 | ||
| 1175 | void AsyncFlushSurface(TSurface& surface) { | ||
| 1176 | if (!uncommited_flushes) { | ||
| 1177 | uncommited_flushes = std::make_shared<std::list<TSurface>>(); | ||
| 1178 | } | ||
| 1179 | uncommited_flushes->push_back(surface); | ||
| 1180 | } | ||
| 1181 | |||
| 1155 | VideoCore::RasterizerInterface& rasterizer; | 1182 | VideoCore::RasterizerInterface& rasterizer; |
| 1156 | 1183 | ||
| 1157 | FormatLookupTable format_lookup_table; | 1184 | FormatLookupTable format_lookup_table; |
| @@ -1198,6 +1225,9 @@ private: | |||
| 1198 | 1225 | ||
| 1199 | std::list<TSurface> marked_for_unregister; | 1226 | std::list<TSurface> marked_for_unregister; |
| 1200 | 1227 | ||
| 1228 | std::shared_ptr<std::list<TSurface>> uncommited_flushes{}; | ||
| 1229 | std::list<std::shared_ptr<std::list<TSurface>>> commited_flushes; | ||
| 1230 | |||
| 1201 | StagingCache staging_cache; | 1231 | StagingCache staging_cache; |
| 1202 | std::recursive_mutex mutex; | 1232 | std::recursive_mutex mutex; |
| 1203 | }; | 1233 | }; |