Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/JSONSerializerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 5 additions & 4 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 &
Expand Down Expand Up @@ -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;
}
Expand Down
9 changes: 4 additions & 5 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down