summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-12-25 06:27:57 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-12-31 06:07:33 +0100
commit085adfea00a525796a3bf4b2dd345e1df656c930 (patch)
treef606a6c4fb19bf3207e9fe36b692c7c17d3fcca9 /src/video_core/vulkan_common
parentrenderer_vulkan: Initialize surface in separate file (diff)
downloadyuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar.gz
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar.bz2
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar.lz
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar.xz
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.tar.zst
yuzu-085adfea00a525796a3bf4b2dd345e1df656c930.zip
Diffstat (limited to 'src/video_core/vulkan_common')
-rw-r--r--src/video_core/vulkan_common/vulkan_instance.cpp2
-rw-r--r--src/video_core/vulkan_common/vulkan_instance.h2
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp12
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.h3
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
}
} // Anonymous namespace
-std::pair<vk::Instance, u32> CreateInstance(Common::DynamicLibrary& library,
+std::pair<vk::Instance, u32> CreateInstance(const Common::DynamicLibrary& library,
vk::InstanceDispatch& dld,
Core::Frontend::WindowSystemType window_type,
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 @@
namespace Vulkan {
[[nodiscard]] std::pair<vk::Instance, u32> CreateInstance(
- Common::DynamicLibrary& library, vk::InstanceDispatch& dld,
+ const Common::DynamicLibrary& library, vk::InstanceDispatch& dld,
Core::Frontend::WindowSystemType window_type = Core::Frontend::WindowSystemType::Headless,
bool enable_debug_utils = false, bool enable_layers = false);
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
return Instance(instance, dispatch);
}
-std::optional<std::vector<VkPhysicalDevice>> Instance::EnumeratePhysicalDevices() const {
+std::vector<VkPhysicalDevice> Instance::EnumeratePhysicalDevices() const {
u32 num;
- if (dld->vkEnumeratePhysicalDevices(handle, &num, nullptr) != VK_SUCCESS) {
- return std::nullopt;
- }
+ Check(dld->vkEnumeratePhysicalDevices(handle, &num, nullptr));
std::vector<VkPhysicalDevice> physical_devices(num);
- if (dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data()) != VK_SUCCESS) {
- return std::nullopt;
- }
+ Check(dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data()));
SortPhysicalDevices(physical_devices, *dld);
- return std::make_optional(std::move(physical_devices));
+ return physical_devices;
}
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:
/// Enumerates physical devices.
/// @return Physical devices and an empty handle on failure.
- std::optional<std::vector<VkPhysicalDevice>> EnumeratePhysicalDevices() const;
+ /// @throw Exception on Vulkan error.
+ std::vector<VkPhysicalDevice> EnumeratePhysicalDevices() const;
/// Creates a debug callback messenger.
/// @throw Exception on creation failure.