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/common/EventTraceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace gpgmm {
// Open the file but do not create it.
outFile.open(mTraceFile, std::ios_base::out | std::ios_base::in);
if (outFile.is_open()) {
WarningLog() << mTraceFile + " exists and will be overwritten.";
WarnLog() << mTraceFile + " exists and will be overwritten.";
}
outFile.close();

Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/common/MemoryAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace gpgmm {

void MemoryAllocator::CheckAndReportAllocationMisalignment(const MemoryAllocation& allocation) {
if (allocation.GetSize() > allocation.GetRequestSize()) {
WarningLog(MessageId::kAlignmentMismatch)
WarnLog(MessageId::kAlignmentMismatch)
<< "Allocation is larger then the requested size (" +
std::to_string(allocation.GetSize()) + " vs " +
std::to_string(allocation.GetRequestSize()) + " bytes).";
Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/common/TraceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace gpgmm {

void StartupEventTrace(const char* traceFile, const TraceEventPhase& ignoreMask) {
#if defined(GPGMM_DISABLE_TRACING)
WarningLog() << "Event tracing enabled but unable to record due to GPGMM_DISABLE_TRACING.";
WarnLog() << "Event tracing enabled but unable to record due to GPGMM_DISABLE_TRACING.";
#endif

GetInstance()->SetConfiguration(traceFile, ignoreMask);
Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/CapsD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace gpgmm::d3d12 {
caps->mIsResourceAllocationWithinCoherent = true;
}
} else {
WarningLog()
WarnLog()
<< "Adapter was left unspecified. Device capabilities may not be fully detected.";
}

Expand Down
4 changes: 2 additions & 2 deletions src/gpgmm/d3d12/DebugResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace gpgmm::d3d12 {
std::lock_guard<std::mutex> lock(mMutex);
for (auto allocationEntry : mLiveAllocations) {
const ResourceAllocation* allocation = allocationEntry->GetValue().GetAllocation();
WarningLog() << "Live ResourceAllocation at " << ToHexStr(allocation) << ", "
<< JSONSerializer::Serialize(allocation->GetInfo()).ToString();
WarnLog() << "Live ResourceAllocation at " << ToHexStr(allocation) << ", "
<< JSONSerializer::Serialize(allocation->GetInfo()).ToString();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/HeapD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace gpgmm::d3d12 {
}
} else {
if (descriptor.Flags & HEAP_FLAG_ALWAYS_IN_RESIDENCY) {
WarningLog(heap.get(), MessageId::kInvalidArgument)
WarnLog(heap.get(), MessageId::kInvalidArgument)
<< "HEAP_FLAG_ALWAYS_IN_RESIDENCY was specified but had no effect becauase "
"residency management is "
"not being used.";
Expand Down
5 changes: 2 additions & 3 deletions src/gpgmm/d3d12/LogD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace gpgmm::d3d12 {
}

template <typename BackendT>
LogMessage WarningLog(const BackendT* object, MessageId messageId = MessageId::kUnknown) {
return gpgmm::WarningLog(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()),
object);
LogMessage WarnLog(const BackendT* object, MessageId messageId = MessageId::kUnknown) {
return gpgmm::WarnLog(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), object);
}

template <typename BackendT>
Expand Down
6 changes: 3 additions & 3 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ namespace gpgmm::d3d12 {
}

if ((descriptor.Flags & RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY) && caps->IsAdapterUMA()) {
WarningLog(MessageId::kInvalidArgument, true)
WarnLog(MessageId::kInvalidArgument, true)
<< "RESIDENCY_FLAG_DISABLE_UNIFIED_MEMORY flag was specified but "
"did not match the architecture of the adapter.";
}
Expand Down Expand Up @@ -240,13 +240,13 @@ namespace gpgmm::d3d12 {
// Emit a warning if the budget was initialized to zero.
// This means nothing will be ever evicted, which will lead to device lost.
if (localVideoMemorySegmentInfo->Budget == 0) {
WarningLog(residencyManager.get(), MessageId::kBudgetInvalid)
WarnLog(residencyManager.get(), MessageId::kBudgetInvalid)
<< "GPU memory segment ("
<< GetMemorySegmentName(DXGI_MEMORY_SEGMENT_GROUP_LOCAL, residencyManager->mIsUMA)
<< ") did not initialize a budget. This means either a restricted budget was not "
"used or the first OS budget update hasn't occured.";
if (!residencyManager->mIsUMA && nonLocalVideoMemorySegmentInfo->Budget == 0) {
WarningLog(residencyManager.get(), MessageId::kBudgetInvalid)
WarnLog(residencyManager.get(), MessageId::kBudgetInvalid)
<< "GPU memory segment ("
<< GetMemorySegmentName(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL,
residencyManager->mIsUMA)
Expand Down
12 changes: 6 additions & 6 deletions src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ namespace gpgmm::d3d12 {
}

if (allocatorDescriptor.Flags & ALLOCATOR_FLAG_ALWAYS_IN_BUDGET && !pResidencyManager) {
WarningLog(MessageId::kInvalidArgument, true)
WarnLog(MessageId::kInvalidArgument, true)
<< "ALLOCATOR_FLAG_ALWAYS_IN_BUDGET has no effect when residency "
"management does not exist. This is probably not what the "
"developer intended to do. Please consider creating a residency "
Expand Down Expand Up @@ -551,7 +551,7 @@ namespace gpgmm::d3d12 {
D3D12_INFO_QUEUE_FILTER emptyFilter{};
GPGMM_RETURN_IF_FAILED(leakMessageQueue->PushRetrievalFilter(&emptyFilter));
} else {
WarningLog(MessageId::kInvalidArgument, true)
WarnLog(MessageId::kInvalidArgument, true)
<< "GPGMM_ENABLE_DEVICE_LEAK_CHECKS has no effect because the D3D12 debug "
"layer was either not installed or enabled. Please call "
"ID3D12Debug::EnableDebugLayer before using this flag.";
Expand Down Expand Up @@ -1046,7 +1046,7 @@ namespace gpgmm::d3d12 {
// Check memory requirements.
D3D12_HEAP_FLAGS heapFlags = GetHeapFlags(resourceHeapType, IsCreateHeapNotResident());
if (!HasAllFlags(heapFlags, allocationDescriptor.ExtraRequiredHeapFlags)) {
WarningLog(this, MessageId::kPerformanceWarning)
WarnLog(this, MessageId::kPerformanceWarning)
<< "ALLOCATOR_FLAG_ALWAYS_COMMITTED was not requested but enabled anyway because "
"the required heap flags were incompatible with resource heap type ("
<< std::to_string(allocationDescriptor.ExtraRequiredHeapFlags) << " vs "
Expand Down Expand Up @@ -1091,7 +1091,7 @@ namespace gpgmm::d3d12 {
if (GPGMM_UNLIKELY(requiresPadding)) {
request.SizeInBytes += allocationDescriptor.RequireResourceHeapPadding;
if (!neverSubAllocate) {
WarningLog(this, MessageId::kInvalidArgument)
WarnLog(this, MessageId::kInvalidArgument)
<< "Sub-allocation was enabled but has no effect when padding is requested: "
<< allocationDescriptor.RequireResourceHeapPadding << " bytes.";
neverSubAllocate = true;
Expand Down Expand Up @@ -1621,7 +1621,7 @@ namespace gpgmm::d3d12 {
switch (message->ID) {
case D3D12_MESSAGE_ID_LIVE_HEAP:
case D3D12_MESSAGE_ID_LIVE_RESOURCE: {
WarningLog(this, MessageId::kPerformanceWarning)
WarnLog(this, MessageId::kPerformanceWarning)
<< "Device leak detected: " + std::string(message->pDescription);
} break;
default:
Expand Down Expand Up @@ -1672,7 +1672,7 @@ namespace gpgmm::d3d12 {
return S_OK;
}
default: {
WarningLog(this, MessageId::kBadOperation)
WarnLog(this, MessageId::kBadOperation)
<< "CheckFeatureSupport does not support feature (" + std::to_string(feature) +
").";
return E_INVALIDARG;
Expand Down
10 changes: 5 additions & 5 deletions src/gpgmm/utils/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ namespace gpgmm {
return {MessageSeverity::kInfo, messageId, isExternal, name, object};
}

LogMessage WarningLog(MessageId messageId,
bool isExternal,
const std::string& name,
const ObjectBase* object) {
LogMessage WarnLog(MessageId messageId,
bool isExternal,
const std::string& name,
const ObjectBase* object) {
return {MessageSeverity::kWarning, messageId, isExternal, name, object};
}

Expand Down Expand Up @@ -226,7 +226,7 @@ namespace gpgmm {
case MessageSeverity::kInfo:
return InfoLog(messageId, isExternal, name, object);
case MessageSeverity::kWarning:
return WarningLog(messageId, isExternal, name, object);
return WarnLog(messageId, isExternal, name, object);
case MessageSeverity::kError:
return ErrorLog(messageId, isExternal, name, object);
default:
Expand Down
8 changes: 4 additions & 4 deletions src/gpgmm/utils/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ namespace gpgmm {
bool isExternal = false,
const std::string& name = "",
const ObjectBase* mObject = nullptr);
LogMessage WarningLog(MessageId messageId = MessageId::kUnknown,
bool isExternal = false,
const std::string& name = "",
const ObjectBase* mObject = nullptr);
LogMessage WarnLog(MessageId messageId = MessageId::kUnknown,
bool isExternal = false,
const std::string& name = "",
const ObjectBase* mObject = nullptr);
LogMessage ErrorLog(MessageId messageId = MessageId::kUnknown,
bool isExternal = false,
const std::string& name = "",
Expand Down
4 changes: 2 additions & 2 deletions src/tests/capture_replay_tests/D3D12MemoryTraceReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class D3D12MemoryTraceReplay : public D3D12TestBase, public CaptureReplayTestWit
if (GetLogLevel() <= gpgmm::MessageSeverity::kWarning &&
mCaps->IsAdapterUMA() != snapshot["IsUMA"].asBool() &&
iterationIndex == 0) {
gpgmm::WarningLog()
gpgmm::WarnLog()
<< "Capture device does not match playback device (IsUMA: " +
std::to_string(snapshot["IsUMA"].asBool()) + " vs " +
std::to_string(mCaps->IsAdapterUMA()) + ").";
Expand Down Expand Up @@ -446,7 +446,7 @@ class D3D12MemoryTraceReplay : public D3D12TestBase, public CaptureReplayTestWit
mCaps->GetMaxResourceHeapTierSupported() <
snapshot["ResourceHeapTier"].asInt() &&
iterationIndex == 0) {
gpgmm::WarningLog()
gpgmm::WarnLog()
<< "Captured device exceeds capabilities of playback device "
"(ResourceHeapTier: " +
std::to_string(snapshot["ResourceHeapTier"].asInt()) +
Expand Down