diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-10-20 18:27:25 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:31 +0100 |
commit | d37d10e7a7b9037a259b27923716e5ce3084d6c3 (patch) | |
tree | 52ee8db37b4eefed3bd24e36bfe7ca7319fc51f5 /src/video_core/texture_cache/util.cpp | |
parent | Presentation: Fix turning FSR on and off in settings (diff) | |
download | yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar.gz yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar.bz2 yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar.lz yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar.xz yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.tar.zst yuzu-d37d10e7a7b9037a259b27923716e5ce3084d6c3.zip |
Diffstat (limited to 'src/video_core/texture_cache/util.cpp')
-rw-r--r-- | src/video_core/texture_cache/util.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 59cf2f561..9922aa0cc 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -723,7 +723,7 @@ ImageViewType RenderTargetImageViewType(const ImageInfo& info) noexcept { } std::vector<ImageCopy> MakeShrinkImageCopies(const ImageInfo& dst, const ImageInfo& src, - SubresourceBase base) { + SubresourceBase base, u32 up_scale, u32 down_shift) { ASSERT(dst.resources.levels >= src.resources.levels); ASSERT(dst.num_samples == src.num_samples); @@ -732,7 +732,7 @@ std::vector<ImageCopy> MakeShrinkImageCopies(const ImageInfo& dst, const ImageIn ASSERT(src.type == ImageType::e3D); ASSERT(src.resources.levels == 1); } - + const bool both_2d{src.type == ImageType::e2D && dst.type == ImageType::e2D}; std::vector<ImageCopy> copies; copies.reserve(src.resources.levels); for (s32 level = 0; level < src.resources.levels; ++level) { @@ -762,6 +762,10 @@ std::vector<ImageCopy> MakeShrinkImageCopies(const ImageInfo& dst, const ImageIn if (is_dst_3d) { copy.extent.depth = src.size.depth; } + copy.extent.width = std::max<u32>((copy.extent.width * up_scale) >> down_shift, 1); + if (both_2d) { + copy.extent.height = std::max<u32>((copy.extent.height * up_scale) >> down_shift, 1); + } } return copies; } |