diff options
| author | 2019-05-07 23:13:05 -0400 | |
|---|---|---|
| committer | 2019-06-20 21:36:12 -0300 | |
| commit | 324e470879e63423844a687f7d675a0536006f07 (patch) | |
| tree | f64ad5cab4dc4f6ba1c63c9d34fc356b64b63b31 /src/video_core/texture_cache | |
| parent | surface_view: Add constructor for ViewParams (diff) | |
| download | yuzu-324e470879e63423844a687f7d675a0536006f07.tar.gz yuzu-324e470879e63423844a687f7d675a0536006f07.tar.xz yuzu-324e470879e63423844a687f7d675a0536006f07.zip | |
Texture Cache: Implement Blitting and Fermi Copies
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index c9a648bbd..bb5a50ab9 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include "common/assert.h" | 16 | #include "common/assert.h" |
| 17 | #include "common/common_types.h" | 17 | #include "common/common_types.h" |
| 18 | #include "common/math_util.h" | ||
| 18 | #include "core/memory.h" | 19 | #include "core/memory.h" |
| 19 | #include "video_core/engines/fermi_2d.h" | 20 | #include "video_core/engines/fermi_2d.h" |
| 20 | #include "video_core/engines/maxwell_3d.h" | 21 | #include "video_core/engines/maxwell_3d.h" |
| @@ -142,10 +143,11 @@ public: | |||
| 142 | } | 143 | } |
| 143 | } | 144 | } |
| 144 | 145 | ||
| 145 | TView GetFermiSurface(const Tegra::Engines::Fermi2D::Regs::Surface& config) { | 146 | void DoFermiCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, |
| 146 | SurfaceParams params = SurfaceParams::CreateForFermiCopySurface(config); | 147 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, |
| 147 | const GPUVAddr gpu_addr = config.Address(); | 148 | const Common::Rectangle<u32>& src_rect, |
| 148 | return GetSurface(gpu_addr, params, true).second; | 149 | const Common::Rectangle<u32>& dst_rect) { |
| 150 | ImageBlit(GetFermiSurface(src_config), GetFermiSurface(dst_config), src_rect, dst_rect); | ||
| 149 | } | 151 | } |
| 150 | 152 | ||
| 151 | TSurface TryFindFramebufferSurface(const u8* host_ptr) { | 153 | TSurface TryFindFramebufferSurface(const u8* host_ptr) { |
| @@ -183,6 +185,9 @@ protected: | |||
| 183 | virtual void ImageCopy(TSurface src_surface, TSurface dst_surface, | 185 | virtual void ImageCopy(TSurface src_surface, TSurface dst_surface, |
| 184 | const CopyParams& copy_params) = 0; | 186 | const CopyParams& copy_params) = 0; |
| 185 | 187 | ||
| 188 | virtual void ImageBlit(TSurface src, TSurface dst, const Common::Rectangle<u32>& src_rect, | ||
| 189 | const Common::Rectangle<u32>& dst_rect) = 0; | ||
| 190 | |||
| 186 | void Register(TSurface surface) { | 191 | void Register(TSurface surface) { |
| 187 | const GPUVAddr gpu_addr = surface->GetGpuAddr(); | 192 | const GPUVAddr gpu_addr = surface->GetGpuAddr(); |
| 188 | const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr)); | 193 | const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr)); |
| @@ -223,6 +228,12 @@ protected: | |||
| 223 | return new_surface; | 228 | return new_surface; |
| 224 | } | 229 | } |
| 225 | 230 | ||
| 231 | TSurface GetFermiSurface(const Tegra::Engines::Fermi2D::Regs::Surface& config) { | ||
| 232 | SurfaceParams params = SurfaceParams::CreateForFermiCopySurface(config); | ||
| 233 | const GPUVAddr gpu_addr = config.Address(); | ||
| 234 | return GetSurface(gpu_addr, params, true).first; | ||
| 235 | } | ||
| 236 | |||
| 226 | Core::System& system; | 237 | Core::System& system; |
| 227 | 238 | ||
| 228 | private: | 239 | private: |