diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-10-12 05:55:53 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-16 22:11:30 +0100 |
commit | b14f2c7c826b8bbea02c1f2674ab024a5ae0695e (patch) | |
tree | 31003de06fb599ba66ff2df462ca949319ede11a /src/video_core/texture_cache | |
parent | yuzu_cmd: Read resolution_setup and scaling_filter from config (diff) | |
download | yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar.gz yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar.bz2 yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar.lz yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar.xz yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.tar.zst yuzu-b14f2c7c826b8bbea02c1f2674ab024a5ae0695e.zip |
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index de522cc43..38895c2e9 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -475,12 +475,10 @@ void TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, Image& dst_image = slot_images[dst_id]; Image& src_image = slot_images[src_id]; - - bool is_resolve = src_image.info.num_samples != 1 && dst_image.info.num_samples == 1; - bool is_src_rescaled = True(src_image.flags & ImageFlagBits::Rescaled); bool is_dst_rescaled = True(dst_image.flags & ImageFlagBits::Rescaled); + const bool is_resolve = src_image.info.num_samples != 1 && dst_image.info.num_samples == 1; if (is_src_rescaled != is_dst_rescaled) { if (ImageCanRescale(src_image)) { ScaleUp(src_image); @@ -498,7 +496,13 @@ void TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, is_dst_rescaled = True(dst_image.flags & ImageFlagBits::Rescaled); } } - + if (is_resolve && (is_src_rescaled != is_dst_rescaled)) { + // A resolve requires both images to be the same dimensions. Resize down if needed. + ScaleDown(src_image); + ScaleDown(dst_image); + is_src_rescaled = True(src_image.flags & ImageFlagBits::Rescaled); + is_dst_rescaled = True(dst_image.flags & ImageFlagBits::Rescaled); + } const auto& resolution = Settings::values.resolution_info; const auto scale_up = [&](u32 value) -> u32 { if (value == 0) { @@ -506,7 +510,6 @@ void TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, } return std::max<u32>((value * resolution.up_scale) >> resolution.down_shift, 1U); }; - const auto scale_region = [&](Region2D& region) { region.start.x = scale_up(region.start.x); region.start.y = scale_up(region.start.y); |