diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 597b279b9..74e44c7fe 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -47,9 +47,12 @@ void Fermi2D::HandleSurfaceCopy() { | |||
| 47 | u32 dst_bytes_per_pixel = RenderTargetBytesPerPixel(regs.dst.format); | 47 | u32 dst_bytes_per_pixel = RenderTargetBytesPerPixel(regs.dst.format); |
| 48 | 48 | ||
| 49 | if (!rasterizer.AccelerateSurfaceCopy(regs.src, regs.dst)) { | 49 | if (!rasterizer.AccelerateSurfaceCopy(regs.src, regs.dst)) { |
| 50 | // TODO(bunnei): The below implementation currently will not get hit, as | 50 | rasterizer.FlushRegion(source_cpu, src_bytes_per_pixel * regs.src.width * regs.src.height); |
| 51 | // AccelerateSurfaceCopy tries to always copy and will always return success. This should be | 51 | // We have to invalidate the destination region to evict any outdated surfaces from the |
| 52 | // changed once we properly support flushing. | 52 | // cache. We do this before actually writing the new data because the destination address |
| 53 | // might contain a dirty surface that will have to be written back to memory. | ||
| 54 | rasterizer.InvalidateRegion(dest_cpu, | ||
| 55 | dst_bytes_per_pixel * regs.dst.width * regs.dst.height); | ||
| 53 | 56 | ||
| 54 | if (regs.src.linear == regs.dst.linear) { | 57 | if (regs.src.linear == regs.dst.linear) { |
| 55 | // If the input layout and the output layout are the same, just perform a raw copy. | 58 | // If the input layout and the output layout are the same, just perform a raw copy. |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 468253033..3daccf82f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -659,6 +659,12 @@ void RasterizerOpenGL::FlushAndInvalidateRegion(VAddr addr, u64 size) { | |||
| 659 | bool RasterizerOpenGL::AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, | 659 | bool RasterizerOpenGL::AccelerateSurfaceCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src, |
| 660 | const Tegra::Engines::Fermi2D::Regs::Surface& dst) { | 660 | const Tegra::Engines::Fermi2D::Regs::Surface& dst) { |
| 661 | MICROPROFILE_SCOPE(OpenGL_Blits); | 661 | MICROPROFILE_SCOPE(OpenGL_Blits); |
| 662 | |||
| 663 | if (Settings::values.use_accurate_gpu_emulation) { | ||
| 664 | // Skip the accelerated copy and perform a slow but more accurate copy | ||
| 665 | return false; | ||
| 666 | } | ||
| 667 | |||
| 662 | res_cache.FermiCopySurface(src, dst); | 668 | res_cache.FermiCopySurface(src, dst); |
| 663 | return true; | 669 | return true; |
| 664 | } | 670 | } |