summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Subv2015-02-21 18:43:53 -0500
committerGravatar Subv2015-02-21 18:43:53 -0500
commitfbbfb52a2c8c9c7da0e0d684ba8af1781c4ff5e7 (patch)
tree7c398b654e3d9ea07bc4877b9d8db60ba25bb982 /src/core/hw/gpu.cpp
parentMerge pull request #587 from archshift/assert (diff)
downloadyuzu-fbbfb52a2c8c9c7da0e0d684ba8af1781c4ff5e7.tar.gz
yuzu-fbbfb52a2c8c9c7da0e0d684ba8af1781c4ff5e7.tar.xz
yuzu-fbbfb52a2c8c9c7da0e0d684ba8af1781c4ff5e7.zip
GPU: Fixed the RGBA8 input format and RGB8 output format
in Display Transfers, tested with hwtests.
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index bd7d92cd1..536672924 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -132,12 +132,11 @@ inline void Write(u32 addr, const T data) {
132 switch (config.input_format) { 132 switch (config.input_format) {
133 case Regs::PixelFormat::RGBA8: 133 case Regs::PixelFormat::RGBA8:
134 { 134 {
135 // TODO: Most likely got the component order messed up.
136 u8* srcptr = source_pointer + (x * pixel_skip + y * config.input_width) * 4; 135 u8* srcptr = source_pointer + (x * pixel_skip + y * config.input_width) * 4;
137 source_color.r = srcptr[0]; // blue 136 source_color.r = srcptr[3]; // red
138 source_color.g = srcptr[1]; // green 137 source_color.g = srcptr[2]; // green
139 source_color.b = srcptr[2]; // red 138 source_color.b = srcptr[1]; // blue
140 source_color.a = srcptr[3]; // alpha 139 source_color.a = srcptr[0]; // alpha
141 break; 140 break;
142 } 141 }
143 142
@@ -160,11 +159,10 @@ inline void Write(u32 addr, const T data) {
160 159
161 case Regs::PixelFormat::RGB8: 160 case Regs::PixelFormat::RGB8:
162 { 161 {
163 // TODO: Most likely got the component order messed up.
164 u8* dstptr = dest_pointer + (x + y * output_width) * 3; 162 u8* dstptr = dest_pointer + (x + y * output_width) * 3;
165 dstptr[0] = source_color.r; // blue 163 dstptr[2] = source_color.r; // red
166 dstptr[1] = source_color.g; // green 164 dstptr[1] = source_color.g; // green
167 dstptr[2] = source_color.b; // red 165 dstptr[0] = source_color.b; // blue
168 break; 166 break;
169 } 167 }
170 168