diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-10-07 08:15:16 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | 89a7e566c7a101d688e96641cc2a485f2da54d4b (patch) | |
tree | 4befc90f801f552f2efba6f477396b6f359524ce /src/video_core | |
parent | vk_texture_cache: Fix early returns on unsupported scales (diff) | |
download | yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar.gz yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar.bz2 yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar.lz yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar.xz yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.tar.zst yuzu-89a7e566c7a101d688e96641cc2a485f2da54d4b.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 10 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 1ab2b1fe9..65506f75e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1137,11 +1137,11 @@ bool Image::ScaleUp() { const auto& device = runtime->device; const PixelFormat format = StorageFormat(info.format); const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); - const auto similar = device.GetSupportedFormat( - format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), - FormatType::Optimal); - if (similar != format_info.format) { - return true; + const auto blit_usage = VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT; + if (!device.IsFormatSupported(format_info.format, blit_usage, FormatType::Optimal)) { + LOG_ERROR(Render_Vulkan, "Device does not support scaling format {}", format); + // TODO: Use helper blits where applicable + return false; } if (!scaled_image) { const u32 up = resolution.up_scale; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 2d5daf6cd..10653ac6b 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -40,6 +40,10 @@ public: VkFormat GetSupportedFormat(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, FormatType format_type) const; + /// Returns true if a format is supported. + bool IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, + FormatType format_type) const; + /// Reports a device loss. void ReportLoss() const; @@ -370,10 +374,6 @@ private: /// Returns true if the device natively supports blitting depth stencil images. bool TestDepthStencilBlits() const; - /// Returns true if a format is supported. - bool IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, - FormatType format_type) const; - VkInstance instance; ///< Vulkan instance. vk::DeviceDispatch dld; ///< Device function pointers. vk::PhysicalDevice physical; ///< Physical device. |