summaryrefslogtreecommitdiffstats
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2016-09-27 15:48:03 +0200
committerwwylele <wwylele@gmail.com>2016-09-29 04:01:34 +0200
commit58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c (patch)
tree1345ff8aceb7a1f2672320685411f7b5cb1d9ddd /src/core/hw/gpu.cpp
parentgpu: keep the old signal strategy for null pointer (diff)
downloadyuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar.gz
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar.bz2
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar.lz
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar.xz
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.tar.zst
yuzu-58ae94af4c5c7777cab40ebb4f2bc517dd0f9f2c.zip
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 8a46d71a5..28cb97d8e 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -217,11 +217,14 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
u32 input_x = x << horizontal_scale;
u32 input_y = y << vertical_scale;
+ u32 output_y;
if (config.flip_vertically) {
// Flip the y value of the output data,
// we do this after calculating the [x,y] position of the input image
// to account for the scaling options.
- y = output_height - y - 1;
+ output_y = output_height - y - 1;
+ } else {
+ output_y = y;
}
u32 dst_bytes_per_pixel = GPU::Regs::BytesPerPixel(config.output_format);
@@ -232,16 +235,16 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
if (config.input_linear) {
if (!config.dont_swizzle) {
// Interpret the input as linear and the output as tiled
- u32 coarse_y = y & ~7;
+ u32 coarse_y = output_y & ~7;
u32 stride = output_width * dst_bytes_per_pixel;
src_offset = (input_x + input_y * config.input_width) * src_bytes_per_pixel;
- dst_offset =
- VideoCore::GetMortonOffset(x, y, dst_bytes_per_pixel) + coarse_y * stride;
+ dst_offset = VideoCore::GetMortonOffset(x, output_y, dst_bytes_per_pixel) +
+ coarse_y * stride;
} else {
// Both input and output are linear
src_offset = (input_x + input_y * config.input_width) * src_bytes_per_pixel;
- dst_offset = (x + y * output_width) * dst_bytes_per_pixel;
+ dst_offset = (x + output_y * output_width) * dst_bytes_per_pixel;
}
} else {
if (!config.dont_swizzle) {
@@ -251,10 +254,10 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
src_offset = VideoCore::GetMortonOffset(input_x, input_y, src_bytes_per_pixel) +
coarse_y * stride;
- dst_offset = (x + y * output_width) * dst_bytes_per_pixel;
+ dst_offset = (x + output_y * output_width) * dst_bytes_per_pixel;
} else {
// Both input and output are tiled
- u32 out_coarse_y = y & ~7;
+ u32 out_coarse_y = output_y & ~7;
u32 out_stride = output_width * dst_bytes_per_pixel;
u32 in_coarse_y = input_y & ~7;
@@ -262,7 +265,7 @@ static void DisplayTransfer(const Regs::DisplayTransferConfig& config) {
src_offset = VideoCore::GetMortonOffset(input_x, input_y, src_bytes_per_pixel) +
in_coarse_y * in_stride;
- dst_offset = VideoCore::GetMortonOffset(x, y, dst_bytes_per_pixel) +
+ dst_offset = VideoCore::GetMortonOffset(x, output_y, dst_bytes_per_pixel) +
out_coarse_y * out_stride;
}
}