#pragma once #include #include #include #include "vk_api.hpp" namespace Vulkan { VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageCallback( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* callbackData, void* userData ); void setObjectName(vk::Device device, vk::ObjectType objectType, const void* objectHandle, const char* format, ...); template ::value == true>, typename... ArgsT> inline void setObjectName(vk::Device device, const T objectHandle, const char* format, ArgsT&&... args) { setObjectName(device, T::objectType, objectHandle, format, std::forward(args)...); } void beginDebugLabel(vk::CommandBuffer commandBuffer, std::span color, const char* format, ...); void insertDebugLabel(vk::CommandBuffer commandBuffer, std::span color, const char* format, ...); void endDebugLabel(vk::CommandBuffer commandBuffer); class DebugLabelScope { private: const vk::CommandBuffer commandBuffer; public: template DebugLabelScope(vk::CommandBuffer targetCommandBuffer, std::span color, const char* format, ArgsT&&... args) : commandBuffer(targetCommandBuffer) { beginDebugLabel(commandBuffer, color, format, std::forward(args)...); } template void operator()(std::span color, const char* format, ArgsT&&... args) const { insertDebugLabel(commandBuffer, color, format, std::forward(args)...); } ~DebugLabelScope() { endDebugLabel(commandBuffer); } }; } // namespace Vulkan