|
|
@ -133,9 +133,8 @@ void TextureCache<P>::RunGarbageCollector() { |
|
|
if (True(image.flags & ImageFlagBits::IsDecoding)) { |
|
|
if (True(image.flags & ImageFlagBits::IsDecoding)) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
const bool is_large_sparse = image.info.is_sparse && image.guest_size_bytes >= 256_MiB; |
|
|
|
|
|
const bool must_download = image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); |
|
|
const bool must_download = image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); |
|
|
if (must_download && !is_large_sparse) { |
|
|
|
|
|
|
|
|
if (must_download && !image.info.is_sparse) { |
|
|
auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); |
|
|
auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); |
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
const auto copies = FixSmallVectorADL(FullDownloadCopies(image.info)); |
|
|
image.DownloadMemory(map, copies); |
|
|
image.DownloadMemory(map, copies); |
|
|
@ -146,7 +145,7 @@ void TextureCache<P>::RunGarbageCollector() { |
|
|
UntrackImage(image, image_id); |
|
|
UntrackImage(image, image_id); |
|
|
} |
|
|
} |
|
|
UnregisterImage(image_id); |
|
|
UnregisterImage(image_id); |
|
|
DeleteImage(image_id, image.scale_tick > frame_tick + 10); |
|
|
|
|
|
|
|
|
DeleteImage(image_id, image.scale_tick > frame_tick + 10 || aggressive_mode || (high_priority_mode && image.info.is_sparse)); |
|
|
if (aggressive_mode && total_used_memory < critical_memory) { |
|
|
if (aggressive_mode && total_used_memory < critical_memory) { |
|
|
num_iterations >>= 2; |
|
|
num_iterations >>= 2; |
|
|
aggressive_mode = false; |
|
|
aggressive_mode = false; |
|
|
|