diff --git a/src/gpgmm/d3d12/JSONSerializerD3D12.cpp b/src/gpgmm/d3d12/JSONSerializerD3D12.cpp index f112cc8c6..0bb163a63 100644 --- a/src/gpgmm/d3d12/JSONSerializerD3D12.cpp +++ b/src/gpgmm/d3d12/JSONSerializerD3D12.cpp @@ -251,7 +251,7 @@ namespace gpgmm::d3d12 { dict.AddItem("IsUMA", desc.IsUMA); dict.AddItem("VideoMemoryBudget", desc.VideoMemoryBudget); dict.AddItem("Budget", desc.Budget); - dict.AddItem("EvictBatchSize", desc.EvictBatchSize); + dict.AddItem("EvictSizeInBytes", desc.EvictSizeInBytes); dict.AddItem("InitialFenceValue", desc.InitialFenceValue); return dict; } diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp index 37ec5fd34..80f90cfd7 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.cpp @@ -32,7 +32,7 @@ namespace gpgmm::d3d12 { - static constexpr uint32_t kDefaultEvictBatchSize = GPGMM_MB_TO_BYTES(50); + static constexpr uint32_t kDefaultEvictSizeInBytes = GPGMM_MB_TO_BYTES(50); static constexpr float kDefaultVideoMemoryBudget = 0.95f; // 95% // Creates a long-lived task to recieve and process OS budget change events. @@ -227,8 +227,8 @@ namespace gpgmm::d3d12 { mVideoMemoryBudget(descriptor.VideoMemoryBudget == 0 ? kDefaultVideoMemoryBudget : descriptor.VideoMemoryBudget), mIsBudgetRestricted(descriptor.Budget > 0), - mEvictBatchSize(descriptor.EvictBatchSize == 0 ? kDefaultEvictBatchSize - : descriptor.EvictBatchSize), + mEvictSizeInBytes(descriptor.EvictSizeInBytes == 0 ? kDefaultEvictSizeInBytes + : descriptor.EvictSizeInBytes), mIsUMA(descriptor.IsUMA), mIsBudgetChangeEventsDisabled(descriptor.UpdateBudgetByPolling), mFlushEventBuffersOnDestruct(descriptor.RecordOptions.EventScope & @@ -709,7 +709,8 @@ namespace gpgmm::d3d12 { // If nothing can be evicted after MakeResident has failed, we cannot continue // execution and must throw a fatal error. uint64_t evictedSizeInBytes = 0; - ReturnIfFailed(EvictInternal(mEvictBatchSize, memorySegmentGroup, &evictedSizeInBytes)); + ReturnIfFailed( + EvictInternal(mEvictSizeInBytes, memorySegmentGroup, &evictedSizeInBytes)); if (evictedSizeInBytes == 0) { return E_OUTOFMEMORY; } diff --git a/src/gpgmm/d3d12/ResidencyManagerD3D12.h b/src/gpgmm/d3d12/ResidencyManagerD3D12.h index 03c2a7e54..e97052995 100644 --- a/src/gpgmm/d3d12/ResidencyManagerD3D12.h +++ b/src/gpgmm/d3d12/ResidencyManagerD3D12.h @@ -94,13 +94,12 @@ namespace gpgmm::d3d12 { */ uint64_t Budget; - /** \brief Specifies the amount of memory, in bytes, to evict from residency at once, + /** \brief Size of memory, in bytes, to evict from residency at once, should there not be enough budget left. - Optional parameter. When 0 is specified, the API will automatically set the video memory - evict size to 50MB. + Optional parameter. When 0 is specified, the API will use a evict size of 50MB. */ - uint64_t EvictBatchSize; + uint64_t EvictSizeInBytes; /** \brief Initial fence value to use when managing heaps for residency. @@ -275,7 +274,7 @@ namespace gpgmm::d3d12 { const float mVideoMemoryBudget; const bool mIsBudgetRestricted; - const uint64_t mEvictBatchSize; + const uint64_t mEvictSizeInBytes; const bool mIsUMA; const bool mIsBudgetChangeEventsDisabled; const bool mFlushEventBuffersOnDestruct; diff --git a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp index 41138a143..966ca488e 100644 --- a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp +++ b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp @@ -314,7 +314,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith residencyDesc.IsUMA = snapshot["IsUMA"].asBool(); residencyDesc.VideoMemoryBudget = snapshot["VideoMemoryBudget"].asFloat(); residencyDesc.Budget = snapshot["Budget"].asUInt64(); - residencyDesc.EvictBatchSize = snapshot["EvictBatchSize"].asUInt64(); + residencyDesc.EvictSizeInBytes = snapshot["EvictSizeInBytes"].asUInt64(); residencyDesc.InitialFenceValue = snapshot["InitialFenceValue"].asUInt64(); if (envParams.CaptureEventMask != 0) {