diff options
author | wwylele <wwylele@gmail.com> | 2017-06-29 12:09:23 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-06-29 12:09:23 +0200 |
commit | 85a448d40560a40d5fe2424b4c50b7bebe2a6064 (patch) | |
tree | 876013f3cc05f2e5bba05653f4f47f5eb39c87eb /src | |
parent | gpu: fix edge cases for TextureCopy (diff) | |
download | yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.gz yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.bz2 yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.lz yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.xz yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.tar.zst yuzu-85a448d40560a40d5fe2424b4c50b7bebe2a6064.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hw/gpu.cpp | 14 | ||||
-rw-r--r-- | src/core/hw/gpu.h | 2 |
2 files changed, 8 insertions, 8 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) { u32 remaining_size = Common::AlignDown(config.texture_copy.size, 16); if (remaining_size == 0) { - // Real hardware freeze on this - LOG_CRITICAL(HW_GPU, "zero size"); + LOG_CRITICAL(HW_GPU, "zero size. Real hardware freezes on this."); return; } u32 input_gap = config.texture_copy.input_gap * 16; - u32 input_width = input_gap == 0 ? remaining_size : config.texture_copy.input_width * 16; u32 output_gap = config.texture_copy.output_gap * 16; + + // Zero gap means contiguous input/output even if width = 0. To avoid infinite loop below, width + // is assigned with the total size if gap = 0. + u32 input_width = input_gap == 0 ? remaining_size : config.texture_copy.input_width * 16; u32 output_width = output_gap == 0 ? remaining_size : config.texture_copy.output_width * 16; if (input_width == 0) { - // Real hardware freeze on this - LOG_CRITICAL(HW_GPU, "zero input width"); + LOG_CRITICAL(HW_GPU, "zero input width. Real hardware freezes on this."); return; } if (output_width == 0) { - // Real hardware freeze on this - LOG_CRITICAL(HW_GPU, "zero output width"); + LOG_CRITICAL(HW_GPU, "zero output width. Real hardware freezes on this."); return; } diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index bdd997b2a..21b127fee 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -225,7 +225,7 @@ struct Regs { INSERT_PADDING_WORDS(0x1); struct { - u32 size; + u32 size; // The lower 4 bits are ignored union { u32 input_size; |