diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp index 80f90cfd7..1520c2948 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp @@ -62,13 +62,7 @@ namespace gpgmm::d3d12 { // mBudgetNotificationUpdateEvent case (WAIT_OBJECT_0 + 0): { hr = - mResidencyManager->UpdateMemorySegment(DXGI_MEMORY_SEGMENT_GROUP_LOCAL); - if (FAILED(hr)) { - break; - } - - hr = mResidencyManager->UpdateMemorySegment( - DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL); + mResidencyManager->UpdateMemorySegments(); if (FAILED(hr)) { break; } @@ -189,9 +183,8 @@ namespace gpgmm::d3d12 { gpgmm::DebugLog() << "OS event based budget updates enabled."; } - // Set the initial video memory limits per segment. - ReturnIfFailed(residencyManager->UpdateMemorySegment(DXGI_MEMORY_SEGMENT_GROUP_LOCAL)); - ReturnIfFailed(residencyManager->UpdateMemorySegment(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL)); + // Set the initial video memory limits. + ReturnIfFailed(residencyManager->UpdateMemorySegments()); // D3D12 has non-zero memory usage even before any resources have been created, and this // value can vary by OS enviroment. By adding this in addition to the artificial budget @@ -464,10 +457,10 @@ namespace gpgmm::d3d12 { return S_OK; } - HRESULT ResidencyManager::UpdateMemorySegment( - const DXGI_MEMORY_SEGMENT_GROUP& memorySegmentGroup) { + HRESULT ResidencyManager::UpdateMemorySegments() { std::lock_guard lock(mMutex); - ReturnIfFailed(UpdateMemorySegmentInternal(memorySegmentGroup)); + ReturnIfFailed(UpdateMemorySegmentInternal(DXGI_MEMORY_SEGMENT_GROUP_LOCAL)); + ReturnIfFailed(UpdateMemorySegmentInternal(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL)); return S_OK; } diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.h b/src/gpgmm/d3d12/ResidencyManagerD3D12.h index e97052995..b69689f39 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.h +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.h @@ -240,7 +240,7 @@ namespace gpgmm::d3d12 { DXGI_MEMORY_SEGMENT_GROUP GetMemorySegmentGroup(D3D12_HEAP_TYPE heapType) const; friend BudgetUpdateTask; - HRESULT UpdateMemorySegment(const DXGI_MEMORY_SEGMENT_GROUP& memorySegmentGroup); + HRESULT UpdateMemorySegments(); const char* GetTypename() const;