Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::VulkanDevice Class Reference

Manages Vulkan physical and logical device selection and creation. More...

#include <VulkanDevice.h>

Public Member Functions

 VulkanDevice (VkInstance instance, VkSurfaceKHR surface)
 Constructs a VulkanDevice bound to a Vulkan instance and surface.
 ~VulkanDevice ()=default
 Destructor. Defaulted.
void ShutdownDevice ()
 Cleanly shuts down and releases device resources.
VkDevice GetLogicalDevice () const
 Retrieves the Vulkan logical device handle.
VkPhysicalDevice GetPhysicalDevice () const
 Retrieves the Vulkan physical device handle.
VkQueue GetGraphicsQueue () const
 Gets the graphics queue handle.
VkQueue GetPresentQueue () const
 Gets the present queue handle.
VkQueryPool GetQueryPool () const
 Gets the Vulkan query pool.
VkSurfaceKHR GetSurface () const
 Gets the Vulkan surface associated with this device.
bool IsSuitable () const
 Checks whether a suitable physical device was selected.
QueueFamilyIndices FindQueueFamily () const
 Finds queue family indices supporting required operations.
 operator VkPhysicalDevice () const
 Implicit conversion operator to VkPhysicalDevice.
 operator VkDevice () const
 Implicit conversion operator to VkDevice.

Static Public Member Functions

static VulkanDeviceGet ()
 Access singleton instance of VulkanDevice.

Detailed Description

Manages Vulkan physical and logical device selection and creation.

This class abstracts Vulkan device setup including selecting a suitable physical device, creating a logical device, and querying relevant queues. Currently supports a single physical device and handles basic extension requirements.

Note
Future-proofing: Device creation parameters could be abstracted further.

Constructor & Destructor Documentation

◆ VulkanDevice()

Raven::VulkanDevice::VulkanDevice ( VkInstance instance,
VkSurfaceKHR surface )

Constructs a VulkanDevice bound to a Vulkan instance and surface.

Parameters
instanceVulkan instance to associate with.
surfaceVulkan surface to present on.

◆ ~VulkanDevice()

Raven::VulkanDevice::~VulkanDevice ( )
default

Destructor. Defaulted.

Member Function Documentation

◆ FindQueueFamily()

QueueFamilyIndices Raven::VulkanDevice::FindQueueFamily ( ) const

Finds queue family indices supporting required operations.

Returns
QueueFamilyIndices Structure containing graphics and present queue family indices.

◆ Get()

VulkanDevice & Raven::VulkanDevice::Get ( )
inlinestatic

Access singleton instance of VulkanDevice.

Returns
Reference to the global VulkanDevice.

◆ GetGraphicsQueue()

VkQueue Raven::VulkanDevice::GetGraphicsQueue ( ) const
inline

Gets the graphics queue handle.

Returns
VkQueue Queue for graphics operations.

◆ GetLogicalDevice()

VkDevice Raven::VulkanDevice::GetLogicalDevice ( ) const
inline

Retrieves the Vulkan logical device handle.

Returns
VkDevice Logical Vulkan device.

◆ GetPhysicalDevice()

VkPhysicalDevice Raven::VulkanDevice::GetPhysicalDevice ( ) const
inline

Retrieves the Vulkan physical device handle.

Returns
VkPhysicalDevice Physical Vulkan device.

◆ GetPresentQueue()

VkQueue Raven::VulkanDevice::GetPresentQueue ( ) const
inline

Gets the present queue handle.

Returns
VkQueue Queue used for presenting images.

◆ GetQueryPool()

VkQueryPool Raven::VulkanDevice::GetQueryPool ( ) const
inline

Gets the Vulkan query pool.

Returns
VkQueryPool Query pool used for timestamp or occlusion queries.

◆ GetSurface()

VkSurfaceKHR Raven::VulkanDevice::GetSurface ( ) const
inline

Gets the Vulkan surface associated with this device.

Returns
VkSurfaceKHR Vulkan surface.

◆ IsSuitable()

bool Raven::VulkanDevice::IsSuitable ( ) const
inline

Checks whether a suitable physical device was selected.

Returns
true If physical device is valid (not VK_NULL_HANDLE).
false Otherwise.

◆ operator VkDevice()

Raven::VulkanDevice::operator VkDevice ( ) const
inline

Implicit conversion operator to VkDevice.

◆ operator VkPhysicalDevice()

Raven::VulkanDevice::operator VkPhysicalDevice ( ) const
inline

Implicit conversion operator to VkPhysicalDevice.

◆ ShutdownDevice()

void Raven::VulkanDevice::ShutdownDevice ( )

Cleanly shuts down and releases device resources.


The documentation for this class was generated from the following files: