Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,14 @@ namespace gpgmm::d3d12 {
newDescriptor.Flags |= ALLOCATOR_FLAG_DISABLE_UNIFIED_MEMORY;
}

if (!(allocatorDescriptor.Flags & ALLOCATOR_FLAG_ALWAYS_RESIDENT) &&
!caps->IsCreateHeapNotResidentSupported()) {
DebugLog(MessageId::kInvalidArgument)
<< "ALLOCATOR_FLAG_ALWAYS_RESIDENT was not requested but enabled "
"anyway because the device did not support creation of non-resident heaps.";
newDescriptor.Flags |= ALLOCATOR_FLAG_ALWAYS_RESIDENT;
}

// Resource heap tier is required but user didn't specify one.
if (newDescriptor.ResourceHeapTier == 0) {
newDescriptor.ResourceHeapTier = caps->GetMaxResourceHeapTierSupported();
Expand Down Expand Up @@ -1617,8 +1625,7 @@ namespace gpgmm::d3d12 {
}

bool ResourceAllocator::IsCreateHeapNotResident() const {
return IsResidencyEnabled() && mCaps->IsCreateHeapNotResidentSupported() &&
!mIsAlwaysCreateResident;
return IsResidencyEnabled() && !mIsAlwaysCreateResident;
}

bool ResourceAllocator::IsResidencyEnabled() const {
Expand Down