| 20 | } |
| 21 | |
| 22 | void RefreshCacheSection::OnShow(IMenuContainer* root) |
| 23 | { |
| 24 | MenuSection::OnShow(root); |
| 25 | |
| 26 | #if defined(WITH_THREADS) |
| 27 | _thread = Thread([](void* arg) { |
| 28 | auto _this = static_cast<RefreshCacheSection*>(arg); |
| 29 | if (auto mainMenu = runtime_cast<MainMenu>(_this->_root)) { |
| 30 | mainMenu->_root->RefreshCacheLevels(true); |
| 31 | } |
| 32 | |
| 33 | std::uint32_t filesRemoved = RenderResources::GetBinaryShaderCache().Prune(); |
| 34 | LOGI("Pruning binary shader cache (removed {} directories)...", filesRemoved); |
| 35 | |
| 36 | _this->_done = true; |
| 37 | }, this); |
| 38 | #else |
| 39 | if (auto mainMenu = runtime_cast<MainMenu*>(_root)) { |
| 40 | mainMenu->_root->RefreshCacheLevels(true); |
| 41 | } |
| 42 | |
| 43 | std::uint32_t filesRemoved = RenderResources::binaryShaderCache().Prune(); |
| 44 | LOGI("Pruning binary shader cache (removed {} directories)...", filesRemoved); |
| 45 | |
| 46 | _done = true; |
| 47 | #endif |
| 48 | } |
| 49 | |
| 50 | void RefreshCacheSection::OnUpdate(float timeMult) |
| 51 | { |
nothing calls this directly
no test coverage detected