3
0
Fork 0
forked from suyu/suyu

Garbage Collection: Make it more agressive on high priority mode.

This commit is contained in:
Fernando Sahmkow 2021-08-29 18:24:19 +02:00
parent ff48f06fb9
commit fe0acec539
3 changed files with 5 additions and 5 deletions

View file

@ -298,11 +298,11 @@ public:
} }
size_t getLRUID() const noexcept { size_t getLRUID() const noexcept {
return lru_id; return lru_id;
} }
void setLRUID(size_t lru_id_) { void setLRUID(size_t lru_id_) {
lru_id = lru_id_; lru_id = lru_id_;
} }
private: private:

View file

@ -78,7 +78,7 @@ class BufferCache {
static constexpr BufferId NULL_BUFFER_ID{0}; static constexpr BufferId NULL_BUFFER_ID{0};
static constexpr u64 EXPECTED_MEMORY = 256_MiB; static constexpr u64 EXPECTED_MEMORY = 512_MiB;
static constexpr u64 CRITICAL_MEMORY = 1_GiB; static constexpr u64 CRITICAL_MEMORY = 1_GiB;
using Maxwell = Tegra::Engines::Maxwell3D::Regs; using Maxwell = Tegra::Engines::Maxwell3D::Regs;

View file

@ -61,8 +61,8 @@ template <class P>
void TextureCache<P>::RunGarbageCollector() { void TextureCache<P>::RunGarbageCollector() {
const bool high_priority_mode = total_used_memory >= expected_memory; const bool high_priority_mode = total_used_memory >= expected_memory;
const bool aggressive_mode = total_used_memory >= critical_memory; const bool aggressive_mode = total_used_memory >= critical_memory;
const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 50ULL : 100ULL; const u64 ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 100ULL;
size_t num_iterations = aggressive_mode ? 10000 : (high_priority_mode ? 50 : 5); size_t num_iterations = aggressive_mode ? 10000 : (high_priority_mode ? 100 : 5);
const auto clean_up = [this, &num_iterations, high_priority_mode](ImageId image_id) { const auto clean_up = [this, &num_iterations, high_priority_mode](ImageId image_id) {
if (num_iterations == 0) { if (num_iterations == 0) {
return true; return true;