summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-10-12 06:35:01 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:31 +0100
commitabd07e41582b6d8f7efdedb936cdd7a7fddf9912 (patch)
tree4b1b3c2a676abc935517b669566068270029b6d3 /src/video_core/renderer_vulkan
parenttexture_cache: Fix image resolves when src/dst are not both scaled (diff)
downloadyuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.gz
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.bz2
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.lz
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.xz
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.tar.zst
yuzu-abd07e41582b6d8f7efdedb936cdd7a7fddf9912.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 65506f75e..caefce5fc 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -607,16 +607,13 @@ void BlitScale(VKScheduler& scheduler, VkImage src_image, VkImage dst_image, con
scheduler.RequestOutsideRenderPassOperationContext();
scheduler.Record([dst_image, src_image, extent, resources, aspect_mask, resolution, type,
scaling, vk_filter](vk::CommandBuffer cmdbuf) {
- const auto scale_up = [&](u32 value) {
- return std::max<u32>((value * resolution.up_scale) >> resolution.down_shift, 1U);
- };
const VkOffset2D src_size{
- .x = static_cast<s32>(scaling ? extent.width : scale_up(extent.width)),
- .y = static_cast<s32>(scaling ? extent.height : scale_up(extent.height)),
+ .x = static_cast<s32>(scaling ? extent.width : resolution.ScaleUp(extent.width)),
+ .y = static_cast<s32>(scaling ? extent.height : resolution.ScaleUp(extent.height)),
};
const VkOffset2D dst_size{
- .x = static_cast<s32>(scaling ? scale_up(extent.width) : extent.width),
- .y = static_cast<s32>(scaling ? scale_up(extent.height) : extent.height),
+ .x = static_cast<s32>(scaling ? resolution.ScaleUp(extent.width) : extent.width),
+ .y = static_cast<s32>(scaling ? resolution.ScaleUp(extent.height) : extent.height),
};
boost::container::small_vector<VkImageBlit, 4> regions;
regions.reserve(resources.levels);
@@ -1144,13 +1141,9 @@ bool Image::ScaleUp() {
return false;
}
if (!scaled_image) {
- const u32 up = resolution.up_scale;
- const u32 down = resolution.down_shift;
- const auto scale = [&](u32 value) { return std::max<u32>((value * up) >> down, 1U); };
-
const bool is_2d = info.type == ImageType::e2D;
- const u32 scaled_width = scale(info.size.width);
- const u32 scaled_height = is_2d ? scale(info.size.height) : info.size.height;
+ const u32 scaled_width = resolution.ScaleUp(info.size.width);
+ const u32 scaled_height = is_2d ? resolution.ScaleUp(info.size.height) : info.size.height;
auto scaled_info = info;
scaled_info.size.width = scaled_width;
scaled_info.size.height = scaled_height;