1#ifndef VULKAN_EXCEPTION
2#define VULKAN_EXCEPTION
6#include <vulkan/vulkan.h>
8namespace Vulkan {
class VulkanException; }
15 VulkanException(
const std::string& description, VkResult errorCode,
const std::string& hint =
"") :
16 std::runtime_error(description),
17 errorCode{ errorCode },
22 std::runtime_error(description),
23 errorCode{ VK_SUCCESS },
28 std::runtime_error(description),
29 errorCode{ VK_SUCCESS },
33 const char*
what() const noexcept
override{
34 fullDescription =
"\n? Vulkan runtime error";
35 if(errorCode != VK_SUCCESS) {
36 fullDescription +=
"\n\tcode: " + std::to_string(errorCode);
38 if (
const std::string description = std::runtime_error::what(); description !=
"") {
39 fullDescription +=
"\n\tdescription: " + description;
42 fullDescription +=
"\n\thint: " + hint;
44 return fullDescription.c_str();
50 mutable std::string fullDescription;
Generic runtime exception thrown by Vulkan-related functions.
Definition: VulkanException.h:13
VulkanException(const std::string &description)
Definition: VulkanException.h:27
VulkanException(const std::string &description, VkResult errorCode, const std::string &hint="")
Definition: VulkanException.h:15
VulkanException(const std::string &description, const std::string &hint)
Definition: VulkanException.h:21
const char * what() const noexcept override
Definition: VulkanException.h:33
Types of queue families.
Definition: Animations.h:17