15db71995Sopenharmony_ci/*
25db71995Sopenharmony_ci * Copyright (c) 2015-2021 The Khronos Group Inc.
35db71995Sopenharmony_ci * Copyright (c) 2015-2021 Valve Corporation
45db71995Sopenharmony_ci * Copyright (c) 2015-2021 LunarG, Inc.
55db71995Sopenharmony_ci * Copyright (C) 2015-2016 Google Inc.
65db71995Sopenharmony_ci *
75db71995Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
85db71995Sopenharmony_ci * you may not use this file except in compliance with the License.
95db71995Sopenharmony_ci * You may obtain a copy of the License at
105db71995Sopenharmony_ci *
115db71995Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
125db71995Sopenharmony_ci *
135db71995Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
145db71995Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
155db71995Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
165db71995Sopenharmony_ci * See the License for the specific language governing permissions and
175db71995Sopenharmony_ci * limitations under the License.
185db71995Sopenharmony_ci *
195db71995Sopenharmony_ci * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
205db71995Sopenharmony_ci * Author: Jon Ashburn <jon@lunarg.com>
215db71995Sopenharmony_ci * Author: Mark Young <markyk@lunarg.com>
225db71995Sopenharmony_ci * Author: Charles Giessen <charles@lunarg.com>
235db71995Sopenharmony_ci */
245db71995Sopenharmony_ci
255db71995Sopenharmony_ci#pragma once
265db71995Sopenharmony_ci
275db71995Sopenharmony_ci#include "loader_common.h"
285db71995Sopenharmony_ci
295db71995Sopenharmony_ci// General utilities
305db71995Sopenharmony_ci
315db71995Sopenharmony_ciVkResult add_debug_extensions_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list);
325db71995Sopenharmony_civoid check_for_enabled_debug_extensions(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo);
335db71995Sopenharmony_cibool debug_extensions_InstanceGpa(struct loader_instance *ptr_instance, const char *name, void **addr);
345db71995Sopenharmony_cibool debug_utils_ReportFlagsToAnnotFlags(VkDebugReportFlagsEXT dr_flags, bool default_flag_is_spec,
355db71995Sopenharmony_ci                                         VkDebugUtilsMessageSeverityFlagBitsEXT *da_severity,
365db71995Sopenharmony_ci                                         VkDebugUtilsMessageTypeFlagsEXT *da_type);
375db71995Sopenharmony_cibool debug_utils_AnnotFlagsToReportFlags(VkDebugUtilsMessageSeverityFlagBitsEXT da_severity,
385db71995Sopenharmony_ci                                         VkDebugUtilsMessageTypeFlagsEXT da_type, VkDebugReportFlagsEXT *dr_flags);
395db71995Sopenharmony_cibool debug_utils_ReportObjectToAnnotObject(VkDebugReportObjectTypeEXT dr_object_type, uint64_t object_handle,
405db71995Sopenharmony_ci                                           VkDebugUtilsObjectNameInfoEXT *da_object_name_info);
415db71995Sopenharmony_cibool debug_utils_AnnotObjectToDebugReportObject(const VkDebugUtilsObjectNameInfoEXT *da_object_name_info,
425db71995Sopenharmony_ci                                                VkDebugReportObjectTypeEXT *dr_object_type, uint64_t *dr_object_handle);
435db71995Sopenharmony_ci
445db71995Sopenharmony_civoid destroy_debug_callbacks_chain(struct loader_instance *inst, const VkAllocationCallbacks *pAllocator);
455db71995Sopenharmony_ci
465db71995Sopenharmony_ci// VK_EXT_debug_utils related items
475db71995Sopenharmony_ci
485db71995Sopenharmony_ciVKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugUtilsMessengerEXT(VkInstance instance,
495db71995Sopenharmony_ci                                                                       const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
505db71995Sopenharmony_ci                                                                       const VkAllocationCallbacks *pAllocator,
515db71995Sopenharmony_ci                                                                       VkDebugUtilsMessengerEXT *pMessenger);
525db71995Sopenharmony_ciVKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
535db71995Sopenharmony_ci                                                                    const VkAllocationCallbacks *pAllocator);
545db71995Sopenharmony_ciVKAPI_ATTR void VKAPI_CALL terminator_SubmitDebugUtilsMessageEXT(VkInstance instance,
555db71995Sopenharmony_ci                                                                 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
565db71995Sopenharmony_ci                                                                 VkDebugUtilsMessageTypeFlagsEXT messageTypes,
575db71995Sopenharmony_ci                                                                 const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
585db71995Sopenharmony_ciVkResult util_CreateDebugUtilsMessengers(struct loader_instance *inst, const void *pChain, const VkAllocationCallbacks *pAllocator);
595db71995Sopenharmony_ciVkBool32 util_SubmitDebugUtilsMessageEXT(const struct loader_instance *inst, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
605db71995Sopenharmony_ci                                         VkDebugUtilsMessageTypeFlagsEXT messageTypes,
615db71995Sopenharmony_ci                                         const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
625db71995Sopenharmony_ci
635db71995Sopenharmony_ci// VK_EXT_debug_report related items
645db71995Sopenharmony_ci
655db71995Sopenharmony_ciVKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallbackEXT(VkInstance instance,
665db71995Sopenharmony_ci                                                                       const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
675db71995Sopenharmony_ci                                                                       const VkAllocationCallbacks *pAllocator,
685db71995Sopenharmony_ci                                                                       VkDebugReportCallbackEXT *pCallback);
695db71995Sopenharmony_ci
705db71995Sopenharmony_ciVKAPI_ATTR void VKAPI_CALL terminator_DestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback,
715db71995Sopenharmony_ci                                                                    const VkAllocationCallbacks *pAllocator);
725db71995Sopenharmony_ci
735db71995Sopenharmony_ciVKAPI_ATTR void VKAPI_CALL terminator_DebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags,
745db71995Sopenharmony_ci                                                            VkDebugReportObjectTypeEXT objType, uint64_t object, size_t location,
755db71995Sopenharmony_ci                                                            int32_t msgCode, const char *pLayerPrefix, const char *pMsg);
765db71995Sopenharmony_ci
775db71995Sopenharmony_ciVkResult util_CreateDebugReportCallbacks(struct loader_instance *inst, const void *pChain, const VkAllocationCallbacks *pAllocator);
785db71995Sopenharmony_ciVkBool32 util_DebugReportMessage(const struct loader_instance *inst, VkFlags msgFlags, VkDebugReportObjectTypeEXT objectType,
795db71995Sopenharmony_ci                                 uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg);
80