diff options
| author | 2020-12-26 01:32:46 -0300 | |
|---|---|---|
| committer | 2021-01-04 02:22:22 -0300 | |
| commit | ac1e4734c2998e764e4116592510690ee2e8af11 (patch) | |
| tree | 53c1b65212a78637c3a1dcbf27d04ee8315d39c9 /src/video_core | |
| parent | renderer_vulkan/nsight_aftermath_tracker: Move to vulkan_common (diff) | |
| download | yuzu-ac1e4734c2998e764e4116592510690ee2e8af11.tar.gz yuzu-ac1e4734c2998e764e4116592510690ee2e8af11.tar.xz yuzu-ac1e4734c2998e764e4116592510690ee2e8af11.zip | |
vulkan_device: Allow creating a device without surface
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index f300f22c9..75173324e 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -775,7 +775,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) { | |||
| 775 | std::optional<u32> graphics; | 775 | std::optional<u32> graphics; |
| 776 | std::optional<u32> present; | 776 | std::optional<u32> present; |
| 777 | for (u32 index = 0; index < static_cast<u32>(queue_family_properties.size()); ++index) { | 777 | for (u32 index = 0; index < static_cast<u32>(queue_family_properties.size()); ++index) { |
| 778 | if (graphics && present) { | 778 | if (graphics && (present || !surface)) { |
| 779 | break; | 779 | break; |
| 780 | } | 780 | } |
| 781 | const VkQueueFamilyProperties& queue_family = queue_family_properties[index]; | 781 | const VkQueueFamilyProperties& queue_family = queue_family_properties[index]; |
| @@ -785,7 +785,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) { | |||
| 785 | if (queue_family.queueFlags & VK_QUEUE_GRAPHICS_BIT) { | 785 | if (queue_family.queueFlags & VK_QUEUE_GRAPHICS_BIT) { |
| 786 | graphics = index; | 786 | graphics = index; |
| 787 | } | 787 | } |
| 788 | if (physical.GetSurfaceSupportKHR(index, surface)) { | 788 | if (surface && physical.GetSurfaceSupportKHR(index, surface)) { |
| 789 | present = index; | 789 | present = index; |
| 790 | } | 790 | } |
| 791 | } | 791 | } |
| @@ -793,7 +793,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) { | |||
| 793 | LOG_ERROR(Render_Vulkan, "Device lacks a graphics queue"); | 793 | LOG_ERROR(Render_Vulkan, "Device lacks a graphics queue"); |
| 794 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); | 794 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); |
| 795 | } | 795 | } |
| 796 | if (!present) { | 796 | if (surface && !present) { |
| 797 | LOG_ERROR(Render_Vulkan, "Device lacks a present queue"); | 797 | LOG_ERROR(Render_Vulkan, "Device lacks a present queue"); |
| 798 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); | 798 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); |
| 799 | } | 799 | } |