summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Valle <subv2112@gmail.com>2018-04-29 16:49:33 +0200
committerGitHub <noreply@github.com>2018-04-29 16:49:33 +0200
commitfaa431b27466822728d56ebae84d2201197fd856 (patch)
treef087a390c3c99076216bb42065690dc19d01ac41
parentMerge pull request #414 from lioncash/cruft (diff)
parentfermi_2d: Fix surface copy block height. (diff)
downloadyuzu-faa431b27466822728d56ebae84d2201197fd856.tar
yuzu-faa431b27466822728d56ebae84d2201197fd856.tar.gz
yuzu-faa431b27466822728d56ebae84d2201197fd856.tar.bz2
yuzu-faa431b27466822728d56ebae84d2201197fd856.tar.lz
yuzu-faa431b27466822728d56ebae84d2201197fd856.tar.xz
yuzu-faa431b27466822728d56ebae84d2201197fd856.tar.zst
yuzu-faa431b27466822728d56ebae84d2201197fd856.zip
-rw-r--r--src/video_core/engines/fermi_2d.cpp4
-rw-r--r--src/video_core/engines/fermi_2d.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp
index 9019f2504..6b9382f06 100644
--- a/src/video_core/engines/fermi_2d.cpp
+++ b/src/video_core/engines/fermi_2d.cpp
@@ -59,12 +59,12 @@ void Fermi2D::HandleSurfaceCopy() {
// 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, src_bytes_per_pixel,
dst_bytes_per_pixel, src_buffer, dst_buffer, true,
- regs.src.block_height);
+ regs.src.BlockHeight());
} else {
// If the input is linear and the output is tiled, swizzle the input and copy it over.
Texture::CopySwizzledData(regs.src.width, regs.src.height, src_bytes_per_pixel,
dst_bytes_per_pixel, dst_buffer, src_buffer, false,
- regs.dst.block_height);
+ regs.dst.BlockHeight());
}
}
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h
index 0c5b413cc..70667cb94 100644
--- a/src/video_core/engines/fermi_2d.h
+++ b/src/video_core/engines/fermi_2d.h
@@ -49,6 +49,11 @@ public:
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
address_low);
}
+
+ u32 BlockHeight() const {
+ // The block height is stored in log2 format.
+ return 1 << block_height;
+ }
};
static_assert(sizeof(Surface) == 0x28, "Surface has incorrect size");