7struct GraphicsBackendInfo;
vk::PhysicalDevice get_physical_device() const
Get physical device handle.
void query_supported_extensions()
Query and log supported device extensions.
const QueueFamilyIndices & get_queue_families() const
Get queue family indices.
bool pick_physical_device(vk::Instance instance, vk::SurfaceKHR temp_surface)
Pick a suitable physical device (GPU)
void cleanup()
Cleanup device resources.
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.
bool create_logical_device(vk::Instance instance, const GraphicsBackendInfo &backend_info)
Create the logical device and retrieve queue handles.
vk::Queue m_transfer_queue
Transfer queue handle.
vk::Device m_logical_device
Logical device handle.
QueueFamilyIndices find_queue_families(vk::PhysicalDevice device, vk::SurfaceKHR surface=nullptr)
Find queue families on the given physical device.
vk::Device get_device() const
Get logical device handle.
bool update_presentation_queue(vk::SurfaceKHR surface)
Update presentation queue family for a specific surface.
bool m_presentation_initialized
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)
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.)
std::optional< uint32_t > transfer_family
std::optional< uint32_t > graphics_family
std::optional< uint32_t > present_family
std::optional< uint32_t > compute_family
Stores indices of queue families we need.