diff options
| author | vimene <vincent.menegaux@gmail.com> | 2025-12-20 17:25:51 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2025-12-20 17:25:51 +0100 |
| commit | e3a465293b92ed30e220f2c70f67fb9adf3b0403 (patch) | |
| tree | 7b0fa7bd693b467811d8f010c29b159051254beb /src/vulkan_utils.hpp | |
| parent | 8024a6d59a4595f69f03466b66f4ea2eea87fcf9 (diff) | |
| download | engine-e3a465293b92ed30e220f2c70f67fb9adf3b0403.tar.gz | |
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
Diffstat (limited to 'src/vulkan_utils.hpp')
| -rw-r--r-- | src/vulkan_utils.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
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 <ostream> +// I don't know if we should directly include vulkan or not +#define GLFW_INCLUDE_VULKAN +#include <GLFW/glfw3.h> + +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 |
