summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar wwylele2017-06-29 13:09:23 +0300
committerGravatar wwylele2017-06-29 13:09:23 +0300
commit85a448d40560a40d5fe2424b4c50b7bebe2a6064 (patch)
tree876013f3cc05f2e5bba05653f4f47f5eb39c87eb /src/core/hw/gpu.cpp
parentgpu: fix edge cases for TextureCopy (diff)
downloadyuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.gz
yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.xz
yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.zip
gpu: add comments for TextureCopy
Diffstat (limited to 'src/core/hw/gpu.cpp')
-rw-r--r--src/core/hw/gpu.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index a0a523822..6838e449c 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -334,25 +334,25 @@ static void TextureCopy(const Regs::DisplayTransferConfig& config) {
334 u32 remaining_size = Common::AlignDown(config.texture_copy.size, 16); 334 u32 remaining_size = Common::AlignDown(config.texture_copy.size, 16);
335 335
336 if (remaining_size == 0) { 336 if (remaining_size == 0) {
337 // Real hardware freeze on this 337 LOG_CRITICAL(HW_GPU, "zero size. Real hardware freezes on this.");
338 LOG_CRITICAL(HW_GPU, "zero size");
339 return; 338 return;
340 } 339 }
341 340
342 u32 input_gap = config.texture_copy.input_gap * 16; 341 u32 input_gap = config.texture_copy.input_gap * 16;
343 u32 input_width = input_gap == 0 ? remaining_size : config.texture_copy.input_width * 16;
344 u32 output_gap = config.texture_copy.output_gap * 16; 342 u32 output_gap = config.texture_copy.output_gap * 16;
343
344 // Zero gap means contiguous input/output even if width = 0. To avoid infinite loop below, width
345 // is assigned with the total size if gap = 0.
346 u32 input_width = input_gap == 0 ? remaining_size : config.texture_copy.input_width * 16;
345 u32 output_width = output_gap == 0 ? remaining_size : config.texture_copy.output_width * 16; 347 u32 output_width = output_gap == 0 ? remaining_size : config.texture_copy.output_width * 16;
346 348
347 if (input_width == 0) { 349 if (input_width == 0) {
348 // Real hardware freeze on this 350 LOG_CRITICAL(HW_GPU, "zero input width. Real hardware freezes on this.");
349 LOG_CRITICAL(HW_GPU, "zero input width");
350 return; 351 return;
351 } 352 }
352 353
353 if (output_width == 0) { 354 if (output_width == 0) {
354 // Real hardware freeze on this 355 LOG_CRITICAL(HW_GPU, "zero output width. Real hardware freezes on this.");
355 LOG_CRITICAL(HW_GPU, "zero output width");
356 return; 356 return;
357 } 357 }
358 358