15 explicit Renderer(std::shared_ptr<Application> app);
19 auto clear() ->
void {}
21 auto draw() ->
void {}
25 VkDebugUtilsMessengerEXT debugMessenger;
27 const std::vector<const char *> validationLayers = {
"VK_LAYER_KHRONOS_validation"};
29 auto checkValidationLayerSupport() -> bool;
30 auto getRequiredExtensions() -> std::vector<const char *>;
31 auto populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT &createInfo) -> void;
32 auto CreateDebugUtilsMessengerEXT(VkInstance instance,
const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
33 const VkAllocationCallbacks *pAllocator,
34 VkDebugUtilsMessengerEXT *pDebugMessenger) -> VkResult;
35 auto DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger,
36 const VkAllocationCallbacks *pAllocator) -> void;
39 constexpr static const bool enableValidationLayers =
false;
41 constexpr static const bool enableValidationLayers =
true;
44 static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
45 VkDebugUtilsMessageTypeFlagsEXT messageType,
46 const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData,
49 std::string prefix =
"[UNKNOWN ]";
51 switch (messageType) {
52 case VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT:
53 prefix =
"[GENERAL ]";
55 case VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT:
56 prefix =
"[VALIDATION ]";
58 case VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT:
59 prefix =
"[PERFORMANCE]";
63 switch (messageSeverity) {
64 case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
65 getVulkanLogger()->trace(
"{} {}", prefix, pCallbackData->pMessage);
67 case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
68 getVulkanLogger()->info(
"{} {}", prefix, pCallbackData->pMessage);
70 case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
71 getVulkanLogger()->warn(
"{} {}", prefix, pCallbackData->pMessage);
73 case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT:
74 getVulkanLogger()->error(
"{} {}", prefix, pCallbackData->pMessage);
77 getVulkanLogger()->error(
"UNKNOWN MESSAGE SEVERITY");
78 getVulkanLogger()->error(
"{} {}", prefix, pCallbackData->pMessage);