Kale
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
Kale::Vulkan::Device Class Reference

#include <Device.hpp>

+ Inheritance diagram for Kale::Vulkan::Device:

Public Member Functions

 Device ()
 
 Device (const vk::PhysicalDevice &device)
 
 Device (uint32_t deviceId)
 
void init (const vk::PhysicalDevice &device)
 
void init (uint32_t deviceId)
 
void freeResources ()
 
uint32_t findMemoryType (uint32_t typeFilter, vk::MemoryPropertyFlags properties) const
 
- Public Member Functions inherited from Kale::Vulkan::ParentResource< Device >
virtual ~ParentResource ()
 
void freeChildren ()
 

Static Public Member Functions

static std::vector< vk::PhysicalDevice > availableDevices ()
 
static bool deviceSupported (const vk::PhysicalDevice &physicalDevice)
 

Public Attributes

vk::UniqueDevice logicalDevice
 
vk::PhysicalDeviceProperties physicalDeviceProperties
 
vk::PhysicalDevice physicalDevice
 
std::map< QueueType, vk::Queue > queueMap
 
QueueFamilyIndices queueIndices
 
vk::PhysicalDeviceMemoryProperties memoryProperties
 

Private Member Functions

void createLogicalDevice ()
 
void getQueues ()
 

Additional Inherited Members

- Protected Attributes inherited from Kale::Vulkan::ParentResource< Device >
std::list< ChildResource< Device > * > resources
 

Detailed Description

A simple Kale abstraction over the Vulkan Physical Device and Logical Devices

Definition at line 41 of file Device.hpp.

Constructor & Destructor Documentation

◆ Device() [1/3]

Device::Device ( )

Creates an uninstantiated device

Definition at line 35 of file Device.cpp.

◆ Device() [2/3]

Device::Device ( const vk::PhysicalDevice & device)

Creates a logical device and all appropriate queues given the physical device

Parameters
deviceThe physical device
Exceptions
Ifthe given device is not supported

Definition at line 44 of file Device.cpp.

◆ Device() [3/3]

Device::Device ( uint32_t deviceId)

Creates a logical device and all appropriate queues given the physical device

Parameters
deviceIdThe id of the physical device
Exceptions
Ifthe device was not found

Definition at line 59 of file Device.cpp.

Member Function Documentation

◆ availableDevices()

std::vector< vk::PhysicalDevice > Device::availableDevices ( )
static

Gets all available and supported physical devices

Returns
The available physical devices

Definition at line 191 of file Device.cpp.

◆ createLogicalDevice()

void Device::createLogicalDevice ( )
private

Creates the logical device needed

Definition at line 123 of file Device.cpp.

◆ deviceSupported()

bool Device::deviceSupported ( const vk::PhysicalDevice & physicalDevice)
static

Checks whether or not a given physical device is supported

Parameters
physicalDeviceThe physical device to check support for
Returns
Whether or not the device is supported

Definition at line 204 of file Device.cpp.

◆ findMemoryType()

uint32_t Device::findMemoryType ( uint32_t typeFilter,
vk::MemoryPropertyFlags properties ) const

Finds a memory type given the type filter and properties

Parameters
typeFilterthe filters to apply on the type of memory
propertiesThe properties required for the memory
Exceptions
Ifthe device does not have an applicable memory type

Definition at line 178 of file Device.cpp.

◆ freeResources()

void Device::freeResources ( )

Frees the resources from this device

Definition at line 167 of file Device.cpp.

◆ getQueues()

void Device::getQueues ( )
private

Gets the appropriate queues from the logical device

Definition at line 159 of file Device.cpp.

◆ init() [1/2]

void Device::init ( const vk::PhysicalDevice & device)

Initializes this object

Parameters
deviceThe device to initialize with

Definition at line 83 of file Device.cpp.

◆ init() [2/2]

void Device::init ( uint32_t deviceId)

Initializes this object

Parameters
deviceIdThe device to initialize with

Definition at line 100 of file Device.cpp.

Member Data Documentation

◆ logicalDevice

vk::UniqueDevice Kale::Vulkan::Device::logicalDevice

The logical device created by the physical device

Definition at line 59 of file Device.hpp.

◆ memoryProperties

vk::PhysicalDeviceMemoryProperties Kale::Vulkan::Device::memoryProperties

The memory properties of the device

Definition at line 84 of file Device.hpp.

◆ physicalDevice

vk::PhysicalDevice Kale::Vulkan::Device::physicalDevice

The physical device

Definition at line 69 of file Device.hpp.

◆ physicalDeviceProperties

vk::PhysicalDeviceProperties Kale::Vulkan::Device::physicalDeviceProperties

The device properties

Definition at line 64 of file Device.hpp.

◆ queueIndices

QueueFamilyIndices Kale::Vulkan::Device::queueIndices

All the available queue family indices

Definition at line 79 of file Device.hpp.

◆ queueMap

std::map<QueueType, vk::Queue> Kale::Vulkan::Device::queueMap

A map of all queue types to their appropriate queues

Definition at line 74 of file Device.hpp.


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