7struct GraphicsBackendInfo;
89 [[nodiscard]] vk::PhysicalDevice get_physical_device()
const {
return m_physical_device; }
94 [[nodiscard]] vk::Device
get_device()
const {
return m_logical_device; }
131 [[nodiscard]]
bool graphics_family_can_present(vk::SurfaceKHR surface)
const;
142 [[nodiscard]] vk::Queue get_present_queue(uint32_t family_index)
const;
148 [[nodiscard]] vk::Queue get_preferred_present_queue()
const;
155 if (m_logical_device) {
156 m_logical_device.waitIdle();
163 void query_supported_extensions();
205 bool m_graphics_presents {};
208 std::array<uint8_t, VK_UUID_SIZE> m_device_uuid {};
209 bool m_supports_mesh_shaders {};
vk::PhysicalDevice device
const std::string & get_device_name() const
Name of the selected physical device.
bool graphics_family_presents() const
Whether the graphics queue family passed the surfaceless presentation probe.
const QueueFamilyIndices & get_queue_families() const
Get queue family indices.
VKDevice & operator=(const VKDevice &)=delete
VKDevice(const VKDevice &)=delete
vk::PhysicalDevice m_physical_device
Selected physical device (GPU)
vk::Queue m_compute_queue
Compute queue handle.
vk::Queue m_transfer_queue
Transfer queue handle.
vk::Device m_logical_device
Logical device handle.
vk::Device get_device() const
Get logical device handle.
std::unordered_map< uint32_t, vk::Queue > m_present_queues
One queue per presentation-capable family.
std::string m_device_name
Selected device name, cached for logging.
vk::Queue m_graphics_queue
Graphics queue handle.
vk::Queue get_graphics_queue() const
Get graphics queue.
vk::Queue get_compute_queue() const
Get compute queue (may be same as graphics)
vk::Queue get_transfer_queue() const
Get transfer queue (may be same as graphics)
bool supports_mesh_shaders() const
Check if the device supports mesh shaders.
QueueFamilyIndices m_queue_families
Indices of required queue families.
void wait_idle() const
Wait for the device to become idle.
Manages Vulkan physical device selection and logical device creation.
Configuration for graphics API backend (Vulkan/OpenGL/etc.)
static constexpr uint32_t MAX_TRACKED_FAMILIES
Width of present_family_mask.
bool can_present(uint32_t index) const
Whether family index can present.
std::optional< uint32_t > transfer_family
std::optional< uint32_t > graphics_family
uint32_t present_family_mask
Bit i set when family i passed the surfaceless presentation probe.
std::optional< uint32_t > preferred_present_family() const
Family the engine presents on by default.
std::optional< uint32_t > compute_family
Stores indices of queue families we need.