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 <cstdint>
6
7#include <vulkan/vulkan.hpp>
8
9#include <libsbx/graphics/devices/instance.hpp>
10
11namespace sbx::graphics {
12
13auto set_debug_name(const VkObjectType object_type, const std::uint64_t object_handle, const std::string& name) -> void;
14
16
17public:
18
19 debug_messenger() = delete;
20
21 ~debug_messenger() = default;
22
23 [[nodiscard]] static auto create(const instance& target, const VkAllocationCallbacks* allocator = nullptr) -> VkResult;
24
25 static auto destroy(const instance& target, const VkAllocationCallbacks* allocator = nullptr) -> void;
26
27 static auto create_info() -> VkDebugUtilsMessengerCreateInfoEXT*;
28
29private:
30
31 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;
32
33 inline static VkDebugUtilsMessengerEXT _handle{};
34
35}; // class debug_messenger
36
37} // namespace sbx::graphics
38
39#endif // LIBSBX_GRAPHICS_DEVICES_DEBUG_MESSENGER_HPP_
Definition: allocator.hpp:13
Definition: debug_messenger.hpp:15
Definition: instance.hpp:11