summaryrefslogtreecommitdiffstats
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-16 18:29:53 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-04-22 17:36:24 +0200
commitf616dc0b591b783b3fb75ca89633f1c26cce05a9 (patch)
tree43a9c2052c5ceaad8cf6a69173b0817e54cc8f42 /src/video_core/texture_cache
parentFix GCC error. (diff)
downloadyuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar.gz
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar.bz2
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar.lz
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar.xz
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.tar.zst
yuzu-f616dc0b591b783b3fb75ca89633f1c26cce05a9.zip
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index f3ca1ffd1..1148c3a34 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -120,15 +120,8 @@ public:
std::lock_guard lock{mutex};
auto surfaces = GetSurfacesInRegion(addr, size);
- if (surfaces.empty()) {
- return false;
- }
- for (const auto& surface : surfaces) {
- if (surface->IsModified()) {
- return true;
- }
- }
- return false;
+ return std::any_of(surfaces.begin(), surfaces.end(),
+ [](const TSurface& surface) { return surface->IsModified(); });
}
TView GetTextureSurface(const Tegra::Texture::TICEntry& tic,
@@ -333,41 +326,34 @@ public:
}
void CommitAsyncFlushes() {
- commited_flushes.push_back(uncommited_flushes);
- uncommited_flushes.reset();
+ committed_flushes.push_back(uncommitted_flushes);
+ uncommitted_flushes.reset();
}
- bool HasUncommitedFlushes() {
- if (uncommited_flushes) {
- return true;
- }
- return false;
+ bool HasUncommittedFlushes() const {
+ return uncommitted_flushes != nullptr;
}
- bool ShouldWaitAsyncFlushes() {
- if (commited_flushes.empty()) {
- return false;
- }
- auto& flush_list = commited_flushes.front();
- if (!flush_list) {
+ bool ShouldWaitAsyncFlushes() const {
+ if (committed_flushes.empty()) {
return false;
}
- return true;
+ return committed_flushes.front() != nullptr;
}
void PopAsyncFlushes() {
- if (commited_flushes.empty()) {
+ if (committed_flushes.empty()) {
return;
}
- auto& flush_list = commited_flushes.front();
+ auto& flush_list = committed_flushes.front();
if (!flush_list) {
- commited_flushes.pop_front();
+ committed_flushes.pop_front();
return;
}
for (TSurface& surface : *flush_list) {
FlushSurface(surface);
}
- commited_flushes.pop_front();
+ committed_flushes.pop_front();
}
protected:
@@ -1206,10 +1192,10 @@ private:
};
void AsyncFlushSurface(TSurface& surface) {
- if (!uncommited_flushes) {
- uncommited_flushes = std::make_shared<std::list<TSurface>>();
+ if (!uncommitted_flushes) {
+ uncommitted_flushes = std::make_shared<std::list<TSurface>>();
}
- uncommited_flushes->push_back(surface);
+ uncommitted_flushes->push_back(surface);
}
VideoCore::RasterizerInterface& rasterizer;
@@ -1258,8 +1244,8 @@ 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;
+ std::shared_ptr<std::list<TSurface>> uncommitted_flushes{};
+ std::list<std::shared_ptr<std::list<TSurface>>> committed_flushes;
StagingCache staging_cache;
std::recursive_mutex mutex;