From d2419570b9fcc27e91369b97853fcf65c4fc47dd Mon Sep 17 00:00:00 2001
From: wwylele <wwylele@gmail.com>
Date: Tue, 27 Sep 2016 18:09:53 +0800
Subject: [PATCH] rasterizer: separate TextureCopy from DisplayTransfer

---
 src/video_core/rasterizer_interface.h            |  7 ++++++-
 src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 +++++-----
 src/video_core/renderer_opengl/gl_rasterizer.h   |  1 +
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h
index 71df233b58..8ef7e74c77 100644
--- a/src/video_core/rasterizer_interface.h
+++ b/src/video_core/rasterizer_interface.h
@@ -42,11 +42,16 @@ public:
     /// and invalidated
     virtual void FlushAndInvalidateRegion(PAddr addr, u32 size) = 0;
 
-    /// Attempt to use a faster method to perform a display transfer
+    /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 0
     virtual bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
         return false;
     }
 
+    /// Attempt to use a faster method to perform a display transfer with is_texture_copy = 1
+    virtual bool AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) {
+        return false;
+    }
+
     /// Attempt to use a faster method to fill a region
     virtual bool AccelerateFill(const GPU::Regs::MemoryFillConfig& config) {
         return false;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 60c9d91808..e7ad85bf37 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -692,11 +692,6 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe
     using PixelFormat = CachedSurface::PixelFormat;
     using SurfaceType = CachedSurface::SurfaceType;
 
-    if (config.is_texture_copy) {
-        // TODO(tfarley): Try to hardware accelerate this
-        return false;
-    }
-
     CachedSurface src_params;
     src_params.addr = config.GetPhysicalInputAddress();
     src_params.width = config.output_width;
@@ -751,6 +746,11 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe
     return true;
 }
 
+bool RasterizerOpenGL::AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) {
+    // TODO(tfarley): Try to hardware accelerate this
+    return false;
+}
+
 bool RasterizerOpenGL::AccelerateFill(const GPU::Regs::MemoryFillConfig& config) {
     using PixelFormat = CachedSurface::PixelFormat;
     using SurfaceType = CachedSurface::SurfaceType;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 24fefed1b0..d9b0273050 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -238,6 +238,7 @@ public:
     void FlushRegion(PAddr addr, u32 size) override;
     void FlushAndInvalidateRegion(PAddr addr, u32 size) override;
     bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) override;
+    bool AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) override;
     bool AccelerateFill(const GPU::Regs::MemoryFillConfig& config) override;
     bool AccelerateDisplay(const GPU::Regs::FramebufferConfig& config, PAddr framebuffer_addr,
                            u32 pixel_stride, ScreenInfo& screen_info) override;
-- 
GitLab