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
24 changes: 16 additions & 8 deletions include/gpgmm_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,6 @@ namespace gpgmm::d3d12 {
*/
EVENT_RECORD_FLAGS Flags;

/** \brief Minimum severity level to record messages.

Messages with lower severity will be ignored.

Optional parameter. By default, the minimum severity level is WARN.
*/
D3D12_MESSAGE_SEVERITY MinMessageLevel;

/** \brief Specifies the scope of the events.

Optional parameter. By default, recording is per process.
Expand Down Expand Up @@ -398,6 +390,14 @@ namespace gpgmm::d3d12 {
*/
RESIDENCY_FLAGS Flags;

/** \brief Minimum severity level to record messages.

Messages with lower severity will be ignored.

Optional parameter. By default, the minimum severity level is WARN.
*/
D3D12_MESSAGE_SEVERITY MinRecordLevel;

/** \brief Minimum severity level to log messages to console.

Messages with lower severity will be ignored.
Expand Down Expand Up @@ -850,6 +850,14 @@ namespace gpgmm::d3d12 {
*/
ALLOCATOR_FLAGS Flags;

/** \brief Minimum severity level to record messages.

Messages with lower severity will be ignored.

Optional parameter. By default, the minimum severity level is WARN.
*/
D3D12_MESSAGE_SEVERITY MinRecordLevel;

/** \brief Minimum severity level to log messages to console.

Messages with lower severity will be ignored.
Expand Down
5 changes: 4 additions & 1 deletion src/gpgmm/d3d12/JSONSerializerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ namespace gpgmm::d3d12 {
// static
JSONDict JSONSerializer::Serialize(const ALLOCATOR_DESC& desc) {
JSONDict dict;
dict.AddItem("MinLogLevel", desc.MinLogLevel);
dict.AddItem("MinRecordLevel", desc.MinRecordLevel);
dict.AddItem("Flags", desc.Flags);
dict.AddItem("RecordOptions", Serialize(desc.RecordOptions));
dict.AddItem("ResourceHeapTier", desc.ResourceHeapTier);
Expand Down Expand Up @@ -88,7 +90,6 @@ namespace gpgmm::d3d12 {
JSONDict JSONSerializer::Serialize(const EVENT_RECORD_OPTIONS& desc) {
JSONDict dict;
dict.AddItem("Flags", desc.Flags);
dict.AddItem("MinMessageLevel", desc.MinMessageLevel);
return dict;
}

Expand Down Expand Up @@ -256,6 +257,8 @@ namespace gpgmm::d3d12 {
// static
JSONDict JSONSerializer::Serialize(const RESIDENCY_DESC& desc) {
JSONDict dict;
dict.AddItem("MinLogLevel", desc.MinLogLevel);
dict.AddItem("MinRecordLevel", desc.MinRecordLevel);
dict.AddItem("IsUMA", desc.IsUMA);
dict.AddItem("Flags", desc.Flags);
dict.AddItem("RecordOptions", Serialize(desc.RecordOptions));
Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ namespace gpgmm::d3d12 {
StartupEventTrace(descriptor.RecordOptions.TraceFile,
static_cast<TraceEventPhase>(~descriptor.RecordOptions.Flags));

SetEventMessageLevel(GetLogSeverity(descriptor.RecordOptions.MinMessageLevel));
SetEventMessageLevel(GetLogSeverity(descriptor.MinRecordLevel));
}

SetLogMessageLevel(GetLogSeverity(descriptor.MinLogLevel));
Expand Down
2 changes: 1 addition & 1 deletion src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ namespace gpgmm::d3d12 {
StartupEventTrace(allocatorDescriptor.RecordOptions.TraceFile,
static_cast<TraceEventPhase>(~newDescriptor.RecordOptions.Flags));

SetEventMessageLevel(GetLogSeverity(newDescriptor.RecordOptions.MinMessageLevel));
SetEventMessageLevel(GetLogSeverity(newDescriptor.MinRecordLevel));
} else {
// Do not override the event scope from a event trace already enabled.
newDescriptor.RecordOptions.EventScope = EVENT_RECORD_SCOPE_PER_PROCESS;
Expand Down
4 changes: 2 additions & 2 deletions src/tests/D3D12Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace gpgmm::d3d12 {

if (IsDumpEventsEnabled()) {
desc.RecordOptions.Flags |= EVENT_RECORD_FLAG_ALL_EVENTS;
desc.RecordOptions.MinMessageLevel = desc.MinLogLevel;
desc.MinRecordLevel = desc.MinLogLevel;
desc.RecordOptions.UseDetailedTimingEvents = true;

// Format the output trace file as <test suite>.<test>.
Expand All @@ -135,7 +135,7 @@ namespace gpgmm::d3d12 {

if (IsDumpEventsEnabled()) {
desc.RecordOptions.Flags |= EVENT_RECORD_FLAG_ALL_EVENTS;
desc.RecordOptions.MinMessageLevel = desc.MinLogLevel;
desc.MinRecordLevel = desc.MinLogLevel;
desc.RecordOptions.UseDetailedTimingEvents = true;
}

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 @@ -190,7 +190,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith
baseAllocatorDesc.RecordOptions.Flags |=
static_cast<EVENT_RECORD_FLAGS>(envParams.CaptureEventMask);
baseAllocatorDesc.RecordOptions.TraceFile = traceFile.path.c_str();
baseAllocatorDesc.RecordOptions.MinMessageLevel = baseAllocatorDesc.MinLogLevel;
baseAllocatorDesc.MinRecordLevel = baseAllocatorDesc.MinLogLevel;

// Keep recording across multiple playback iterations to ensure all
// events will be captured instead of overwritten per iteration.
Expand Down