diff --git a/include/gpgmm_d3d12.h b/include/gpgmm_d3d12.h index 37d0ffcce..2da9d092d 100644 --- a/include/gpgmm_d3d12.h +++ b/include/gpgmm_d3d12.h @@ -388,13 +388,13 @@ namespace gpgmm::d3d12 { */ RESIDENCY_FLAG_NONE = 0x0, - /** \brief Disables automatic background memory budget updates by OS notifications. + /** \brief Disables background memory budget updates from OS notifications. By default, memory budget updates will be pushed by the OS using a background thread. If the OS does not support push notifications or budget updates are not frequent enough, this mechanism can be disabled where a pull-based method is used instead. */ - RESIDENCY_FLAG_DISABLE_BUDGET_UPDATES_ON_WORKER_THREAD = 0x1, + RESIDENCY_FLAG_DISABLE_BACKGROUND_BUDGET_UPDATES = 0x1, /** \brief Specifies if unified memory architecture (UMA) is always disabled. @@ -1046,7 +1046,7 @@ namespace gpgmm::d3d12 { /** \brief Prefetch memory for the next resource allocation. - The call to prefetch is deferred to a separate background thread by GPGMM which runs + The call to prefetch is deferred to a background thread by GPGMM which runs when the current allocation requested is completed. By default, GPGMM will automatically trigger prefetching based on heurstics. Prefetching enables more performance when allocating for contiguous allocations or many resources of the same size. diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp index bede14ea3..0bd29d77f 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp @@ -87,7 +87,7 @@ namespace gpgmm::d3d12 { new ResidencyManager(descriptor, pDevice, pAdapter, std::move(caps))); // Require automatic video memory budget updates. - if (!(descriptor.Flags & RESIDENCY_FLAG_DISABLE_BUDGET_UPDATES_ON_WORKER_THREAD)) { + if (!(descriptor.Flags & RESIDENCY_FLAG_DISABLE_BACKGROUND_BUDGET_UPDATES)) { GPGMM_RETURN_IF_FAILED(residencyManager->StartBudgetNotificationUpdates(), pDevice); DebugLog(residencyManager.get(), MessageId::kBudgetUpdated) << "OS based memory budget updates were successfully enabled."; diff --git a/src/tests/end2end/D3D12ResidencyManagerTests.cpp b/src/tests/end2end/D3D12ResidencyManagerTests.cpp index b25109f24..8e1978763 100644 --- a/src/tests/end2end/D3D12ResidencyManagerTests.cpp +++ b/src/tests/end2end/D3D12ResidencyManagerTests.cpp @@ -61,7 +61,7 @@ class D3D12ResidencyManagerTests : public D3D12TestBase, public ::testing::Test RESIDENCY_MANAGER_DESC residencyDesc = D3D12TestBase::CreateBasicResidencyDesc(); // Disable automatic budget updates, since it occurs uncontrollably by the OS. - residencyDesc.Flags |= RESIDENCY_FLAG_DISABLE_BUDGET_UPDATES_ON_WORKER_THREAD; + residencyDesc.Flags |= RESIDENCY_FLAG_DISABLE_BACKGROUND_BUDGET_UPDATES; // Specify a restricted budget, the OS budget fluctuates unpredicatbly. residencyDesc.MaxBudgetInBytes = budget; @@ -529,7 +529,7 @@ TEST_F(D3D12ResidencyManagerTests, OverBudget) { TEST_F(D3D12ResidencyManagerTests, OverBudgetAsync) { constexpr uint64_t kBudgetIsDeterminedByOS = 0; RESIDENCY_MANAGER_DESC residencyDesc = CreateBasicResidencyDesc(kBudgetIsDeterminedByOS); - residencyDesc.Flags ^= RESIDENCY_FLAG_DISABLE_BUDGET_UPDATES_ON_WORKER_THREAD; + residencyDesc.Flags ^= RESIDENCY_FLAG_DISABLE_BACKGROUND_BUDGET_UPDATES; ComPtr residencyManager; ASSERT_SUCCEEDED(