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

PhyscialDevice.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "FlingVulkan.h"
4
5 namespace Fling
6 {
11 class PhysicalDevice
12 {
13 public:
14
15 explicit PhysicalDevice(class Instance* t_Instance);
16
18 ~PhysicalDevice() noexcept = default;
19
20 operator const VkPhysicalDevice &() const { return m_PhysicalDevice; }
21 const VkPhysicalDevice& GetVkPhysicalDevice() const { return m_PhysicalDevice; }
22
23 const VkPhysicalDeviceProperties& GetDeviceProps() const { return m_DeviceProperties; }
24 const VkPhysicalDeviceFeatures& GetDeivceFeatures() const { return m_DeviceFeatures; }
25
32 static const char* GetDeviceType(VkPhysicalDeviceProperties t_Props);
33
34 static const char* GetDeviceVendor(VkPhysicalDeviceProperties t_Props);
35
37 void LogPhysicalDeviceInfo();
38
42 VkFormatProperties GetFormatProperties(VkFormat t_Form) const;
43
44 VkSampleCountFlagBits GetMaxUsableSampleCount();
45
46 VkBool32 GetSupportedDepthFormat(VkFormat* depthFormat) const;
47
48 private:
49
54 VkPhysicalDevice ChooseBestPhyscialDevice(std::vector<VkPhysicalDevice>& t_AvailableDevices);
55
57 VkPhysicalDevice m_PhysicalDevice = VK_NULL_HANDLE;
58
60 const class Instance* m_Instance;
61
63 VkPhysicalDeviceProperties m_DeviceProperties{};
64 VkPhysicalDeviceFeatures m_DeviceFeatures{};
65 VkPhysicalDeviceMemoryProperties m_MemoryProperties{};
66
68 VkSampleCountFlagBits m_MSAASamples = VK_SAMPLE_COUNT_1_BIT;
69 };
70 } // namespace Fling
FlingVulkan.h
Fling::PhysicalDevice::m_MSAASamples
VkSampleCountFlagBits m_MSAASamples
The max supported MSSA level on this device.
Definition: PhyscialDevice.h:68
Fling::PhysicalDevice::m_DeviceProperties
VkPhysicalDeviceProperties m_DeviceProperties
Misc.
Definition: PhyscialDevice.h:63
Fling::PhysicalDevice::PhysicalDevice
PhysicalDevice(class Instance *t_Instance)
Definition: PhyscialDevice.cpp:11
Fling::PhysicalDevice::~PhysicalDevice
~PhysicalDevice() noexcept=default
The physical device will get cleaned up when the Instance does automatically.
Fling::PhysicalDevice
A physical device represents the Vulkan physical device (the GPU) that we are currently using...
Definition: PhyscialDevice.h:11
Fling::PhysicalDevice::GetDeivceFeatures
const VkPhysicalDeviceFeatures & GetDeivceFeatures() const
Definition: PhyscialDevice.h:24
Fling::Instance
The instance is a representation of this application graphics instance in Vulkan. ...
Definition: Instance.h:11
Fling::PhysicalDevice::GetFormatProperties
VkFormatProperties GetFormatProperties(VkFormat t_Form) const
Checks hte given format properties that are supported on this physical device.
Definition: PhyscialDevice.cpp:42
Fling::PhysicalDevice::m_Instance
const class Instance * m_Instance
Owning instance of this physical device.
Definition: PhyscialDevice.h:60
Fling::PhysicalDevice::LogPhysicalDeviceInfo
void LogPhysicalDeviceInfo()
Logs info about this physical device (vendor, model, ID, etc) to the console/Log file.
Definition: PhyscialDevice.cpp:89
Fling::PhysicalDevice::GetSupportedDepthFormat
VkBool32 GetSupportedDepthFormat(VkFormat *depthFormat) const
Definition: PhyscialDevice.cpp:137
Fling::PhysicalDevice::m_MemoryProperties
VkPhysicalDeviceMemoryProperties m_MemoryProperties
Definition: PhyscialDevice.h:65
Fling::PhysicalDevice::GetMaxUsableSampleCount
VkSampleCountFlagBits GetMaxUsableSampleCount()
Definition: PhyscialDevice.cpp:121
Fling::PhysicalDevice::ChooseBestPhyscialDevice
VkPhysicalDevice ChooseBestPhyscialDevice(std::vector< VkPhysicalDevice > &t_AvailableDevices)
Choose the best available physical device on this machine favoring discrete GPU&#39;s and those who match...
Definition: PhyscialDevice.cpp:164
Fling::PhysicalDevice::GetDeviceProps
const VkPhysicalDeviceProperties & GetDeviceProps() const
Definition: PhyscialDevice.h:23
Fling::PhysicalDevice::m_DeviceFeatures
VkPhysicalDeviceFeatures m_DeviceFeatures
Definition: PhyscialDevice.h:64
Fling::PhysicalDevice::GetVkPhysicalDevice
const VkPhysicalDevice & GetVkPhysicalDevice() const
Definition: PhyscialDevice.h:21
Fling
Definition: Engine.h:29
Fling::PhysicalDevice::GetDeviceType
static const char * GetDeviceType(VkPhysicalDeviceProperties t_Props)
Get a string representing the device vendor.
Definition: PhyscialDevice.cpp:50
Fling::PhysicalDevice::m_PhysicalDevice
VkPhysicalDevice m_PhysicalDevice
The Vulkan physical device.
Definition: PhyscialDevice.h:57
Fling::PhysicalDevice::GetDeviceVendor
static const char * GetDeviceVendor(VkPhysicalDeviceProperties t_Props)
Definition: PhyscialDevice.cpp:71