diff --git a/include/gpgmm_d3d12.h b/include/gpgmm_d3d12.h index 3fd09a75..f1a7c21e 100644 --- a/include/gpgmm_d3d12.h +++ b/include/gpgmm_d3d12.h @@ -401,14 +401,14 @@ namespace gpgmm::d3d12 { /** \brief Disables all option flags. */ - RESIDENCY_FLAG_NONE = 0x0, + RESIDENCY_MANAGER_FLAG_NONE = 0x0, /** \brief Allow background budget updates from OS notifications. By default, budget updates will be queried by the residency manager instead of pushed by OS notifications using a background thread. */ - RESIDENCY_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES = 0x1, + RESIDENCY_MANAGER_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES = 0x1, /** \brief Specifies if unified memory architecture (UMA) is always disabled. @@ -417,14 +417,14 @@ namespace gpgmm::d3d12 { Otherwise, the residency manager will have two budgets for local and non-local memory segments, respectively. */ - RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY = 0x2, + RESIDENCY_MANAGER_FLAG_DISABLE_UNIFIED_MEMORY = 0x2, /** \brief Requires heaps to be in budget or E_OUTOFMEMORY. With this flag, heaps created for this residency manager will effectively never - specify D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET. + specify D3D12_RESIDENCY_MANAGER_FLAG_DENY_OVERBUDGET. */ - RESIDENCY_FLAG_ALWAYS_IN_BUDGET = 0x4, + RESIDENCY_MANAGER_FLAG_ALWAYS_IN_BUDGET = 0x4, }; DEFINE_ENUM_FLAG_OPERATORS(RESIDENCY_MANAGER_FLAGS) @@ -435,7 +435,7 @@ namespace gpgmm::d3d12 { struct RESIDENCY_MANAGER_DESC { /** \brief Specifies residency options. - Optional parameter. By default, no flags are specified or RESIDENCY_FLAG_NONE. + Optional parameter. By default, no flags are specified or RESIDENCY_MANAGER_FLAG_NONE. */ RESIDENCY_MANAGER_FLAGS Flags; @@ -765,7 +765,7 @@ namespace gpgmm::d3d12 { /** \brief Disables all option flags. */ - ALLOCATOR_FLAG_NONE = 0x0, + RESOURCE_ALLOCATOR_FLAG_NONE = 0x0, /** \brief Disable re-use of resource heap. diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp index 6e676c3e..8ef5ba65 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp @@ -62,9 +62,10 @@ namespace gpgmm::d3d12 { caps.reset(ptr); } - if ((descriptor.Flags & RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY) && caps->IsAdapterUMA()) { + if ((descriptor.Flags & RESIDENCY_MANAGER_FLAG_DISABLE_UNIFIED_MEMORY) && + caps->IsAdapterUMA()) { WarnLog(MessageId::kInvalidArgument, true) - << "RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY flag was specified but " + << "RESIDENCY_MANAGER_FLAG_DISABLE_UNIFIED_MEMORY flag was specified but " "did not match the architecture of the adapter."; } @@ -88,10 +89,11 @@ namespace gpgmm::d3d12 { new ResidencyManager(descriptor, pDevice, pAdapter, std::move(caps))); // Enable automatic video memory budget updates. - if (descriptor.Flags & RESIDENCY_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES) { + if (descriptor.Flags & RESIDENCY_MANAGER_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES) { if (FAILED(residencyManager->StartBudgetNotificationUpdates())) { WarnLog(residencyManager.get(), MessageId::kBudgetUpdated) - << "RESIDENCY_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES was requested but failed to " + << "RESIDENCY_MANAGER_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES was requested but " + "failed to " "start."; } } @@ -169,11 +171,11 @@ namespace gpgmm::d3d12 { mEvictSizeInBytes(descriptor.EvictSizeInBytes == 0 ? kDefaultEvictSizeInBytes : descriptor.EvictSizeInBytes), mIsUMA(caps->IsAdapterUMA() && - !(descriptor.Flags & RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY)), + !(descriptor.Flags & RESIDENCY_MANAGER_FLAG_DISABLE_UNIFIED_MEMORY)), mFlushEventBuffersOnDestruct(descriptor.RecordOptions.EventScope & RECORD_SCOPE_PER_INSTANCE), mInitialFenceValue(descriptor.InitialFenceValue), - mIsAlwaysInBudget(descriptor.Flags & RESIDENCY_FLAG_ALWAYS_IN_BUDGET) { + mIsAlwaysInBudget(descriptor.Flags & RESIDENCY_MANAGER_FLAG_ALWAYS_IN_BUDGET) { GPGMM_TRACE_EVENT_OBJECT_NEW(this); ASSERT(mDevice != nullptr); diff --git a/src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp b/src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp index 1e447980..5c8e8e0d 100644 --- a/src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp +++ b/src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp @@ -386,7 +386,7 @@ namespace gpgmm::d3d12 { residencyDesc.RecordOptions = allocatorDescriptor.RecordOptions; if (allocatorDescriptor.Flags & RESOURCE_ALLOCATOR_FLAG_ALWAYS_IN_BUDGET) { - residencyDesc.Flags |= RESIDENCY_FLAG_ALWAYS_IN_BUDGET; + residencyDesc.Flags |= RESIDENCY_MANAGER_FLAG_ALWAYS_IN_BUDGET; } GPGMM_RETURN_IF_FAILED(ResidencyManager::CreateResidencyManager( diff --git a/src/tests/end2end/D3D12ResidencyManagerTests.cpp b/src/tests/end2end/D3D12ResidencyManagerTests.cpp index a669cb66..07b178f1 100644 --- a/src/tests/end2end/D3D12ResidencyManagerTests.cpp +++ b/src/tests/end2end/D3D12ResidencyManagerTests.cpp @@ -551,7 +551,7 @@ TEST_F(D3D12ResidencyManagerTests, OverBudget) { TEST_F(D3D12ResidencyManagerTests, OverBudgetAsync) { constexpr uint64_t kBudgetIsDeterminedByOS = 0; RESIDENCY_MANAGER_DESC residencyDesc = CreateBasicResidencyDesc(kBudgetIsDeterminedByOS); - residencyDesc.Flags |= RESIDENCY_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES; + residencyDesc.Flags |= RESIDENCY_MANAGER_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES; ComPtr residencyManager; ASSERT_SUCCEEDED(