TheAtlasEngine
 
Loading...
Searching...
No Matches
vk_driver.hpp
1#pragma once
2#include <vulkan/vulkan.h>
3#include <drivers/vulkan-cpp/vk_physical_driver.hpp>
4
5namespace atlas::vk {
6
20 class vk_driver {
21 struct device_queue_family {
22 VkQueue graphics_queue;
23 VkQueue transfer_queue;
24 VkQueue compute_queue;
25 };
26
27 public:
28 vk_driver() = default;
29
35 vk_driver(const vk_physical_driver& p_physical);
36 ~vk_driver() = default;
37
41 [[nodiscard]] VkQueue graphics_queue() const {
42 return m_device_queues.graphics_queue;
43 }
44
48 uint32_t select_memory_type(uint32_t p_type_filter,
49 VkMemoryPropertyFlags p_property_flag);
50
51 void destroy();
52
58 [[nodiscard]] VkFormat depth_format() const;
59
66 operator VkDevice() const { return m_driver; }
67
74 operator VkDevice() { return m_driver; }
75
76 private:
77 vk_physical_driver m_physical{};
78 VkDevice m_driver = nullptr;
79 device_queue_family m_device_queues{};
80 VkFormat m_depth_format_selected;
81 };
82
83};
logical device implementation wrapper around the VkDevice
Definition vk_driver.hpp:20
uint32_t select_memory_type(uint32_t p_type_filter, VkMemoryPropertyFlags p_property_flag)
VkQueue graphics_queue() const
returns the specified graphics queue from this logical device
Definition vk_driver.hpp:41
vk_driver(const vk_physical_driver &p_physical)
construct a new logical device
VkFormat depth_format() const
gives you the depth format from the logical device
vulkan-specific implementation wrapper around VkPhysicalDevice
Definition vk_physical_driver.hpp:23