summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2015-02-22 12:44:57 -0500
committerGravatar bunnei2015-02-22 12:44:57 -0500
commitd120757f3251af7c3737c8112dda06efeccac8b0 (patch)
tree8761d8e867d0fe37ff3db58ed7a1ae21e944db15 /src/core/hw/gpu.cpp
parentMerge pull request #593 from Subv/search_problem (diff)
parentGPU: Fixed the RGBA8 input format and RGB8 output format (diff)
downloadyuzu-d120757f3251af7c3737c8112dda06efeccac8b0.tar.gz
yuzu-d120757f3251af7c3737c8112dda06efeccac8b0.tar.xz
yuzu-d120757f3251af7c3737c8112dda06efeccac8b0.zip
Merge pull request #594 from Subv/display_transfer
GPU: Fixed the RGBA8 input format and RGB8 output format
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