faster texture cache loading in low fps modes

This commit is contained in:
2024-02-05 12:50:36 +01:00
parent 7d0e5c80bd
commit 139db5b03b
7 changed files with 26 additions and 12 deletions

View File

@@ -162,8 +162,10 @@ struct TextureCache {
}
}
void workLoadQueue(void) {
for (auto it = _to_load.begin(); it != _to_load.end(); it++) {
// returns true if there is still work queued up
bool workLoadQueue(void) {
auto it = _to_load.begin();
for (; it != _to_load.end(); it++) {
auto new_entry_opt = _l.load(_tu, *it);
if (new_entry_opt.has_value()) {
_cache.emplace(*it, new_entry_opt.value());
@@ -172,6 +174,10 @@ struct TextureCache {
break; // end load from queue/onlyload 1 per update
}
}
it++;
return it != _to_load.end();
}
};