diff options
| author | bunnei <bunneidev@gmail.com> | 2018-10-19 22:58:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-19 22:58:30 -0400 |
| commit | 48495695655210c91a36a4e847aaa73278949991 (patch) | |
| tree | daabac59bf0f4958aeaa3dbcf788728c8295f1bd /src/video_core/engines/fermi_2d.cpp | |
| parent | bf66930fb9a9b22d0d21f3ad590085800f3cdde8 (diff) | |
| parent | 7e665c2721863fe9784dd3de4aa430434fb10cff (diff) | |
Merge pull request #1517 from bunnei/dma
GPU/DMA: Flush the source region and invalidate the destination region when doing a DMA transfer.
Diffstat (limited to 'src/video_core/engines/fermi_2d.cpp')
| -rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 9 |
1 files changed, 6 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() { u32 dst_bytes_per_pixel = RenderTargetBytesPerPixel(regs.dst.format); if (!rasterizer.AccelerateSurfaceCopy(regs.src, regs.dst)) { - // TODO(bunnei): The below implementation currently will not get hit, as - // AccelerateSurfaceCopy tries to always copy and will always return success. This should be - // changed once we properly support flushing. + 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, + 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. |
