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/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ source_set("gpgmm_sources") {
"d3d12/DebugObjectD3D12.h",
"d3d12/ErrorD3D12.cpp",
"d3d12/ErrorD3D12.h",
"d3d12/EventMessageD3D12.h",
"d3d12/FenceD3D12.cpp",
"d3d12/FenceD3D12.h",
"d3d12/JSONSerializerD3D12.cpp",
Expand Down
1 change: 1 addition & 0 deletions src/gpgmm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ if (GPGMM_ENABLE_D3D12)
"d3d12/CapsD3D12.h"
"d3d12/ErrorD3D12.cpp"
"d3d12/ErrorD3D12.h"
"d3d12/EventMessageD3D12.h"
"d3d12/FenceD3D12.cpp"
"d3d12/FenceD3D12.h"
"d3d12/ResidencyHeapD3D12.cpp"
Expand Down
49 changes: 49 additions & 0 deletions src/gpgmm/d3d12/EventMessageD3D12.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2022 The GPGMM Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_
#define SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_

#include "gpgmm/common/EventMessage.h"
#include "gpgmm/utils/WindowsUtils.h"

namespace gpgmm::d3d12 {

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

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

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

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

} // namespace gpgmm::d3d12

#endif // SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_
26 changes: 1 addition & 25 deletions src/gpgmm/d3d12/LogD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef SRC_GPGMM_D3D12_LOGD3D12_H_
#define SRC_GPGMM_D3D12_LOGD3D12_H_

#include "gpgmm/common/EventMessage.h"
#include "gpgmm/utils/Log.h"
#include "gpgmm/utils/WindowsUtils.h"

namespace gpgmm::d3d12 {
Expand All @@ -40,30 +40,6 @@ namespace gpgmm::d3d12 {
return gpgmm::ErrorLog(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), object);
}

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

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

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

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

} // namespace gpgmm::d3d12

#endif // SRC_GPGMM_D3D12_LOGD3D12_H_
1 change: 1 addition & 0 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "gpgmm/d3d12/BudgetUpdateD3D12.h"
#include "gpgmm/d3d12/CapsD3D12.h"
#include "gpgmm/d3d12/ErrorD3D12.h"
#include "gpgmm/d3d12/EventMessageD3D12.h"
#include "gpgmm/d3d12/FenceD3D12.h"
#include "gpgmm/d3d12/JSONSerializerD3D12.h"
#include "gpgmm/d3d12/LogD3D12.h"
Expand Down
1 change: 1 addition & 0 deletions src/gpgmm/d3d12/ResourceAllocatorD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "gpgmm/d3d12/BufferAllocatorD3D12.h"
#include "gpgmm/d3d12/CapsD3D12.h"
#include "gpgmm/d3d12/ErrorD3D12.h"
#include "gpgmm/d3d12/EventMessageD3D12.h"
#include "gpgmm/d3d12/JSONSerializerD3D12.h"
#include "gpgmm/d3d12/LogD3D12.h"
#include "gpgmm/d3d12/ResidencyHeapD3D12.h"
Expand Down