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
12 changes: 0 additions & 12 deletions include/gpgmm_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ namespace gpgmm::d3d12 {
Optional parameter. By default, no flags are specified or RESIDENCY_HEAP_FLAG_NONE.
*/
RESIDENCY_HEAP_FLAGS Flags;

/** \brief Debug name associated with the heap.

Optional parameter. By default, no name is associated.
*/
LPCWSTR DebugName;
};

/** \brief Callback function used to create a ID3D12Pageable.
Expand Down Expand Up @@ -1207,12 +1201,6 @@ namespace gpgmm::d3d12 {
Optional parameter. No extra padding is applied by default.
*/
UINT64 ExtraRequiredResourcePadding;

/** \brief Associates a name with the given allocation.

Optional parameter. By default, no name is associated.
*/
LPCWSTR DebugName;
};

/** \struct FEATURE_DATA_RESOURCE_ALLOCATION_SUPPORT
Expand Down
6 changes: 0 additions & 6 deletions src/gpgmm/d3d12/JSONSerializerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ namespace gpgmm::d3d12 {
dict.AddItem("HeapType", desc.HeapType);
dict.AddItem("ExtraRequiredHeapFlags", desc.ExtraRequiredHeapFlags);
dict.AddItem("ExtraRequiredResourcePadding", desc.ExtraRequiredResourcePadding);
if (desc.DebugName != nullptr) {
dict.AddItem("DebugName", WCharToUTF8(desc.DebugName));
}
return dict;
}

Expand Down Expand Up @@ -164,9 +161,6 @@ namespace gpgmm::d3d12 {
dict.AddItem("Alignment", desc.Alignment);
dict.AddItem("HeapSegment", desc.HeapSegment);
dict.AddItem("Flags", desc.Flags);
if (desc.DebugName != nullptr) {
dict.AddItem("DebugName", WCharToUTF8(desc.DebugName));
}
return dict;
}

Expand Down
2 changes: 0 additions & 2 deletions src/gpgmm/d3d12/ResidencyHeapD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ namespace gpgmm::d3d12 {
}
}

GPGMM_RETURN_IF_FAILED(heap->SetDebugName(newDescriptor.DebugName),
GetDevice(pPageable).Get());
GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(heap.get(), newDescriptor);

DebugLog(MessageId::kObjectCreated, heap.get())
Expand Down
10 changes: 2 additions & 8 deletions src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,9 +1065,6 @@ namespace gpgmm::d3d12 {

ASSERT(allocation->GetResource() != nullptr);

GPGMM_RETURN_IF_FAILED(allocation->SetDebugName(allocationDescriptor.DebugName),
mDevice);

if (GPGMM_UNLIKELY(mTrackingAllocator)) {
mTrackingAllocator->TrackAllocation(allocation.Get());
}
Expand Down Expand Up @@ -1331,7 +1328,6 @@ namespace gpgmm::d3d12 {
allocationDesc.HeapOffset = kInvalidOffset;
allocationDesc.Type = RESOURCE_ALLOCATION_TYPE_SUBALLOCATED_WITHIN;
allocationDesc.OffsetFromResource = subAllocation.GetOffset();
allocationDesc.DebugName = allocationDescriptor.DebugName;

ResidencyHeap* resourceHeap =
static_cast<ResidencyHeap*>(subAllocation.GetMemory());
Expand Down Expand Up @@ -1378,7 +1374,6 @@ namespace gpgmm::d3d12 {
allocationDesc.Type =
static_cast<RESOURCE_ALLOCATION_TYPE>(subAllocation.GetMethod());
allocationDesc.OffsetFromResource = 0;
allocationDesc.DebugName = allocationDescriptor.DebugName;

GPGMM_RETURN_IF_FAILED(
ResourceAllocation::CreateResourceAllocation(
Expand Down Expand Up @@ -1425,7 +1420,6 @@ namespace gpgmm::d3d12 {
allocationDesc.Type =
static_cast<RESOURCE_ALLOCATION_TYPE>(allocation.GetMethod());
allocationDesc.OffsetFromResource = 0;
allocationDesc.DebugName = allocationDescriptor.DebugName;

GPGMM_RETURN_IF_FAILED(
ResourceAllocation::CreateResourceAllocation(
Expand Down Expand Up @@ -1487,7 +1481,6 @@ namespace gpgmm::d3d12 {
allocationDesc.HeapOffset = kInvalidOffset;
allocationDesc.SizeInBytes = request.SizeInBytes;
allocationDesc.Type = RESOURCE_ALLOCATION_TYPE_STANDALONE;
allocationDesc.DebugName = allocationDescriptor.DebugName;

if (FAILED(ResourceAllocation::CreateResourceAllocation(
allocationDesc, this, this, resourceHeap.Detach(), nullptr, nullptr,
Expand Down Expand Up @@ -1629,7 +1622,6 @@ namespace gpgmm::d3d12 {
RESIDENCY_HEAP_DESC resourceHeapDesc = {};
resourceHeapDesc.SizeInBytes = info.SizeInBytes;
resourceHeapDesc.Alignment = info.Alignment;
resourceHeapDesc.DebugName = L"Resource heap (committed)";

if (IsResidencyEnabled()) {
resourceHeapDesc.Flags |= GetHeapFlags(heapFlags, mIsAlwaysCreatedInBudget);
Expand All @@ -1649,6 +1641,8 @@ namespace gpgmm::d3d12 {
&callbackContext, &resourceHeap),
mDevice);

GPGMM_RETURN_IF_FAILED(resourceHeap->SetDebugName(L"Resource heap (committed)"), mDevice);

if (resourceHeapOut != nullptr) {
*resourceHeapOut = static_cast<ResidencyHeap*>(resourceHeap.Detach());
}
Expand Down
3 changes: 2 additions & 1 deletion src/gpgmm/d3d12/ResourceHeapAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace gpgmm::d3d12 {
// https://docs.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_HEAP_INFO
resourceHeapDesc.SizeInBytes = AlignTo(request.SizeInBytes, request.Alignment);
resourceHeapDesc.Alignment = request.Alignment;
resourceHeapDesc.DebugName = L"GPGMM Resource Heap";

const bool isResidencyEnabled = (mResidencyManager != nullptr);
if (isResidencyEnabled) {
Expand All @@ -80,6 +79,8 @@ namespace gpgmm::d3d12 {
return GetErrorCode(hr);
}

resourceHeap->SetDebugName(L"GPGMM Resource Heap");

mStats.UsedMemoryUsage += resourceHeapDesc.SizeInBytes;
mStats.UsedMemoryCount++;

Expand Down
10 changes: 2 additions & 8 deletions src/tests/end2end/D3D12ResourceAllocatorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,14 @@ TEST_F(D3D12ResourceAllocatorTests, CreateBuffer) {
{
RESOURCE_ALLOCATION_DESC allocationDesc = {};
allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT;
allocationDesc.DebugName = L"Buffer";

ComPtr<IResourceAllocation> allocation;
ASSERT_SUCCEEDED(resourceAllocator->CreateResource(
allocationDesc, CreateBasicBufferDesc(kBufferOf4MBAllocationSize),
D3D12_RESOURCE_STATE_COMMON, nullptr, &allocation));
ASSERT_NE(allocation, nullptr);
EXPECT_EQUAL_WSTR(allocation->GetDebugName(), allocationDesc.DebugName);
ASSERT_SUCCEEDED(allocation->SetDebugName(L"Buffer"));
EXPECT_EQUAL_WSTR(allocation->GetDebugName(), L"Buffer");
}

// Creating a buffer without a heap type should be inferred based on the resource state.
Expand Down Expand Up @@ -1163,8 +1163,6 @@ TEST_F(D3D12ResourceAllocatorTests, CreateBufferWithinMany) {

// Create two small buffers that will be byte-aligned.
ComPtr<IResourceAllocation> smallBufferA;
allocationDesc.DebugName = GPGMM_GET_VAR_NAME(smallBufferA);

ASSERT_SUCCEEDED(resourceAllocator->CreateResource(allocationDesc, smallBufferDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
&smallBufferA));
Expand All @@ -1173,8 +1171,6 @@ TEST_F(D3D12ResourceAllocatorTests, CreateBufferWithinMany) {
EXPECT_EQ(smallBufferA->GetInfo().SizeInBytes, smallBufferDesc.Width);

ComPtr<IResourceAllocation> smallBufferB;
allocationDesc.DebugName = GPGMM_GET_VAR_NAME(smallBufferB);

ASSERT_SUCCEEDED(resourceAllocator->CreateResource(allocationDesc, smallBufferDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
&smallBufferB));
Expand All @@ -1183,8 +1179,6 @@ TEST_F(D3D12ResourceAllocatorTests, CreateBufferWithinMany) {
EXPECT_EQ(smallBufferB->GetInfo().SizeInBytes, smallBufferDesc.Width);

ComPtr<IResourceAllocation> smallBufferC;
allocationDesc.DebugName = GPGMM_GET_VAR_NAME(smallBufferC);

ASSERT_SUCCEEDED(resourceAllocator->CreateResource(allocationDesc, smallBufferDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
&smallBufferC));
Expand Down