From e3a465293b92ed30e220f2c70f67fb9adf3b0403 Mon Sep 17 00:00:00 2001 From: vimene Date: Sat, 20 Dec 2025 17:25:51 +0100 Subject: create present queue and lots of code refactoring - wait idle on present queue instead of graphics queue - assume only one bit of VkDebugUtilsMessageSeverityFlagBitsEXT is set; it seems to be always the case - rename every _create_info to _ci - print less debug information, by reducing debug output to warning and up, and by removing printing of all of devices properties - make as much blocks and lambdas as possible to contain every variable to a small scope - use designator lists everywhere - rename device to physical_device, and logical_device to device --- src/vulkan_utils.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/vulkan_utils.hpp (limited to 'src/vulkan_utils.hpp') diff --git a/src/vulkan_utils.hpp b/src/vulkan_utils.hpp new file mode 100644 index 0000000..8e6f617 --- /dev/null +++ b/src/vulkan_utils.hpp @@ -0,0 +1,24 @@ +#ifndef VULKAN_UTILS_HPP +#define VULKAN_UTILS_HPP + +#include +// I don't know if we should directly include vulkan or not +#define GLFW_INCLUDE_VULKAN +#include + +namespace engine::myvk { + +struct api { uint32_t raw; }; + +constexpr std::ostream& operator<<(std::ostream& os, const api& api) { + // this code is unreadable but it amuses me + return (VK_API_VERSION_VARIANT(api.raw) == 0 ? os : os << "(variant " + << VK_API_VERSION_VARIANT(api.raw) << ") ") + << VK_API_VERSION_MAJOR (api.raw) << "." + << VK_API_VERSION_MINOR (api.raw) << "." + << VK_API_VERSION_PATCH (api.raw); +} + +} + +#endif // VULKAN_UTILS_HPP -- cgit v1.2.3