diff options
Diffstat (limited to 'src/video_core/vulkan_common')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_instance.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_instance.h | 2 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.h | 3 |
4 files changed, 8 insertions, 11 deletions
diff --git a/src/video_core/vulkan_common/vulkan_instance.cpp b/src/video_core/vulkan_common/vulkan_instance.cpp index d3d8630e5..ee46fc6cc 100644 --- a/src/video_core/vulkan_common/vulkan_instance.cpp +++ b/src/video_core/vulkan_common/vulkan_instance.cpp | |||
| @@ -111,7 +111,7 @@ void RemoveUnavailableLayers(const vk::InstanceDispatch& dld, std::vector<const | |||
| 111 | } | 111 | } |
| 112 | } // Anonymous namespace | 112 | } // Anonymous namespace |
| 113 | 113 | ||
| 114 | std::pair<vk::Instance, u32> CreateInstance(Common::DynamicLibrary& library, | 114 | std::pair<vk::Instance, u32> CreateInstance(const Common::DynamicLibrary& library, |
| 115 | vk::InstanceDispatch& dld, | 115 | vk::InstanceDispatch& dld, |
| 116 | Core::Frontend::WindowSystemType window_type, | 116 | Core::Frontend::WindowSystemType window_type, |
| 117 | bool enable_debug_utils, bool enable_layers) { | 117 | bool enable_debug_utils, bool enable_layers) { |
diff --git a/src/video_core/vulkan_common/vulkan_instance.h b/src/video_core/vulkan_common/vulkan_instance.h index ff2be0a48..5acca9756 100644 --- a/src/video_core/vulkan_common/vulkan_instance.h +++ b/src/video_core/vulkan_common/vulkan_instance.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | namespace Vulkan { | 14 | namespace Vulkan { |
| 15 | 15 | ||
| 16 | [[nodiscard]] std::pair<vk::Instance, u32> CreateInstance( | 16 | [[nodiscard]] std::pair<vk::Instance, u32> CreateInstance( |
| 17 | Common::DynamicLibrary& library, vk::InstanceDispatch& dld, | 17 | const Common::DynamicLibrary& library, vk::InstanceDispatch& dld, |
| 18 | Core::Frontend::WindowSystemType window_type = Core::Frontend::WindowSystemType::Headless, | 18 | Core::Frontend::WindowSystemType window_type = Core::Frontend::WindowSystemType::Headless, |
| 19 | bool enable_debug_utils = false, bool enable_layers = false); | 19 | bool enable_debug_utils = false, bool enable_layers = false); |
| 20 | 20 | ||
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index f4177537b..8698c3f92 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp | |||
| @@ -465,17 +465,13 @@ Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char | |||
| 465 | return Instance(instance, dispatch); | 465 | return Instance(instance, dispatch); |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | std::optional<std::vector<VkPhysicalDevice>> Instance::EnumeratePhysicalDevices() const { | 468 | std::vector<VkPhysicalDevice> Instance::EnumeratePhysicalDevices() const { |
| 469 | u32 num; | 469 | u32 num; |
| 470 | if (dld->vkEnumeratePhysicalDevices(handle, &num, nullptr) != VK_SUCCESS) { | 470 | Check(dld->vkEnumeratePhysicalDevices(handle, &num, nullptr)); |
| 471 | return std::nullopt; | ||
| 472 | } | ||
| 473 | std::vector<VkPhysicalDevice> physical_devices(num); | 471 | std::vector<VkPhysicalDevice> physical_devices(num); |
| 474 | if (dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data()) != VK_SUCCESS) { | 472 | Check(dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data())); |
| 475 | return std::nullopt; | ||
| 476 | } | ||
| 477 | SortPhysicalDevices(physical_devices, *dld); | 473 | SortPhysicalDevices(physical_devices, *dld); |
| 478 | return std::make_optional(std::move(physical_devices)); | 474 | return physical_devices; |
| 479 | } | 475 | } |
| 480 | 476 | ||
| 481 | DebugUtilsMessenger Instance::CreateDebugUtilsMessenger( | 477 | DebugUtilsMessenger Instance::CreateDebugUtilsMessenger( |
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 012982a3f..af3083c84 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h | |||
| @@ -580,7 +580,8 @@ public: | |||
| 580 | 580 | ||
| 581 | /// Enumerates physical devices. | 581 | /// Enumerates physical devices. |
| 582 | /// @return Physical devices and an empty handle on failure. | 582 | /// @return Physical devices and an empty handle on failure. |
| 583 | std::optional<std::vector<VkPhysicalDevice>> EnumeratePhysicalDevices() const; | 583 | /// @throw Exception on Vulkan error. |
| 584 | std::vector<VkPhysicalDevice> EnumeratePhysicalDevices() const; | ||
| 584 | 585 | ||
| 585 | /// Creates a debug callback messenger. | 586 | /// Creates a debug callback messenger. |
| 586 | /// @throw Exception on creation failure. | 587 | /// @throw Exception on creation failure. |