Class VulkanPhysicalDevice#

Nested Relationships#

Nested Types#

Class Documentation#

class VulkanPhysicalDevice#

Public Functions

VulkanPhysicalDevice(TRAP::Ref<VulkanInstance> instance, const TRAP::Utils::UUID &physicalDeviceUUID)#

Constructor.

Parameters:
  • instance – Vulkan instance.

  • physicalDeviceUUID – UUID of physical device to create.

~VulkanPhysicalDevice()#

Destructor.

consteval VulkanPhysicalDevice(const VulkanPhysicalDevice&) noexcept = delete#

Copy constructor.

consteval VulkanPhysicalDevice &operator=(const VulkanPhysicalDevice&) noexcept = delete#

Copy assignment operator.

VulkanPhysicalDevice(VulkanPhysicalDevice&&) noexcept = default#

Move constructor.

VulkanPhysicalDevice &operator=(VulkanPhysicalDevice&&) noexcept = default#

Move assignment operator.

constexpr VkPhysicalDevice GetVkPhysicalDevice() const noexcept#

Retrieve the Vulkan physical device handle.

Returns:

Vulkan physical device handle.

constexpr const VkFormatProperties &GetVkPhysicalDeviceFormatProperties(ImageFormat format) const noexcept#

Retrieve the Vulkan physical device format properties for a specific format.

Parameters:

format – Format to retrieve properties for.

Returns:

VkFormatProperties.

TRAP::Optional<VkImageFormatProperties> GetVkPhysicalDeviceImageFormatProperties(ImageFormat format, VkImageType imageType, VkImageUsageFlags imageUsageFlags) const#

Retrieve the Vulkan physical device image format properties for a specific format image type and image usage combination.

Parameters:
  • format – Format to retrieve image properties for.

  • imageType – Vulkan image type.

  • imageUsageFlags – Vulkan image usage flags.

Returns:

VkImageFormatProperties on success, empty optional otherwise.

constexpr const VkPhysicalDeviceProperties &GetVkPhysicalDeviceProperties() const noexcept#

Retrieve the Vulkan physical device properties.

Returns:

VkPhysicalDeviceProperties.

constexpr const VkPhysicalDeviceSubgroupProperties &GetVkPhysicalDeviceSubgroupProperties() const noexcept#

Retrieve the Vulkan physical device subgroup properties.

Returns:

VkPhysicalDeviceSubgroupProperties.

constexpr const VkPhysicalDeviceIDProperties &GetVkPhysicalDeviceIDProperties() const noexcept#

Retrieve the Vulkan physical device id properties.

Returns:

VkPhysicalDeviceIDProperties.

constexpr const VkPhysicalDeviceMemoryProperties &GetVkPhysicalDeviceMemoryProperties() const noexcept#

Retrieve the Vulkan physical device memory properties.

Returns:

VkPhysicalDeviceMemoryProperties.

constexpr const VkPhysicalDeviceFeatures &GetVkPhysicalDeviceFeatures() const noexcept#

Retrieve the Vulkan physical device features.

Returns:

VkPhysicalDeviceFeatures.

constexpr const VkPhysicalDeviceDriverProperties &GetVkPhysicalDeviceDriverProperties() const noexcept#

Retrieve the Vulkan physical device driver properties.

Returns:

VkPhysicalDeviceDriverProperties.

constexpr const std::vector<VkQueueFamilyProperties> &GetQueueFamilyProperties() const noexcept#

Retrieve the Vulkan queue family properties of each queue family.

Returns:

List of VkQueueFamilyProperties.

constexpr bool IsExtensionSupported(std::string_view extension) const#

Check whether an extension is supported by the physical device or not.

Parameters:

extension – Extension to check.

Returns:

True if extension is supported, false otherwise.

constexpr bool IsExtensionSupported(VulkanPhysicalDeviceExtension extension) const#

Check whether an extension is supported by the physical device or not.

Parameters:

extension – Extension to check.

Returns:

True if extension is supported, false otherwise.

constexpr bool IsFeatureEnabled(VulkanPhysicalDeviceFeature feature) const#

Check whether a feature is supported and enabled by the physical device or not.

Parameters:

feature – Feature to check.

Returns:

True if feature is supported and enabled, false otherwise.

constexpr std::optional<VkExtensionProperties> GetPhysicalDeviceExtensionProperties(std::string_view physicalDeviceExtension) const#

Retrieve the properties for the given physical device extension.

Parameters:

physicalDeviceExtension – Physical device extension to get properties from.

Returns:

Physical device extension properties.

bool GetPhysicalDeviceSurfaceSupport(const VulkanSurface &surface, u32 queueFamilyIndex) const#

Retrieve whether the given queue family supports presentation to the given surface.

Parameters:
  • surface – Surface to check for.

  • queueFamilyIndexQueue family to check for.

Returns:

True if presentation is supported, false otherwise.

constexpr TRAP::Utils::UUID GetUUID() const noexcept#

Retrieve the physical device’s UUID.

Returns:

Physical device UUID.

constexpr RendererAPI::GPUVendor GetVendor() const noexcept#

Retrieve the vendor of the physical device.

Returns:

Vendor.

constexpr std::string GetName() const noexcept#

Retrieve the name of the physical device.

Returns:

Vendor.

Public Static Functions

static const std::multimap<u32, RatedVulkanPhysicalDevice> &GetAllRatedPhysicalDevices(const VulkanInstance &instance)#

Retrieve a list of all rated physical devices. Key is the devices score, value is the UUID of the physical device.

Parameters:

instance – Vulkan instance.

Returns:

List of rated physical devices.