diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-26 06:09:55 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-31 06:07:34 +0100 |
commit | 7344a7c447af2591c393e69d39892dab217196d3 (patch) | |
tree | 6725b1689cdbf88cbd2b565c7f01ed4b5565974d /src/video_core/renderer_vulkan | |
parent | vk_device: Stop initialization when device is not suitable (diff) | |
download | yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar.gz yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar.bz2 yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar.lz yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar.xz yuzu-7344a7c447af2591c393e69d39892dab217196d3.tar.zst yuzu-7344a7c447af2591c393e69d39892dab217196d3.zip |
Diffstat (limited to '')
-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 { LOG_ERROR(Render_Vulkan, "Missing required extension: {}", REQUIRED_EXTENSIONS[i]); throw vk::Exception(VK_ERROR_EXTENSION_NOT_PRESENT); } - // TODO(Rodrigo): Check if the device matches all requeriments. + struct LimitTuple { + u32 minimum; + u32 value; + const char* name; + }; const VkPhysicalDeviceLimits& limits{properties.limits}; - - constexpr u32 required_ubo_size = 65536; - if (limits.maxUniformBufferRange < required_ubo_size) { - LOG_ERROR(Render_Vulkan, "Device UBO size {} is too small, {} is required", - limits.maxUniformBufferRange, required_ubo_size); - throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); - } - constexpr u32 required_num_viewports = 16; - if (limits.maxViewports < required_num_viewports) { - LOG_INFO(Render_Vulkan, "Device number of viewports {} is too small, {} is required", - limits.maxViewports, required_num_viewports); - throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); + const std::array limits_report{ + LimitTuple{65536, limits.maxUniformBufferRange, "maxUniformBufferRange"}, + LimitTuple{16, limits.maxViewports, "maxViewports"}, + LimitTuple{8, limits.maxColorAttachments, "maxColorAttachments"}, + LimitTuple{8, limits.maxClipDistances, "maxClipDistances"}, + }; + for (const auto& tuple : limits_report) { + if (tuple.value < tuple.minimum) { + LOG_ERROR(Render_Vulkan, "{} has to be {} or greater but it is {}", tuple.name, + tuple.minimum, tuple.value); + throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT); + } } const VkPhysicalDeviceFeatures features{physical.GetFeatures()}; const std::array feature_report{ |