2 * Copyright © 2018, Google Inc.
4 * based on the anv driver which is:
5 * Copyright © 2017 Intel Corporation
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 #ifndef VK_DEBUG_REPORT_H
27 #define VK_DEBUG_REPORT_H
31 #include "util/list.h"
32 #include <vulkan/vulkan.h>
34 struct vk_debug_report_callback
{
35 /* Link in the 'callbacks' list in anv_instance struct. */
36 struct list_head link
;
37 VkDebugReportFlagsEXT flags
;
38 PFN_vkDebugReportCallbackEXT callback
;
42 struct vk_debug_report_instance
{
43 /* VK_EXT_debug_report debug callbacks */
44 pthread_mutex_t callbacks_mutex
;
45 struct list_head callbacks
;
48 VkResult
vk_debug_report_instance_init(struct vk_debug_report_instance
*instance
);
49 void vk_debug_report_instance_destroy(struct vk_debug_report_instance
*instance
);
52 vk_create_debug_report_callback(struct vk_debug_report_instance
*instance
,
53 const VkDebugReportCallbackCreateInfoEXT
* pCreateInfo
,
54 const VkAllocationCallbacks
* pAllocator
,
55 const VkAllocationCallbacks
* instance_allocator
,
56 VkDebugReportCallbackEXT
* pCallback
);
58 vk_destroy_debug_report_callback(struct vk_debug_report_instance
*instance
,
59 VkDebugReportCallbackEXT _callback
,
60 const VkAllocationCallbacks
* pAllocator
,
61 const VkAllocationCallbacks
* instance_allocator
);
64 vk_debug_report(struct vk_debug_report_instance
*instance
,
65 VkDebugReportFlagsEXT flags
,
66 VkDebugReportObjectTypeEXT object_type
,
70 const char* pLayerPrefix
,
71 const char *pMessage
);