13enum class GraphicsDevicePreference : uint8_t;
16namespace pixelbullet::graphics_internal
18inline constexpr uint32_t k_supported_vulkan_api_version = VK_API_VERSION_1_3;
22 uint32_t graphics_family = 0;
23 uint32_t present_family = 0;
24 std::optional<uint32_t> compute_family;
25 std::optional<uint32_t> transfer_family;
30 bool is_compatible =
false;
32 std::vector<std::string> rejection_reasons;
33 std::optional<ResolvedQueueFamilies> queue_families;
38 std::optional<std::size_t> selected_index;
39 bool matched_preference =
false;
40 bool exact_index_requested =
false;
41 bool exact_index_in_range =
false;
46 GraphicsDevicePreference preference;
47 std::optional<std::size_t> exact_device_index;
52 VkPhysicalDevice device = VK_NULL_HANDLE;
53 VkPhysicalDeviceProperties properties = {};
54 std::vector<VkExtensionProperties> available_extensions;
56 bool matches_preference =
false;
57 bool selected =
false;
62 std::vector<PhysicalDeviceDiagnosticsEntry> entries;
63 std::optional<std::size_t> selected_index;
64 bool matched_preference =
false;
68std::string FormatVulkanApiVersion(uint32_t version);
69std::string_view DescribeGraphicsDevicePreference(GraphicsDevicePreference preference)
noexcept;
70std::string_view DescribePhysicalDeviceType(VkPhysicalDeviceType device_type)
noexcept;
71const std::vector<const char*>& GetRequiredGraphicsDeviceExtensions() noexcept;
73std::optional<
ResolvedQueueFamilies> ResolveQueueFamilies(const std::vector<VkQueueFamilyProperties>& queue_family_properties,
74 const std::vector<VkBool32>& present_support) noexcept;
76bool MatchesGraphicsDevicePreference(VkPhysicalDeviceType device_type, GraphicsDevicePreference preference) noexcept;
79 const VkPhysicalDeviceProperties& properties, const std::vector<VkExtensionProperties>& available_extensions,
80 const std::vector<const
char*>& required_extensions, const std::vector<VkQueueFamilyProperties>& queue_family_properties,
81 const std::vector<VkBool32>& present_support, uint32_t surface_format_count, uint32_t present_mode_count);
87std::optional<std::
size_t>
91 const std::vector<VkPhysicalDevice>& devices, const std::vector<VkPhysicalDeviceProperties>& properties,
92 const std::vector<std::vector<VkExtensionProperties>>& available_extensions,
98std::
string BuildUnsupportedPhysicalDeviceMessage(std::
size_t enumerated_device_count);
99std::
string BuildRequestedPhysicalDeviceOutOfRangeMessage(std::
size_t requested_index, std::
size_t enumerated_device_count);
100std::
string BuildRequestedPhysicalDeviceIncompatibleMessage(std::
size_t requested_index, const VkPhysicalDeviceProperties& properties,
101 const std::vector<std::
string>& rejection_reasons);
Definition physical_device_internal.h:29
Definition physical_device_internal.h:51
Definition physical_device_internal.h:61
Definition physical_device_internal.h:45
Definition physical_device_internal.h:37
Definition physical_device_internal.h:21