| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

LogicalDevice.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "FlingVulkan.h"
4
5 namespace Fling
6 {
7 class PhysicalDevice;
8 class Instance;
9
13 class LogicalDevice
14 {
15 public:
16
17 explicit LogicalDevice(class Instance* t_Instance, class PhysicalDevice* t_PhysDevice, const VkSurfaceKHR t_Surface);
18
19 ~LogicalDevice();
20
21 const VkDevice& GetVkDevice() const { return m_Device; }
22
23 const VkQueue& GetGraphicsQueue() const { return m_GraphicsQueue; }
24 const VkQueue& GetPresentQueue() const { return m_PresentQueue; }
25
26 const VkQueueFlags& GetSupportedQueues() const { return m_SupportedQueues; }
27
28 const PhysicalDevice* GetPhysicalDevice() const { return m_PhysicalDevice; }
29 const Instance* GetInstance() const { return m_Instance; }
30
31 UINT32 GetGraphicsFamily() const { return m_GraphicsFamily; }
32 UINT32 GetPresentFamily() const { return m_PresentFamily; }
33
34 void WaitForIdle();
35
36
37 private:
38
40 VkDevice m_Device = VK_NULL_HANDLE;
41
42 const Instance* m_Instance;
43 const PhysicalDevice* m_PhysicalDevice;
44 const VkSurfaceKHR m_Surface;
45
47 VkQueue m_GraphicsQueue = VK_NULL_HANDLE;
48
50 VkQueue m_PresentQueue = VK_NULL_HANDLE;
51
53 VkQueueFlags m_SupportedQueues{};
54 UINT32 m_GraphicsFamily = 0;
55 UINT32 m_PresentFamily = 0;
56 UINT32 m_ComputeFamily = 0;
57 UINT32 m_TransferFamily = 0;
58
62 void CreateQueueIndecies();
63
67 void CreateDevice();
68 };
69 } // namespace Fling
FlingVulkan.h
Fling::LogicalDevice::WaitForIdle
void WaitForIdle()
Definition: LogicalDevice.cpp:132
Fling::LogicalDevice::m_Surface
const VkSurfaceKHR m_Surface
Definition: LogicalDevice.h:44
Fling::LogicalDevice::m_SupportedQueues
VkQueueFlags m_SupportedQueues
Queue families.
Definition: LogicalDevice.h:53
Fling::LogicalDevice::m_GraphicsFamily
UINT32 m_GraphicsFamily
Definition: LogicalDevice.h:54
Fling::LogicalDevice::GetVkDevice
const VkDevice & GetVkDevice() const
Definition: LogicalDevice.h:21
Fling::PhysicalDevice
A physical device represents the Vulkan physical device (the GPU) that we are currently using...
Definition: PhyscialDevice.h:11
Fling::LogicalDevice::m_GraphicsQueue
VkQueue m_GraphicsQueue
Handle for the graphics queue.
Definition: LogicalDevice.h:47
Fling::LogicalDevice
A logical device represents the application view of the device.
Definition: LogicalDevice.h:13
Fling::Instance
The instance is a representation of this application graphics instance in Vulkan. ...
Definition: Instance.h:11
Fling::LogicalDevice::CreateQueueIndecies
void CreateQueueIndecies()
Get what queue Indecies/families this device should use.
Definition: LogicalDevice.cpp:18
Fling::LogicalDevice::m_PhysicalDevice
const PhysicalDevice * m_PhysicalDevice
Definition: LogicalDevice.h:43
Fling::LogicalDevice::GetPresentQueue
const VkQueue & GetPresentQueue() const
Definition: LogicalDevice.h:24
Fling::LogicalDevice::LogicalDevice
LogicalDevice(class Instance *t_Instance, class PhysicalDevice *t_PhysDevice, const VkSurfaceKHR t_Surface)
Definition: LogicalDevice.cpp:8
Fling::LogicalDevice::m_Instance
const Instance * m_Instance
Definition: LogicalDevice.h:42
Fling::LogicalDevice::~LogicalDevice
~LogicalDevice()
Definition: LogicalDevice.cpp:137
Fling::LogicalDevice::GetInstance
const Instance * GetInstance() const
Definition: LogicalDevice.h:29
Fling::LogicalDevice::GetGraphicsQueue
const VkQueue & GetGraphicsQueue() const
Definition: LogicalDevice.h:23
Fling::LogicalDevice::GetPresentFamily
UINT32 GetPresentFamily() const
Definition: LogicalDevice.h:32
Fling::LogicalDevice::GetSupportedQueues
const VkQueueFlags & GetSupportedQueues() const
Definition: LogicalDevice.h:26
Fling::LogicalDevice::m_Device
VkDevice m_Device
The vulkan logical device.
Definition: LogicalDevice.h:40
Fling::LogicalDevice::GetPhysicalDevice
const PhysicalDevice * GetPhysicalDevice() const
Definition: LogicalDevice.h:28
Fling::LogicalDevice::GetGraphicsFamily
UINT32 GetGraphicsFamily() const
Definition: LogicalDevice.h:31
Fling::LogicalDevice::m_ComputeFamily
UINT32 m_ComputeFamily
Definition: LogicalDevice.h:56
Fling::LogicalDevice::m_PresentQueue
VkQueue m_PresentQueue
Handle to the presentation queue.
Definition: LogicalDevice.h:50
UINT32
uint32_t UINT32
Definition: FlingTypes.h:13
Fling::LogicalDevice::m_PresentFamily
UINT32 m_PresentFamily
Definition: LogicalDevice.h:55
Fling
Definition: Engine.h:29
Fling::LogicalDevice::m_TransferFamily
UINT32 m_TransferFamily
Definition: LogicalDevice.h:57
Fling::LogicalDevice::CreateDevice
void CreateDevice()
Create the Vk resoruces for this logical device.
Definition: LogicalDevice.cpp:79