|
|
@ -238,7 +238,7 @@ public: |
|
|
surface->MarkAsRenderTarget(false, NO_RT); |
|
|
surface->MarkAsRenderTarget(false, NO_RT); |
|
|
const auto& cr_params = surface->GetSurfaceParams(); |
|
|
const auto& cr_params = surface->GetSurfaceParams(); |
|
|
if (!cr_params.is_tiled) { |
|
|
if (!cr_params.is_tiled) { |
|
|
FlushSurface(surface); |
|
|
|
|
|
|
|
|
AsyncFlushSurface(surface); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
render_targets[index].target = surface_view.first; |
|
|
render_targets[index].target = surface_view.first; |
|
|
@ -317,6 +317,26 @@ public: |
|
|
return ++ticks; |
|
|
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: |
|
|
protected: |
|
|
explicit TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
|
|
explicit TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer, |
|
|
bool is_astc_supported) |
|
|
bool is_astc_supported) |
|
|
@ -1152,6 +1172,13 @@ private: |
|
|
TView view; |
|
|
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; |
|
|
VideoCore::RasterizerInterface& rasterizer; |
|
|
|
|
|
|
|
|
FormatLookupTable format_lookup_table; |
|
|
FormatLookupTable format_lookup_table; |
|
|
@ -1198,6 +1225,9 @@ private: |
|
|
|
|
|
|
|
|
std::list<TSurface> marked_for_unregister; |
|
|
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; |
|
|
StagingCache staging_cache; |
|
|
std::recursive_mutex mutex; |
|
|
std::recursive_mutex mutex; |
|
|
}; |
|
|
}; |
|
|
|