diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 07edf556d..024d5c2de 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp | |||
| @@ -567,20 +567,24 @@ void VKDevice::CheckSuitability() const { | |||
| 567 | LOG_ERROR(Render_Vulkan, "Missing required extension: {}", REQUIRED_EXTENSIONS[i]); | 567 | LOG_ERROR(Render_Vulkan, "Missing required extension: {}", REQUIRED_EXTENSIONS[i]); |
| 568 | throw vk::Exception(VK_ERROR_EXTENSION_NOT_PRESENT); | 568 | throw vk::Exception(VK_ERROR_EXTENSION_NOT_PRESENT); |
| 569 | } | 569 | } |
| 570 | // TODO(Rodrigo): Check if the device matches all requeriments. | 570 | struct LimitTuple { |
| 571 | u32 minimum; | ||
| 572 | u32 value; | ||
| 573 | const char* name; | ||
| 574 | }; | ||
| 571 | const VkPhysicalDeviceLimits& limits{properties.limits}; | 575 | const VkPhysicalDeviceLimits& limits{properties.limits}; |
| 572 | 576 | const std::array limits_report{ | |
| 573 | constexpr u32 required_ubo_size = 65536; | 577 | LimitTuple{65536, limits.maxUniformBufferRange, "maxUniformBufferRange"}, |
| 574 | if (limits.maxUniformBufferRange < required_ubo_size) { | 578 | LimitTuple{16, limits.maxViewports, "maxViewports"}, |
| 575 | LOG_ERROR(Render_Vulkan, "Device UBO size {} is too small, {} is required", | 579 | LimitTuple{8, limits.maxColorAttachments, "maxColorAttachments"}, |
| 576 | limits.maxUniformBufferRange, required_ubo_size); | 580 | LimitTuple{8, limits.maxClipDistances, "maxClipDistances"}, |
| 577 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); | 581 | }; |
| 578 | } | 582 | for (const auto& tuple : limits_report) { |
| 579 | constexpr u32 required_num_viewports = 16; | 583 | if (tuple.value < tuple.minimum) { |
| 580 | if (limits.maxViewports < required_num_viewports) { | 584 | LOG_ERROR(Render_Vulkan, "{} has to be {} or greater but it is {}", tuple.name, |
| 581 | LOG_INFO(Render_Vulkan, "Device number of viewports {} is too small, {} is required", | 585 | tuple.minimum, tuple.value); |
| 582 | limits.maxViewports, required_num_viewports); | 586 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); |
| 583 | throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); | 587 | } |
| 584 | } | 588 | } |
| 585 | const VkPhysicalDeviceFeatures features{physical.GetFeatures()}; | 589 | const VkPhysicalDeviceFeatures features{physical.GetFeatures()}; |
| 586 | const std::array feature_report{ | 590 | const std::array feature_report{ |