|
| 1 | +// Copyright 2022 The GPGMM Authors |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +#ifndef SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_ |
| 16 | +#define SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_ |
| 17 | + |
| 18 | +#include "gpgmm/common/EventMessage.h" |
| 19 | +#include "gpgmm/utils/WindowsUtils.h" |
| 20 | + |
| 21 | +namespace gpgmm::d3d12 { |
| 22 | + |
| 23 | + template <typename BackendT> |
| 24 | + EventMessage DebugEvent(const BackendT* object, MessageId messageId = MessageId::kUnknown) { |
| 25 | + return gpgmm::DebugEvent(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), |
| 26 | + object); |
| 27 | + } |
| 28 | + |
| 29 | + template <typename BackendT> |
| 30 | + EventMessage InfoEvent(const BackendT* object, MessageId messageId = MessageId::kUnknown) { |
| 31 | + return gpgmm::InfoEvent(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), |
| 32 | + object); |
| 33 | + } |
| 34 | + |
| 35 | + template <typename BackendT> |
| 36 | + EventMessage WarnEvent(const BackendT* object, MessageId messageId = MessageId::kUnknown) { |
| 37 | + return gpgmm::WarnEvent(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), |
| 38 | + object); |
| 39 | + } |
| 40 | + |
| 41 | + template <typename BackendT> |
| 42 | + EventMessage ErrorEvent(const BackendT* object, MessageId messageId = MessageId::kUnknown) { |
| 43 | + return gpgmm::ErrorEvent(messageId, true, gpgmm::WCharToUTF8(object->GetDebugName()), |
| 44 | + object); |
| 45 | + } |
| 46 | + |
| 47 | +} // namespace gpgmm::d3d12 |
| 48 | + |
| 49 | +#endif // SRC_GPGMM_D3D12_EVENTMESSAGED3D12_H_ |
0 commit comments