diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-11-06 11:08:22 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-11-24 20:35:44 +0100 |
commit | 5fbd6954efbfe3dd95fcd496cd25664c092947fc (patch) | |
tree | ca9c4a7e1855b4406531eada1e84b6cb26802122 /src/video_core/engines/fermi_2d.cpp | |
parent | Fermi2D: Rework blit engine and add a software blitter. (diff) | |
download | yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar.gz yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar.bz2 yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar.lz yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar.xz yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.tar.zst yuzu-5fbd6954efbfe3dd95fcd496cd25664c092947fc.zip |
Diffstat (limited to 'src/video_core/engines/fermi_2d.cpp')
-rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 2c722c778..c6478ae85 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp @@ -62,11 +62,15 @@ void Fermi2D::Blit() { const auto& args = regs.pixels_from_memory; constexpr s64 null_derivate = 1ULL << 32; + Surface src = regs.src; + const auto bytes_per_pixel = BytesPerBlock(PixelFormatFromRenderTargetFormat(src.format)); + const bool delegate_to_gpu = src.width > 512 && src.height > 512 && bytes_per_pixel <= 8 && + src.format != regs.dst.format; Config config{ .operation = regs.operation, .filter = args.sample_mode.filter, - .must_accelerate = args.du_dx != null_derivate || args.dv_dy != null_derivate || - args.sample_mode.filter == Filter::Bilinear, + .must_accelerate = + args.du_dx != null_derivate || args.dv_dy != null_derivate || delegate_to_gpu, .dst_x0 = args.dst_x0, .dst_y0 = args.dst_y0, .dst_x1 = args.dst_x0 + args.dst_width, @@ -76,8 +80,7 @@ void Fermi2D::Blit() { .src_x1 = static_cast<s32>((args.du_dx * args.dst_width + args.src_x0) >> 32), .src_y1 = static_cast<s32>((args.dv_dy * args.dst_height + args.src_y0) >> 32), }; - Surface src = regs.src; - const auto bytes_per_pixel = BytesPerBlock(PixelFormatFromRenderTargetFormat(src.format)); + const auto need_align_to_pitch = src.linear == Tegra::Engines::Fermi2D::MemoryLayout::Pitch && static_cast<s32>(src.width) == config.src_x1 && |