1 #ifndef _VKDEBUGREPORTUTIL_HPP
2 #define _VKDEBUGREPORTUTIL_HPP
3 /*-------------------------------------------------------------------------
7 * Copyright (c) 2016 Google Inc.
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief VK_EXT_debug_report utilities
24 *//*--------------------------------------------------------------------*/
28 #include "deAppendList.hpp"
35 struct DebugReportMessage
37 VkDebugReportFlagsEXT flags;
38 VkDebugReportObjectTypeEXT objectType;
42 std::string layerPrefix;
45 DebugReportMessage (void)
47 , objectType ((VkDebugReportObjectTypeEXT)0)
53 DebugReportMessage (VkDebugReportFlagsEXT flags_,
54 VkDebugReportObjectTypeEXT objectType_,
58 const std::string& layerPrefix_,
59 const std::string& message_)
61 , objectType (objectType_)
63 , location (location_)
64 , messageCode (messageCode_)
65 , layerPrefix (layerPrefix_)
70 std::ostream& operator<< (std::ostream& str, const DebugReportMessage& message);
72 class DebugReportRecorder
75 typedef de::AppendList<DebugReportMessage> MessageList;
77 DebugReportRecorder (const InstanceInterface& vki, VkInstance instance);
78 ~DebugReportRecorder (void);
80 const MessageList& getMessages (void) const { return m_messages; }
81 void clearMessages (void) { m_messages.clear(); }
84 MessageList m_messages;
85 const Unique<VkDebugReportCallbackEXT> m_callback;
88 bool isDebugReportSupported (const PlatformInterface& vkp);
92 #endif // _VKDEBUGREPORTUTIL_HPP