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
1 change: 1 addition & 0 deletions src/gpgmm/d3d12/HeapD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace gpgmm::d3d12 {
}

ReturnIfFailed(heap->SetDebugName(descriptor.DebugName));
GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(heap.get(), descriptor);

if (heapOut != nullptr) {
*heapOut = heap.release();
Expand Down
15 changes: 12 additions & 3 deletions src/gpgmm/d3d12/JSONSerializerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ namespace gpgmm::d3d12 {
// static
JSONDict JSONSerializer::Serialize(const CREATE_HEAP_DESC& desc) {
JSONDict dict;
if (!desc.HeapDescriptor.DebugName.empty()) {
dict.AddItem("DebugName", desc.HeapDescriptor.DebugName);
}

ComPtr<ID3D12Heap> heap;
if (SUCCEEDED(desc.Pageable->QueryInterface(IID_PPV_ARGS(&heap)))) {
Expand All @@ -163,6 +160,18 @@ namespace gpgmm::d3d12 {
return dict;
}

// static
JSONDict JSONSerializer::Serialize(const HEAP_DESC& desc) {
JSONDict dict;
dict.AddItem("SizeInBytes", desc.SizeInBytes);
dict.AddItem("Alignment", desc.Alignment);
dict.AddItem("HeapType", desc.HeapType);
dict.AddItem("AlwaysInBudget", desc.AlwaysInBudget);
dict.AddItem("IsExternal", desc.IsExternal);
dict.AddItem("DebugName", desc.DebugName);
return dict;
}

// static
JSONDict JSONSerializer::Serialize(const HEAP_INFO& info) {
JSONDict dict;
Expand Down
1 change: 1 addition & 0 deletions src/gpgmm/d3d12/JSONSerializerD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace gpgmm::d3d12 {
static JSONDict Serialize(const ALLOCATION_DESC& desc);
static JSONDict Serialize(const D3D12_RESOURCE_DESC& desc);
static JSONDict Serialize(const CREATE_HEAP_DESC& desc);
static JSONDict Serialize(const HEAP_DESC& desc);
static JSONDict Serialize(const HEAP_INFO& info);
static JSONDict Serialize(const RESOURCE_ALLOCATION_DESC& desc);
static JSONDict Serialize(const RESOURCE_ALLOCATION_INFO& info);
Expand Down
4 changes: 2 additions & 2 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ namespace gpgmm::d3d12 {
}
}

if (residencyManager != nullptr) {
GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(residencyManager.get(), descriptor);
GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(residencyManager.get(), descriptor);

if (ppResidencyManagerOut != nullptr) {
*ppResidencyManagerOut = residencyManager.release();
}

Expand Down
3 changes: 2 additions & 1 deletion src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,11 @@ namespace gpgmm::d3d12 {
"ALLOCATOR_FLAG_ALWAYS_IN_BUDGET.";
}

GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(*ppResourceAllocatorOut, newDescriptor);

if (ppResourceAllocatorOut != nullptr) {
*ppResourceAllocatorOut =
new ResourceAllocator(newDescriptor, pResidencyManager, std::move(caps));
GPGMM_TRACE_EVENT_OBJECT_SNAPSHOT(*ppResourceAllocatorOut, newDescriptor);
}

return S_OK;
Expand Down