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
3 changes: 3 additions & 0 deletions src/gpgmm/common/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace gpgmm {
EventMessage::~EventMessage() {
const std::string description = mStream.str();

#if defined(GPGMM_ENABLE_ASSERT_ON_WARNING)
ASSERT(mSeverity < LogSeverity::Warning);
#endif
gpgmm::Log(mSeverity) << mName << ": " << description;
if (mSeverity >= gRecordEventLevel) {
LOG_MESSAGE message{description, mMessageId};
Expand Down
10 changes: 5 additions & 5 deletions src/gpgmm/d3d12/DebugResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ namespace gpgmm { namespace d3d12 {

for (auto allocationEntry : mLiveAllocations) {
const ResourceAllocation* allocation = allocationEntry->GetValue().GetAllocation();
gpgmm::WarningLog() << "Live ResourceAllocation: "
<< "Addr=" << ToString(allocation) << ", "
<< "ExtRef=" << allocation->GetRefCount() << ", "
<< "Info="
<< JSONSerializer::Serialize(allocation->GetInfo()).ToString();
gpgmm::WarnEvent(allocation->GetAllocator()->GetTypename())
<< "Live ResourceAllocation: "
<< "Addr=" << ToString(allocation) << ", "
<< "ExtRef=" << allocation->GetRefCount() << ", "
<< "Info=" << JSONSerializer::Serialize(allocation->GetInfo()).ToString();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ namespace gpgmm { namespace d3d12 {
switch (message->ID) {
case D3D12_MESSAGE_ID_LIVE_HEAP:
case D3D12_MESSAGE_ID_LIVE_RESOURCE: {
gpgmm::WarningLog()
<< "Device leak detected: " + std::string(message->pDescription);
gpgmm::WarnEvent("Device")
<< "Leak detected: " + std::string(message->pDescription);
} break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/ResourceHeapAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace gpgmm { namespace d3d12 {
ComPtr<ID3D12Heap> heap;
HRESULT hr = mDevice->CreateHeap(&heapDesc, IID_PPV_ARGS(&heap));
if (FAILED(hr)) {
ErrorLog() << GetTypename() << " failed to create heap: " << GetErrorMessage(hr);
ErrorEvent(GetTypename()) << " failed to create heap: " << GetErrorMessage(hr);
return {};
}

Expand Down
4 changes: 0 additions & 4 deletions src/gpgmm/utils/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ namespace gpgmm {
ToString(std::this_thread::get_id()).c_str(), fullMessage.c_str());
fflush(outputStream);
#endif

#if defined(GPGMM_ENABLE_ASSERT_ON_WARNING)
ASSERT(mSeverity < LogSeverity::Warning);
#endif
}

LogMessage DebugLog() {
Expand Down