Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 8083f11

Browse files
committed
[PAL] Skip extra calls to MakeResident
With the PAL_ALWAYS_RESIDENT flag memory objects are resident at allocation time, no need to make them resident again before submit. Also we should never evict anything with this setting, or we'll generate a VM fault. Change-Id: Ieacc6af88ab4e09c20efd94100e148b2502e1d70
1 parent 196ad3d commit 8083f11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

device/pal/palvirtual.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void VirtualGPU::Queue::addCmdDoppRef(Pal::IGpuMemory* iMem, bool lastDoppCmd, b
339339
}
340340

341341
bool VirtualGPU::Queue::flush() {
342-
if (palMemRefs_.size() != 0) {
342+
if (!gpu_.dev().settings().alwaysResident_ && palMemRefs_.size() != 0) {
343343
if (Pal::Result::Success !=
344344
iDev_->AddGpuMemoryReferences(palMemRefs_.size(), &palMemRefs_[0], iQueue_,
345345
Pal::GpuMemoryRefCantTrim)) {
@@ -450,7 +450,7 @@ bool VirtualGPU::Queue::flush() {
450450
}
451451
}
452452
}
453-
if (palMems_.size() != 0) {
453+
if (!gpu_.dev().settings().alwaysResident_ && palMems_.size() != 0) {
454454
iDev_->RemoveGpuMemoryReferences(palMems_.size(), &palMems_[0], iQueue_);
455455
palMems_.clear();
456456
}

0 commit comments

Comments
 (0)