sandbox
Loading...
Searching...
No Matches
debug_messenger.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_GRAPHICS_DEVICES_DEBUG_MESSENGER_HPP_
3#define LIBSBX_GRAPHICS_DEVICES_DEBUG_MESSENGER_HPP_
4
5#include <vulkan/vulkan.hpp>
6
7#include <libsbx/graphics/devices/instance.hpp>
8
9namespace sbx::graphics {
10
11auto set_debug_name(const VkObjectType object_type, const std::uint64_t object_handle, const std::string& name) -> void;
12
14
15public:
16
17 debug_messenger() = delete;
18
19 ~debug_messenger() = default;
20
21 [[nodiscard]] static auto create(const instance& target, const VkAllocationCallbacks* allocator = nullptr) -> VkResult;
22
23 static auto destroy(const instance& target, const VkAllocationCallbacks* allocator = nullptr) -> void;
24
25 static auto create_info() -> VkDebugUtilsMessengerCreateInfoEXT*;
26
27private:
28
29 static VKAPI_ATTR auto VKAPI_CALL _debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, [[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT message_type, const VkDebugUtilsMessengerCallbackDataEXT* callback_data, [[maybe_unused]] void* user_data) -> VkBool32;
30
31 inline static VkDebugUtilsMessengerEXT _handle{};
32
33}; // class debug_messenger
34
35} // namespace sbx::graphics
36
37#endif // LIBSBX_GRAPHICS_DEVICES_DEBUG_MESSENGER_HPP_
Definition: allocator.hpp:13
Definition: debug_messenger.hpp:13
Definition: instance.hpp:11