Allow Attempted Eviction When The Residency LRU Is Empty

Removes an assert when attempting to evict the residency LRU while
empty.

Bug: dawn:415
Change-Id: If346d0f2cc28ec089871b3c5aaf8f5641344f9fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22023
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
This commit is contained in:
Brandon Jones 2020-05-26 19:40:23 +00:00 committed by Commit Bot service account
parent 31c9c6949e
commit e370ec6de4
1 changed files with 8 additions and 1 deletions

View File

@ -146,7 +146,14 @@ namespace dawn_native { namespace d3d12 {
// nullptr when nothing further can be evicted.
ResultOrError<Pageable*> ResidencyManager::RemoveSingleEntryFromLRU(
MemorySegmentInfo* memorySegment) {
ASSERT(!memorySegment->lruCache.empty());
// If the LRU is empty, return nullptr to allow execution to continue. Note that fully
// emptying the LRU is undesirable, because it can mean either 1) the LRU is not accurately
// accounting for Dawn's GPU allocations, or 2) a component external to Dawn is using all of
// the process budget and starving Dawn, which will cause thrash.
if (memorySegment->lruCache.empty()) {
return nullptr;
}
Pageable* pageable = memorySegment->lruCache.head()->value();
Serial lastSubmissionSerial = pageable->GetLastSubmission();