diff options
author | Chuyan Zhang <me@zcy.moe> | 2024-09-06 01:50:30 -0700 |
---|---|---|
committer | Chuyan Zhang <me@zcy.moe> | 2024-09-06 01:50:30 -0700 |
commit | e12ca33626bdadedc3158cb69f2a4d2f9bbeeeb0 (patch) | |
tree | 1e7803cbdd48b8a2de355916f042f7b77325f920 /src/vulkan_helper.h | |
parent | 8c7926588b616988e7b016eaf704acee0ee77cc9 (diff) | |
download | iris-e12ca33626bdadedc3158cb69f2a4d2f9bbeeeb0.tar.gz iris-e12ca33626bdadedc3158cb69f2a4d2f9bbeeeb0.zip |
setup swapchain
Diffstat (limited to 'src/vulkan_helper.h')
-rw-r--r-- | src/vulkan_helper.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/vulkan_helper.h b/src/vulkan_helper.h new file mode 100644 index 0000000..089a09f --- /dev/null +++ b/src/vulkan_helper.h @@ -0,0 +1,30 @@ +#include <cstdint> +#include <vulkan/vulkan_core.h> +#include <vector> +#include <string> + +#define CHECK_VULKAN(result) \ + do { \ + VkResult res = result; \ + if (res != VK_SUCCESS) { \ + /* TODO: throw error instead of returning */ \ + std::cerr << "Vulkan error: " << res << std::endl; \ + abort(); \ + } \ + } while (0) + +namespace iris { + +struct Device { + VkInstance instance; + VkPhysicalDevice physical_device; + VkDevice device; + uint32_t main_queue_family_index; + VkQueue graphics_queue; + + Device( + std::vector<std::string> layers, + std::vector<std::string> instance_extensions); +}; + +} // namespace iris
\ No newline at end of file |