summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Subv2015-07-19 21:30:42 -0500
committerGravatar Subv2015-07-19 21:30:42 -0500
commit63dbff9b1f2cd6f330c8b4aee8e35d1c61cec87e (patch)
tree2843ccd7323844bf6d3c17417c6af4d426571df7 /src/core
parentMerge pull request #949 from yuriks/fix-st (diff)
downloadyuzu-63dbff9b1f2cd6f330c8b4aee8e35d1c61cec87e.tar.gz
yuzu-63dbff9b1f2cd6f330c8b4aee8e35d1c61cec87e.tar.xz
yuzu-63dbff9b1f2cd6f330c8b4aee8e35d1c61cec87e.zip
GPU/DisplayTransfer: Implemented bit 5 in the transfer flags.
It tells the GPU to not swizzle/de-swizzle the input during the transfer.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hw/gpu.cpp42
-rw-r--r--src/core/hw/gpu.h1
2 files changed, 31 insertions, 12 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index a3a7d128f..2a338e8fc 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -217,19 +217,37 @@ inline void Write(u32 addr, const T data) {
217 u32 dst_offset; 217 u32 dst_offset;
218 218
219 if (config.output_tiled) { 219 if (config.output_tiled) {
220 // Interpret the input as linear and the output as tiled 220 if (!config.dont_swizzle) {
221 u32 coarse_y = y & ~7; 221 // Interpret the input as linear and the output as tiled
222 u32 stride = output_width * dst_bytes_per_pixel; 222 u32 coarse_y = y & ~7;
223 223 u32 stride = output_width * dst_bytes_per_pixel;
224 src_offset = (input_x + input_y * config.input_width) * src_bytes_per_pixel; 224
225 dst_offset = VideoCore::GetMortonOffset(x, y, dst_bytes_per_pixel) + coarse_y * stride; 225 src_offset = (input_x + input_y * config.input_width) * src_bytes_per_pixel;
226 dst_offset = VideoCore::GetMortonOffset(x, y, dst_bytes_per_pixel) + coarse_y * stride;
227 } else {
228 // Both input and output are linear
229 src_offset = (input_x + input_y * config.input_width) * src_bytes_per_pixel;
230 dst_offset = (x + y * output_width) * dst_bytes_per_pixel;
231 }
226 } else { 232 } else {
227 // Interpret the input as tiled and the output as linear 233 if (!config.dont_swizzle) {
228 u32 coarse_y = input_y & ~7; 234 // Interpret the input as tiled and the output as linear
229 u32 stride = config.input_width * src_bytes_per_pixel; 235 u32 coarse_y = input_y & ~7;
230 236 u32 stride = config.input_width * src_bytes_per_pixel;
231 src_offset = VideoCore::GetMortonOffset(input_x, input_y, src_bytes_per_pixel) + coarse_y * stride; 237
232 dst_offset = (x + y * output_width) * dst_bytes_per_pixel; 238 src_offset = VideoCore::GetMortonOffset(input_x, input_y, src_bytes_per_pixel) + coarse_y * stride;
239 dst_offset = (x + y * output_width) * dst_bytes_per_pixel;
240 } else {
241 // Both input and output are tiled
242 u32 out_coarse_y = y & ~7;
243 u32 out_stride = output_width * dst_bytes_per_pixel;
244
245 u32 in_coarse_y = input_y & ~7;
246 u32 in_stride = config.input_width * src_bytes_per_pixel;
247
248 src_offset = VideoCore::GetMortonOffset(input_x, input_y, src_bytes_per_pixel) + in_coarse_y * in_stride;
249 dst_offset = VideoCore::GetMortonOffset(x, y, dst_bytes_per_pixel) + out_coarse_y * out_stride;
250 }
233 } 251 }
234 252
235 const u8* src_pixel = src_pointer + src_offset; 253 const u8* src_pixel = src_pointer + src_offset;
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h
index 5b8c43f8b..daad506fe 100644
--- a/src/core/hw/gpu.h
+++ b/src/core/hw/gpu.h
@@ -203,6 +203,7 @@ struct Regs {
203 BitField< 0, 1, u32> flip_vertically; // flips input data vertically 203 BitField< 0, 1, u32> flip_vertically; // flips input data vertically
204 BitField< 1, 1, u32> output_tiled; // Converts from linear to tiled format 204 BitField< 1, 1, u32> output_tiled; // Converts from linear to tiled format
205 BitField< 3, 1, u32> raw_copy; // Copies the data without performing any processing 205 BitField< 3, 1, u32> raw_copy; // Copies the data without performing any processing
206 BitField< 5, 1, u32> dont_swizzle;
206 BitField< 8, 3, PixelFormat> input_format; 207 BitField< 8, 3, PixelFormat> input_format;
207 BitField<12, 3, PixelFormat> output_format; 208 BitField<12, 3, PixelFormat> output_format;
208 209