diff options
| author | 2021-10-06 02:02:05 -0400 | |
|---|---|---|
| committer | 2021-11-16 22:11:30 +0100 | |
| commit | f8339cd703c2e6d24477be211e1fd91a6e1ef334 (patch) | |
| tree | f02b34bbbbbabe6a5c1f4a8a7cdacbe13a39731f /src/video_core/renderer_vulkan | |
| parent | video_core: Misc resolution scaling related refactoring (diff) | |
| download | yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.gz yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.tar.xz yuzu-f8339cd703c2e6d24477be211e1fd91a6e1ef334.zip | |
vk_texture_cache: Fix early returns on unsupported scales
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 930c7d569..1ab2b1fe9 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1130,13 +1130,19 @@ bool Image::ScaleUp() { | |||
| 1130 | return false; | 1130 | return false; |
| 1131 | } | 1131 | } |
| 1132 | ASSERT(info.type != ImageType::Linear); | 1132 | ASSERT(info.type != ImageType::Linear); |
| 1133 | flags |= ImageFlagBits::Rescaled; | ||
| 1134 | |||
| 1135 | const auto& resolution = runtime->resolution; | 1133 | const auto& resolution = runtime->resolution; |
| 1136 | if (!resolution.active) { | 1134 | if (!resolution.active) { |
| 1137 | return true; | 1135 | return false; |
| 1138 | } | 1136 | } |
| 1139 | const auto& device = runtime->device; | 1137 | const auto& device = runtime->device; |
| 1138 | const PixelFormat format = StorageFormat(info.format); | ||
| 1139 | const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); | ||
| 1140 | const auto similar = device.GetSupportedFormat( | ||
| 1141 | format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), | ||
| 1142 | FormatType::Optimal); | ||
| 1143 | if (similar != format_info.format) { | ||
| 1144 | return true; | ||
| 1145 | } | ||
| 1140 | if (!scaled_image) { | 1146 | if (!scaled_image) { |
| 1141 | const u32 up = resolution.up_scale; | 1147 | const u32 up = resolution.up_scale; |
| 1142 | const u32 down = resolution.down_shift; | 1148 | const u32 down = resolution.down_shift; |
| @@ -1155,23 +1161,9 @@ bool Image::ScaleUp() { | |||
| 1155 | if (aspect_mask == 0) { | 1161 | if (aspect_mask == 0) { |
| 1156 | aspect_mask = ImageAspectMask(info.format); | 1162 | aspect_mask = ImageAspectMask(info.format); |
| 1157 | } | 1163 | } |
| 1158 | if (info.num_samples > 1) { | ||
| 1159 | return true; | ||
| 1160 | } | ||
| 1161 | const PixelFormat format = StorageFormat(info.format); | ||
| 1162 | const auto format_info = MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, format); | ||
| 1163 | const auto similar = device.GetSupportedFormat( | ||
| 1164 | format_info.format, (VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT), | ||
| 1165 | FormatType::Optimal); | ||
| 1166 | |||
| 1167 | if (similar != format_info.format) { | ||
| 1168 | return true; | ||
| 1169 | } | ||
| 1170 | if (aspect_mask == 0) { | ||
| 1171 | aspect_mask = ImageAspectMask(info.format); | ||
| 1172 | } | ||
| 1173 | BlitScale(*scheduler, *original_image, *scaled_image, info, aspect_mask, resolution, true); | 1164 | BlitScale(*scheduler, *original_image, *scaled_image, info, aspect_mask, resolution, true); |
| 1174 | current_image = *scaled_image; | 1165 | current_image = *scaled_image; |
| 1166 | flags |= ImageFlagBits::Rescaled; | ||
| 1175 | return true; | 1167 | return true; |
| 1176 | } | 1168 | } |
| 1177 | 1169 | ||