diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-22 07:47:56 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-03 08:58:40 +0100 |
commit | 2bdbb90af74683bd8bb7e25d5353c39fb8037f8c (patch) | |
tree | 443865c07c307ddc4ac41e82387395bde95641e6 /src/video_core/engines/fermi_2d.cpp | |
parent | maxwell_3d: Allow sampler handles with TSC id zero (diff) | |
download | yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar.gz yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar.bz2 yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar.lz yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar.xz yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.tar.zst yuzu-2bdbb90af74683bd8bb7e25d5353c39fb8037f8c.zip |
Diffstat (limited to 'src/video_core/engines/fermi_2d.cpp')
-rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index 80f70e332..9f1533263 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp @@ -42,8 +42,10 @@ void Fermi2D::HandleSurfaceCopy() { // TODO(Subv): Only raw copies are implemented. ASSERT(regs.operation == Regs::Operation::SrcCopy); - const VAddr source_cpu = *memory_manager.GpuToCpuAddress(source); - const VAddr dest_cpu = *memory_manager.GpuToCpuAddress(dest); + const auto source_cpu = memory_manager.GpuToCpuAddress(source); + const auto dest_cpu = memory_manager.GpuToCpuAddress(dest); + ASSERT_MSG(source_cpu, "Invalid source GPU address"); + ASSERT_MSG(dest_cpu, "Invalid destination GPU address"); u32 src_bytes_per_pixel = RenderTargetBytesPerPixel(regs.src.format); u32 dst_bytes_per_pixel = RenderTargetBytesPerPixel(regs.dst.format); @@ -52,22 +54,22 @@ void Fermi2D::HandleSurfaceCopy() { // All copies here update the main memory, so mark all rasterizer states as invalid. Core::System::GetInstance().GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); - rasterizer.FlushRegion(source_cpu, src_bytes_per_pixel * regs.src.width * regs.src.height); + rasterizer.FlushRegion(*source_cpu, src_bytes_per_pixel * regs.src.width * regs.src.height); // We have to invalidate the destination region to evict any outdated surfaces from the // cache. We do this before actually writing the new data because the destination address // might contain a dirty surface that will have to be written back to memory. - rasterizer.InvalidateRegion(dest_cpu, + rasterizer.InvalidateRegion(*dest_cpu, dst_bytes_per_pixel * regs.dst.width * regs.dst.height); if (regs.src.linear == regs.dst.linear) { // If the input layout and the output layout are the same, just perform a raw copy. ASSERT(regs.src.BlockHeight() == regs.dst.BlockHeight()); - Memory::CopyBlock(dest_cpu, source_cpu, + Memory::CopyBlock(*dest_cpu, *source_cpu, src_bytes_per_pixel * regs.dst.width * regs.dst.height); return; } - u8* src_buffer = Memory::GetPointer(source_cpu); - u8* dst_buffer = Memory::GetPointer(dest_cpu); + u8* src_buffer = Memory::GetPointer(*source_cpu); + u8* dst_buffer = Memory::GetPointer(*dest_cpu); if (!regs.src.linear && regs.dst.linear) { // If the input is tiled and the output is linear, deswizzle the input and copy it over. Texture::CopySwizzledData(regs.src.width, regs.src.height, regs.src.depth, |